Audience: Contributors ramping on intent protocols · Version: 1.0 · Status: Recommended reading list — not exhaustive
See also: README · Architecture · MVP specification · Contributing
This document guides you through understanding existing intent-based and cross-chain protocols to inform design decisions for Intent Layer Protocol.
Repository: https://github.com/cowprotocol/contracts
Language: Solidity
Key Files to Study:
contracts/
├── GPv2Settlement.sol (main settlement contract)
├── GPv2Encoding.sol (order encoding)
├── GPv2AllowListAuthentication.sol (signature validation)
└── libraries/
└── GPv2SafeERC20.sol (safe token transfers)
-
Order Format (
GPv2Order)- How do they encode orders?
- How is an order identified (hash)?
- What fields are required vs optional?
-
Settlement Logic
- How are orders atomically settled?
- How do they handle token transfers?
- What's their flow batch model?
-
Signature Verification
- How do they validate solver signatures?
- How do they prevent replay attacks?
- EIP-712 vs raw signatures?
// From GPv2Settlement.sol
function settle(
bytes calldata tokens,
uint256[] calldata clearingPrices,
Trade[] calldata trades,
bytes[] calldata interactions,
bytes calldata data
) external {
// How do they settle multiple trades atomically?
// How do they handle token transfers?
// How do they call external contracts safely?
}Key Insight: CoW Protocol's strength is efficient batch settlement. Study their fee mechanism and how they minimize MEV.
Repository: https://github.com/Uniswap/UniswapX
Language: Solidity
Key Concept: Fillers (solvers) compete to fill user intents
-
Intent Encoding (ERC-7683)
- What fields define an intent?
- How is an intent hash calculated?
- How does it differ from orders?
-
Resolver Pattern
- How do fillers/solvers resolve intents?
- What do they return vs execute?
- How does settlement happen?
-
Signature Scheme
- How are intents signed by users?
- How do fillers prove they fulfilled it?
- Replay protection mechanism?
// Intent structure (approximate)
struct Intent {
address tokenIn;
address tokenOut;
uint256 amountIn;
uint256 minAmountOut;
uint256 deadline;
// ... others
}Key Insight: ERC-7683 is the standard everyone will follow. Make sure your protocol is compatible.
Repository: https://github.com/LayerZero-Labs/oapp-evm
Language: Solidity
Key Concept: Omnichain applications (OApps)
-
OApp Pattern
- How do you inherit from OApp?
- How do you send messages across chains?
- How do you receive messages?
-
Message Format
- What's included in a LayerZero message?
- How do you structure payload?
- What are send/receive options?
-
Security & Verification
- How does LayerZero verify messages?
- What are oracle + relayer?
- How can they fail?
// From oapp-evm
contract OApp is IOApp, Ownable {
// Send a message to destination chain
function _lzSend(
uint32 _dstEid,
bytes memory _message,
bytes memory _options
) internal {
// How does this work?
}
// Receive a message from source chain
function _lzReceive(
address _oapp,
uint32 _srcEid,
bytes calldata _message
) internal virtual {
// How is authenticity verified?
}
}Key Insight: LayerZero abstracts cross-chain complexity. Study their security model and understand potential failure modes.
Repository: https://github.com/smartcontractkit/chainlink-ccip
Language: Solidity
Key Concept: More formal, compliance-first cross-chain messaging
-
CCIP Router
- How do you send messages via CCIP?
- What's the message format?
- What are risk management features?
-
Fees & Gas
- How are fees calculated?
- Premium for on-chain confirmation?
- How does gas vary per chain?
-
Security
- How does CCIP verify messages?
- What are rate limits?
- How do they prevent abuse?
| Feature | LayerZero | CCIP |
|---|---|---|
| Cost | Cheaper | More expensive |
| Speed | Faster | Slower (safer) |
| Security | Good | Very good |
| Maturity | Older, larger | Newer, formal |
| Best for | High volume | Conservative |
Decision for Phase 1: Use LayerZero (faster, cheaper). Have option to switch to CCIP if needed.
Repository: https://github.com/across-protocol/across-contracts
Language: Solidity
Key Concept: Intent-based bridging with relayers
-
Deposit Structure
- How do users request transfers?
- What data is needed?
- How are deposits identified?
-
Relayer Model
- How do relayers fulfill deposits?
- What incentives do they have?
- How are they rewarded?
-
Settlement
- How is settlement finalized?
- How do they handle failures?
- Timeout mechanism?
Across proves that relayer-based intent settlement can work. Their economic model (relayers frontrun settlement) is worth studying.
Repository: https://github.com/router-resources/routerintentscookbook
Language: Solidity
Key Concept: Intent framework for L1/L2
-
Adapter Pattern
- How do adapters convert intents to actions?
- How are adapters plugged in?
- What's the interface?
-
Intent Validation
- How do they validate intents?
- What's the hashing scheme?
- Nonce/replay protection?
-
Execution
- How do intents get executed?
- What's the flow vs settlement model?
- Failure modes?
Key Insight: Router's adapter pattern could be useful for extensibility (Phase 2+).
| Aspect | CoW | UniswapX | LayerZero | Across | Router |
|---|---|---|---|---|---|
| Intent Matching | 5/5 | 4/5 | N/A | 3/5 | 2/5 |
| Cross-Chain | No | No | 5/5 | 4/5 | 3/5 |
| Solver Economics | 4/5 | 4/5 | N/A | 4/5 | 2/5 |
| Code Clarity | 3/5 | 4/5 | 5/5 | 2/5 | 3/5 |
| Scalability | 3/5 | 3/5 | 4/5 | 4/5 | 2/5 |
- Benefit: Compatible with UniswapX, others
- Benefit: Clearer intent definition
- Use UniswapX as reference for encoding
- Faster settlement (good UX)
- Lower fees
- Risk: If LayerZero fails, have CCIP fallback
- Topology: pair LayerZero OApp
setPeerwith on-chainChainPeerRegistry— EID lookup andisRouteSupportedlive in storage so new chains are config + deploy, not per-chain Solidity forks (see Architecture).
- Proven model
- Competitive pricing
- Decentralized
- Copy CoW's fee mechanism
- No existing protocol does cross-chain P2P matching
- Your innovation: Design matching engine from scratch
- Reference: CoW's batch auction logic
- Proven failure recovery
- User can refund if settlement takes too long
- Implement 5-minute timeout
Week 1: Understand Intent-Based Models
- Read CoW Protocol
GPv2Settlement.sol(understand batch settlement) - Read UniswapX intent encoding (understand ERC-7683)
- Sketch your intent format
Week 2: Cross-Chain Mechanics
- Read LayerZero
OApp.sol(understand message passing) - Read simple LayerZero example (e.g., OFT)
- Read this repo’s
contracts/src/ChainPeerRegistry.solandIntentSettler.sol(routing +submitIntentguards) - Design your cross-chain message format (include
messageVersionper Architecture)
Week 3: Matching Engine
- Read CoW
GPv2Settlement.settle()(batch matching) - Read Across relayer model
- Design your P2P matching algorithm (pseudocode)
Week 4: Solver Economics
- Read CoW's solver auction mechanism
- Read UniswapX filler economics
- Design your solver incentive model
As you read each codebase, answer:
-
Intentions
- What data defines an intent?
- How is intent uniqueness guaranteed (hash)?
- What are the invariants that must hold?
-
Settlement
- What is the atomic operation (on-chain)?
- What happens if it fails halfway?
- How is failure recovered?
-
Security
- How are signatures validated?
- How is replay prevented?
- What are the trust assumptions?
-
Economics
- Who pays for what?
- How are fees distributed?
- What incentivizes good behavior?
-
Scalability
- How many intents can be processed per block/second?
- What's the bottleneck?
- How would you scale further?
- ERC-7683: https://eips.ethereum.org/EIPS/eip-7683
- LayerZero Docs: https://docs.layerzero.network/
- Chainlink CCIP Docs: https://docs.chain.link/ccip
- CoW Protocol Docs: https://docs.cow.fi/
- Across Docs: https://docs.across.to/
| Version | 1.0 |
| Last updated | 2026-05-06 |
| Status | Maintained reading list — add PRs to capture new reference implementations |