Overview
The Address precompile enables bidirectional address mapping between Sei’s native Cosmos addresses (bech32 format) and EVM addresses (hex format). This is essential for cross-chain functionality and allows users to associate their Cosmos and EVM identities. Contract Address:0x0000000000000000000000000000000000001004
Key Features
- Address Translation: Convert between Sei and EVM address formats
- Address Association: Link Cosmos and EVM addresses for the same account
- Cross-Chain Identity: Enable seamless interaction between EVM and Cosmos ecosystems
- Public Key Association: Associate addresses using public key cryptography
Available Functions
View Functions
getSeiAddr(address) → string
getSeiAddr(address) → string
Get the associated Sei (Cosmos) address for an EVM address.Parameters:
addr(address): The EVM address to lookup
getEvmAddr(string) → address
getEvmAddr(string) → address
Get the associated EVM address for a Sei (Cosmos) address.Parameters:
addr(string): The Sei address to lookup (bech32 format)
State-Changing Functions
associate(string, string, string, string) → (string, address)
associate(string, string, string, string) → (string, address)
Associate addresses using signature verification.Parameters:
v(string): Recovery ID from signaturer(string): R component of signatures(string): S component of signaturecustomMessage(string): Custom message that was signed
associatePubKey(string) → (string, address)
associatePubKey(string) → (string, address)
Associate addresses using a public key.Parameters:
pubKeyHex(string): Public key in hexadecimal format
Usage Examples
- Viem
- Ethers.js
- Manual
Common Use Cases
Cross-Chain Applications
- Unified Identity: Link user identities across EVM and Cosmos ecosystems
- Asset Bridging: Map assets between different address formats
- Multi-Chain Wallets: Support both EVM and Cosmos transactions
DeFi Integration
- Liquidity Provision: Use associated addresses for cross-chain liquidity
- Yield Farming: Participate in farming across both ecosystems
- Governance: Vote with associated addresses in different governance systems
Wallet Applications
- Address Book: Display both address formats for contacts
- Transaction History: Track transactions across both address types
- Portfolio Management: Aggregate holdings across associated addresses
Address Association Process
Using Public Key (Recommended)
Using Signature Verification
Address Format Validation
Error Handling
Common errors when using the Address precompile:- No association found: Addresses haven’t been linked yet
- Invalid address format: Malformed EVM or Sei addresses
- Association already exists: Trying to associate already linked addresses
- Invalid signature: Signature verification failed during association
Security Considerations
- Public Key Security: Ensure public keys are handled securely
- Signature Verification: Validate signatures before association
- Address Ownership: Verify ownership before creating associations
- Association Permanence: Address associations are typically permanent