What you will learn
- The 8 stages of the transaction pipeline
- What each stage does and what can go wrong
- How stages are correlated in the audit trail
Pipeline overview
Every fund-affecting operation flows through the same pipeline. No stage can be skipped.Stage 1: Intent received
The pipeline begins when an adapter submits a TxIntent to ISCL Core viaPOST /v1/tx/approve-request.
The TxIntent is a declarative JSON document describing what the agent wants to do. It specifies the action type, parameters, constraints, and metadata — but never raw calldata or signing instructions.
Audit event: intent_received
Stage 2: Schema validation
The intent is validated against the TxIntent v1 JSON Schema using AJV in strict mode:- All required fields must be present (
version,id,timestamp,chain,wallet,action,constraints) additionalProperties: falseat every level — no undocumented fields- Addresses must match
^0x[0-9a-fA-F]{40}$ - Amounts must be numeric strings (
^[0-9]+$) action.typemust be one of:transfer,transfer_native,approve,swap_exact_in,swap_exact_out
Stage 3: Policy evaluation
The PolicyEngine evaluates the intent against configurable rules, in order:
The first
deny stops evaluation. If no denials, the decision is allow or require_approval.
Audit event: policy_evaluated
Failure: HTTP 403 with policy_denied and reasons array.
Stage 4: Transaction build
The TxBuilder constructs a concrete EVM transaction from the intent’s typed parameters:
The builder sets:
to, data, value, chainId, type (EIP-1559). Gas parameters are estimated later.
Audit event: tx_built
Stage 5: Preflight simulation
The PreflightService simulates the transaction usingeth_call on the target chain’s RPC endpoint:
- Simulate execution — run
eth_callwith the built transaction - Estimate gas — call
eth_estimateGas - Compute risk score — 7-factor analysis (value magnitude, recipient history, contract risk, gas anomaly, approval risk, chain risk, source trust)
- Check balance — verify the wallet can cover the transfer + gas
require_approval even if the value is below the threshold.
Audit event: preflight_simulated
Failure: HTTP 502 if no RPC endpoint is configured.
Stage 6: Approval
Based on the policy decision and risk score:- allow — Transaction proceeds without human confirmation
- require_approval — The approval service prompts the operator
The approval prompt shows: action description, risk score, estimated gas, balance diffs, and any warnings.
If approved, a single-use approval token is issued with a 300-second TTL. The token is cryptographically bound to the intent’s canonical hash.
Audit events:
approval_requested, approval_decided
Failure: HTTP 403 with user_declined if the operator denies.
Stage 7: Signing + broadcast
Thesign-and-send endpoint performs final execution:
- Policy re-check — Policy is re-evaluated to prevent TOCTOU attacks
- Token validation — Approval token is verified: correct hash binding, not expired, not consumed
- Token consumption — Token is marked as used (single-use enforcement)
- Key unlock — The encrypted key is decrypted in memory using scrypt
- Signing — ECDSA signature via viem’s
signTransaction - Broadcast —
eth_sendRawTransactionto the configured RPC endpoint
signed, broadcast
Failure: HTTP 403 with signing_failed, approval_required, or invalid_approval_token.
Stage 8: Audit logging
Every stage writes to the append-only SQLite audit trail. All events for one transaction share the sameintentId, enabling full lifecycle reconstruction:
Error recovery
Next steps
- Policy Engine — Deep dive into policy rules
- Approval Model — Approval modes and token mechanics
- REST API — Endpoint details for each pipeline stage