Architecture
This page describes Epoch from an integrator's perspective — what your app talks to and what happens when a user submits an intent. It does not cover Epoch's internal infrastructure.
System boundary
Your application integrates with:
EpochIntentSDK— TypeScript SDK (@epoch-protocol/epoch-intents-sdk)User wallet — viem/wagmi
walletClientfor signing
You do not need to call Epoch's internal services directly — the SDK handles quoting, signing, submission, and status polling.
Multi-step paths (conceptual)
Epoch may compose several steps into one intent:
Example path for a cross-chain raffle ticket purchase:
You submit a single task; Epoch selects and executes the path. Use getIntentQuote to inspect the planned route before execution.
End-to-end example: cross-chain raffle ticket
This mirrors the Kismet integration pattern.
Setup
User funds
Polygon (137)
USDC
Raffle / protocol
Base (8453)
Payment token + raffle contract
User wallet
Any connected EOA
Signs on source chain
Steps
User selects source chain and token in your UI.
App calls
getTaskDatawithTaskType.ProtocolInteraction, destination Base, and raffleextraData.App calls
getIntentQuotewithtokenInAmount: "0"andminTokenOutset to the fixed ticket cost (reverse quote).User reviews quote (input USDC amount, path preview).
App calls
solveIntentwith the quote; user signs in wallet.App polls
getIntentStatusevery few seconds until complete.User holds tickets on Base.
Two-chain mental model
Source chain
Where the user's wallet is connected and input tokens live
Destination chain
Where the protocol action executes (raffle on Base)
Your UI should make this distinction clear — users may need to switch to the source chain before signing.
Key payloads
Intent request (SDK level)
When using the SDK, intent fields are assembled automatically during solveIntent. The SDK handles:
Nonce retrieval
solveIntent flow
Intent signing
walletClient
Task encoding
getTaskData
Approvals
solveIntent
Task data (SDK level)
Built via getTaskData:
depositTokenAddress
Input token on source chain
tokenInAmount
Input amount ("0" for reverse quotes)
outputTokenAddress
Target token on destination chain
minTokenOut
Minimum output (fixed amount for reverse quotes)
destinationChainId
Target chain ID
protocolHashIdentifier
Protocol identifier hash
recipient
Address receiving output on destination
Quote response
success
Whether quoting succeeded
tokenIn / tokenOut
Resolved amounts
path
Execution path modules
resourceLockRequired
Whether Compact lock is needed
transactions
Preview of transactions user may sign
Execution status
Polled via getIntentStatus(userAddress, nonce). Returns per-transaction status, chain ID, and transaction hash when available.
Transaction batching & EIP-7702 (optional)
For integrators using Compact deposits or multi-transaction intents:
EIP-5792 batching — when the user's wallet is already a smart account (7702-delegated or atomic-capable), the SDK batches contiguous same-chain calls into one
wallet_sendCallsprompt.EIP-7702 gasless relay (testnet) — local signers can delegate via
convertToSmartAccount; smallocator validates and forwards to epoch-sio, which broadcasts type-4 transactions with a funded relayer key.Plain EOAs — approve and deposit run as separate transactions; the user pays gas.
The SDK resolves batch strategy automatically inside depositToCompact and solveIntent. Probe with canBatchCalls or getWalletGaslessStatus for UI hints.
See Transaction Batching & EIP-7702 for architecture diagrams, operator env vars, and the local-wallet-gasless.ts test script.
Pathfinding
Integrators do not configure paths manually.
Submit a task; Epoch's orchestrator finds compatible routes across supported chains and protocol modules.
Use
getIntentQuoteto preview the path and amounts before execution.
Next steps
Last updated