平台集成
EVM 模块构建于 Cosmos SDK 平台之上,并利用其模块化架构:- 共识层:CometBFT 提供具备即时终局性的拜占庭容错共识
- 状态管理:Cosmos SDK 的 IAVL 树和 KVStore 负责状态持久化
- 账户系统:统一的账户模型,同时支持以太坊和 Cosmos 地址格式
- 模块生态:通过预编译合约可直接访问质押、治理、银行和 IBC 模块
以太坊兼容性
EVM 模块提供完整的以太坊兼容性,支持所有标准以太坊工具链和工作流:- 智能合约:完整支持 EVM 字节码执行,并保持相同的 Gas 成本和操作码行为
- 交易类型:支持所有以太坊交易格式,包括 EIP-1559 和 EIP-7702
- JSON-RPC API:完整实现以太坊 RPC,便于无缝集成各类工具
- 开发工具:可与 MetaMask、Hardhat、Foundry、Remix 以及所有以太坊开发框架协同工作
增强特性
Cosmos SDK 优势
- 即时终局性:交易在一个区块后即被最终确认(约 2 秒),不会发生重组
- 跨链集成:原生支持 IBC,可与其他 Cosmos 链交互
- 模块化访问:智能合约可直接与质押、治理及其他 Cosmos 模块交互
- 增强安全性:采用具备拜占庭容错能力的共识机制,并基于质押选择验证者
与标准以太坊的关键差异
- 共识:使用 CometBFT 而非权益证明,提供即时终局性
- 状态存储:使用 IAVL 树和 Cosmos SDK KVStore,而非 Merkle Patricia Tree
- 费用分配:基础费用分配给验证者,而不是被销毁
- 跨链:原生集成 IBC,实现无缝的跨链操作
- 模块访问:智能合约可直接调用 Cosmos SDK 模块
开发者体验
开发者可以使用熟悉的以太坊工具和模式在 Cosmos EVM 上进行构建:- 标准工具链:MetaMask、Hardhat、Foundry、Remix 无需修改即可使用
- 以太坊库:Web3.js、Ethers.js 及其他库都可无缝运行
- 智能合约:现有以太坊合约可直接部署,无需更改
- 增强能力:可通过预编译合约访问 Cosmos 模块和 IBC
The Cosmos EVM module implements a complete Ethereum Virtual Machine as a Cosmos SDK module, providing an Ethereum-compatible interface to the underlying Cosmos consensus and infrastructure while enabling access to the broader Cosmos ecosystem.
Platform Integration
The EVM module sits atop the Cosmos SDK platform, leveraging its modular architecture:- Consensus Layer: CometBFT provides Byzantine fault-tolerant consensus with instant finality
- State Management: Cosmos SDK’s IAVL tree and KVStore handle state persistence
- Account System: Unified account model supporting both Ethereum and Cosmos address formats
- Module Ecosystem: Direct access to staking, governance, bank, and IBC modules through precompiles
Ethereum Compatibility
The EVM module provides complete Ethereum compatibility, enabling all standard Ethereum tooling and workflows:- Smart Contracts: Full EVM bytecode execution with identical gas costs and opcode behavior
- Transaction Types: Support for all Ethereum transaction formats including EIP-1559 and EIP-7702
- JSON-RPC API: Complete Ethereum RPC implementation for seamless tool integration
- Development Tools: Works with MetaMask, Hardhat, Foundry, Remix, and all Ethereum development frameworks
Enhanced Features
Cosmos SDK Benefits
- Instant Finality: Transactions are final after one block (~2 seconds) with no reorganizations
- Cross-Chain Integration: Native IBC support for interacting with other Cosmos chains
- Modular Access: Smart contracts can directly interact with staking, governance, and other Cosmos modules
- Enhanced Security: Byzantine fault-tolerant consensus with stake-based validator selection
Key Differences from Standard Ethereum
- Consensus: CometBFT instead of proof-of-stake, providing instant finality
- State Storage: IAVL tree and Cosmos SDK KVStore instead of Merkle Patricia Tree
- Fee Distribution: Base fees distributed to validators instead of burned
- Cross-Chain: Native IBC integration for seamless interchain operations
- Module Access: Smart contracts can directly call Cosmos SDK modules
Developer Experience
Developers can build on Cosmos EVM using familiar Ethereum tools and patterns:- Standard Tooling: MetaMask, Hardhat, Foundry, Remix work without modification
- Ethereum Libraries: Web3.js, Ethers.js, and other libraries work seamlessly
- Smart Contracts: Deploy existing Ethereum contracts without changes
- Enhanced Capabilities: Access Cosmos modules and IBC through precompiled contracts