Overview
The Eco Routes Protocol is designed to support both EVM chains (Ethereum, Polygon, Arbitrum, etc.) and non-EVM chains (Solana, Sui, etc.) through a flexible type system and modular architecture.Dual-Type System
The protocol supports two parallel type systems to accommodate different blockchain architectures:EVM Intent Types
Optimized for Ethereum Virtual Machine chains using nativeaddress types (20 bytes):
contracts/types/Intent.sol
- Familiar to Solidity developers
- Gas-efficient on EVM chains
- Native tooling support
- Type safety for EVM addresses
Universal Intent Types
Designed for cross-VM compatibility usingbytes32 for address identifiers:
- Compatible with non-EVM chains (Solana, Sui, etc.)
- Unified cross-chain addressing
- Future-proof for new blockchain architectures
- Same struct names simplify integration
bytes32 vs address Types
Technical Design
The dual-type approach leverages EVM’s ABI encoding:bytes32 type can represent both:
- EVM addresses (with zero-padding)
- Non-EVM identifiers (using full 32 bytes)
Claimant Identifiers
The protocol usesbytes32 for claimant identifiers to support cross-VM reward distribution:
contracts/Inbox.sol
- EVM solver: Converts their address to
bytes32 - Non-EVM solver: Provides their native identifier as
bytes32
- Prover converts
bytes32claimant back to the appropriate address type - Rewards distributed using the native address format
Type Conversion
The protocol includes theAddressConverter library for converting between types:
contracts/libs/AddressConverter.sol
When converting from
bytes32 to address, the upper 12 bytes must be zero for valid EVM addresses. The conversion extracts only the lower 20 bytes.Modular Contract Structure
The protocol uses inheritance to separate EVM-specific and universal functionality:Source Chain (IntentSource)
EVM-specific operations:contracts/IntentSource.sol
contracts/IntentSource.sol
- Accepts route as
bytesfor cross-VM compatibility - Computes hash from encoded bytes:
keccak256(route) - Allows non-EVM chains to create intents via encoding
Destination Chain (Inbox)
Universal fulfillment:contracts/Inbox.sol
contracts/Inbox.sol
bytes32, enabling:
- EVM addresses (converted to bytes32)
- Solana public keys (native bytes32)
- Any other 32-byte identifier
Cross-Chain Prover Support
Provers handle the conversion between universal and EVM-specific types:- Receive
bytes32claimant from destination chain - Convert to
addressfor EVM source chain storage - Store proof with converted address
- Enable withdrawal to EVM address
contracts/IntentSource.sol
Provers act as the bridge between universal
bytes32 identifiers on destination chains and EVM address types on source chains.Integration Guidelines
For EVM-Only Applications
If your application only interacts with EVM chains:For Cross-VM Applications
If your application needs to support non-EVM chains:Chain ID Considerations
The protocol usesuint64 for chain IDs to support both EVM and non-EVM chains:
contracts/Inbox.sol
- Ethereum Mainnet:
1 - Polygon:
137 - Arbitrum One:
42161 - Solana Mainnet:
1399811149 - Sui Mainnet:
101
The destination chain ID must fit within a
uint64. Most major chains, including Solana and Sui, use chain IDs that fit within this range.CREATE2 Prefix Support
The protocol adapts to different CREATE2 implementations:contracts/IntentSource.sol
- Standard EVM (Ethereum, Polygon, etc.):
0xffprefix - TRON:
0x41prefix
Best Practices
Recommendations for protocol integrators:
- Use the universal types (
bytes32-based) for core protocol interactions if you need cross-VM support - Use EVM-specific types for user-facing interfaces on EVM chains
- Convert at the boundaries of your application using
AddressConverter - Test conversions thoroughly, especially bytes32 ↔ address transformations
- Document which format your interface expects (EVM address vs. bytes32 identifier)
- Validate identifiers before conversion to avoid truncation errors
Remember: Reward claiming is always EVM-specific on the source chain, even if the intent was fulfilled on a non-EVM destination chain. Provers must convert universal identifiers to EVM addresses.