0x0000000000000000000000000000000000001004
The Sei Address precompile lets EVM applications interact directly with Sei’s address association system through standard smart contract calls. You can use it to query and create mappings between EVM addresses and their corresponding Cosmos addresses. You get cross-chain address management without a separate Cosmos SDK integration.
What is a precompile? A precompile is a special smart contract that the Sei protocol itself deploys at a fixed address. It exposes custom native chain logic to EVM-based applications. To the EVM, it behaves like a regular contract, but it executes privileged, low-level logic efficiently.
How does the Address precompile work?
The Address precompile at address0x0000000000000000000000000000000000001004 exposes functions such as associate(), associatePubKey(), getSeiAddr(), and getEvmAddr().
- EVM contracts and dApps can call address association functions directly, like any other smart contract method.
- Operations run natively at the Cosmos SDK level for efficiency and security.
- You do not need separate wallet integrations or complex cross-chain interactions.
Use cases
- Cross-chain identity: Link EVM and Cosmos addresses for a unified user experience across both execution environments.
- Address resolution: Build applications that can work with both EVM and Cosmos address formats.
- Wallet integration: Let users associate their addresses once and then use both EVM and native Sei functionality.
- DeFi applications: Create protocols that can interact with users regardless of their preferred address format.
What you’ll learn in this guide
After you finish this guide, you can:- Call association and lookup functions directly from your EVM contracts and dApps.
- Handle signature verification and the signature format requirements for secure address association.
- Query and validate address mappings between EVM and Cosmos formats.
- Build cross-chain tools with unified address management for applications that span both execution environments.
- Understand when and how address association happens automatically or manually.
Functions
The Address precompile exposes these functions:Transaction functions
Query functions
Using the precompile
Setup
Prerequisites
Before you start, make sure that you have:- Node.js (v18 or higher)
- The npm or yarn package manager
- An EVM-compatible wallet
- SEI tokens for gas
- A Hardhat development environment set up
Install dependencies
Install the required packages to interact with Sei precompiles:Setup Hardhat environment
Create ahardhat.config.ts file with this content:
.env file:
Import precompile components
- JavaScript
- Solidity
Precompile address: The Address precompile is deployed at
0x0000000000000000000000000000000000001004. Contract initialization
- JavaScript
- Solidity
Set up your provider, signer, and contract instance:
When does association happen?
In most cases, the association between EVM and Cosmos addresses happens automatically:How association works
Automatic association:- The association happens when a wallet first signs and broadcasts any transaction on Sei.
- Most users do not need to take any other steps.
- The association is permanent after it is created.
- Use
associate()for signature-based association. - Use
associatePubKey()for public-key-based association. - Manual association is useful for advanced applications, or when automatic association has not happened.
Address format requirements
EVM addresses:- Standard Ethereum format:
0x1234...(20 bytes, 40 hex characters) - Case-insensitive, but typically lowercase
- Cosmos format, with the
sei1...prefix for regular addresses - Validator addresses use the
seivaloper1...prefix - Bech32 encoding format
Step-by-step guide: Using the Address precompile
Associate address with signature
- JavaScript
- Solidity
Associate address with public key
- JavaScript
- Solidity
Query Sei address from EVM address
- JavaScript
- Solidity
Query EVM address from Sei address
- JavaScript
- Solidity
Complete integration example
- JavaScript
- Solidity
Security considerations & risks
Association permanence
- Permanent mapping: After addresses are associated, the mapping cannot be changed or removed.
- Single association: Each address can be associated with only one counterpart.
- Verification: Always verify associations before you depend on them in critical operations.
Signature security
- Custom messages: Use unique, timestamped messages to prevent replay attacks.
- Message format: Follow the exact Ethereum Signed Message format for compatibility.
Troubleshooting
Common issues and solutions
Gas-related issues
Error code reference
Important notes
Address associations are permanent and cannot be changed after they are created.
Address formats
- EVM addresses: Use the standard Ethereum format with the
0xprefix. - Sei addresses: Use the Cosmos format with the
sei1prefix for regular addresses. - Case sensitivity: EVM addresses are case-insensitive. Sei addresses are case-sensitive.
Association timing
- Automatic: For most users, association happens automatically on their first transaction.
- Manual: Use the precompile functions for programmatic association, or when automatic association has not happened.
- Verification: Always verify that associations exist before you depend on them.
Signature requirements
- Message format: For the
associate()function, the message must include the Ethereum Signed Message prefix. - Component format: v, r, and s must be correctly formatted hex strings.
- Replay protection: Use unique messages to prevent signature replay attacks.
Gas considerations
- Association operations: Use a gas limit of approximately 200,000.
- Query operations: These use the standard gas for a view function.
- Batch operations: Scale gas limits based on the array size.