Skip to main content

Overview

Eco Routes Protocol supports cross-chain intents between different virtual machine architectures, including EVM-to-EVM, EVM-to-Solana, and other combinations. This requires careful handling of address formats across different chain types.

Address Formats

EVM Addresses (20 bytes)

Solana Addresses (32 bytes)

Universal Format (bytes32)

The protocol uses bytes32 as a universal address format:

AddressConverter Library

The AddressConverter library provides safe conversion between EVM addresses and the universal bytes32 format.

Converting Address to Bytes32

How it works:

Converting Bytes32 to Address

How it works:

Validation

Critical: Not all bytes32 values represent valid Ethereum addresses. The top 12 bytes must be zero.
Example validation:

Usage in IntentSource

The IntentSource contract uses AddressConverter throughout:

Cross-Chain Address Handling

EVM → EVM

When both source and destination are EVM chains:

EVM → Solana

When destination is Solana (or another non-EVM chain):

Solana → EVM

When source is Solana and destination is EVM:

CREATE2 and Cross-VM

Standard CREATE2 Prefix

On most EVM chains, CREATE2 uses prefix 0xff:

TRON Exception

TRON Uses 0x41: TRON is an EVM-compatible chain but uses a different CREATE2 prefix for historical reasons.

Practical Examples

Example 1: EVM Deposit Address

Example 2: Solana Deposit Address

Example 3: Validation in Smart Contracts

Security Considerations

Always Validate: When converting bytes32 to address, always use AddressConverter.toAddress() which includes validation. Never cast directly.

Safe Conversion

Type Safety

The library provides compile-time type safety:
Using bytes32 as a universal format provides:
  • Simplicity: One type for all chains
  • Gas efficiency: No complex encoding/decoding
  • Forward compatibility: Works with future chain types
  • Storage efficiency: Fixed 32-byte slots
Yes! Checksumming is a display-level feature (mixed case). The underlying bytes are identical:
ENS names must be resolved to addresses before being used in intents:

Next Steps

Deposit Addresses

Learn how deposit addresses leverage cross-VM support

Deterministic Addresses

Understand CREATE2 deployment across different chains