EPC-1 · Execution Precondition Protocol

The Standard Every
Execution Must Speak

A deterministic pre-execution verification protocol that evaluates transaction feasibility before on-chain submission. Probabilistic verdicts. Cryptographic anchoring. Configurable policy per caller.

LIVE · fwgate.to · zaghmout.btc · ERC-8004 #54

The Problem

Current DeFi systems execute blindly — no pre-check before capital is committed

0%
Execution viability check before submit
Gas burned on failed invisible transactions
STX → ALEXNON_EXECUTABLE0% feasibility
STX → sBTCDEGRADED51% feasibility
WHALE → wSTXVIABLE87% feasibility

Three-Layer Architecture

Each layer is independently testable, upgradeable, and auditable

Layer 1 — Data
Raw State Ingestion
Sources: ALEX API · on-chain pool reads · mempool · historical replay
Role: Gather raw on-chain state. No opinions. Pure facts.
Layer 2 — Intelligence
Probabilistic Risk Computation
Systems: FW_CONSENSUS · FW_SIM · FW_LIQ · FW_REGIME
Computes P(executable), risk scores, confidence. No decisions.
Layer 3 — Policy (EPC-1)
Decision Engine
Applies rules: EXECUTE · WARN · BLOCK
Configurable per caller: dex (strict) · bot (standard) · agent (permissive)

Decision Model

Mathematical formula — no black boxes

D(x) = EXECUTE if P(success) ≥ θ₁
WARN if θ₂ ≤ P(success) < θ₁
BLOCK if P(success) < θ₂

P(success) = feasibility × 0.40
+ consensus × 0.25
+ liquidity × 0.20
+ oracle × 0.15
− slippage × 0.10
− (hops−1) × 0.05

// model_confidence = consensus×0.6 + oracle×0.4

Protocol Interface

POST /epc/v1/evaluate — standard endpoint

Request POST /epc/v1/evaluate
"route":   "STX→ALEX",
"amount":  1000,
"context": "swap",
"caller":  "dex_router"
Response EPC-1 v1.1
"verdict":     "non_executable",
"probability": {
  "executable": 0.04,
  "fail":       0.85
},
"policy": {
  "decision": "BLOCK",
  "rule": "P_BELOW_THRESHOLD"
},
"model_confidence": 0.89

On-Chain Proof

Every verdict is cryptographically anchored on Stacks mainnet

IP Registry TX2fdae64aee84da18d9b924b326cf36fd8d44e14f94c204dd51816f2bc3f7af35
IP Hash45b9559a323cb4a2249544f7b26b95501a5c2cb19f2c5a5e727e0adb2f6eb09a
ContractSP322...whale-ip-store-v1
Block7692590 · Stacks Mainnet
Authorzaghmout.btc · ERC-8004 #54

Integration in Under 1 Day

Option A — UI Guard 3 lines
// Before enabling Swap button:
const res = await fetch('https://fwgate.to/epc/v1/evaluate', {
  method: 'POST', body: JSON.stringify({ route, amount, caller: 'dex' })
});
if (res.policy.decision === 'BLOCK') disableSwapButton();
Option B — Agent Pipeline 1 line
agent.plan() → epc1.check()if allowed: agent.execute()