- 利用 Cosmos SDK 实现的 模块 及其他机制。
- 实现 CometBFT 的应用区块链接口(ABCI)来管理区块链。
- 将
geth作为库使用,以促进代码复用并提升可维护性。 - 暴露完全兼容 Web3 的 JSON-RPC 层,用于与现有以太坊客户端和工具(MetaMask、Remix 等)交互。
Cosmos SDK
Cosmos EVM 充分发挥了 Cosmos SDK 的可组合性与模块化能力。它包含 Cosmos SDK 的标准模块,并与 EVM 专用模块协同工作。你可以查看模块列表,了解各个模块分别负责的功能。CometBFT 与 ABCI
CometBFT 由两个核心技术组件构成:区块链共识引擎和通用应用接口。共识引擎确保所有机器都以相同顺序记录相同的交易。该应用接口称为应用区块链接口(ABCI),使交易能够使用任意编程语言进行处理。 CometBFT 已演进为一种通用型区块链共识引擎,可承载任意应用状态。由于它能够复制任意应用,因此可作为其他区块链共识引擎的即插即用替代方案。Cosmos EVM 就是一个示例:它作为 ABCI 应用,通过 CometBFT 的共识引擎替代了以太坊的权益证明共识。 另一个基于 CometBFT 构建的加密货币应用示例是 Cosmos Hub。CometBFT 通过在应用进程与共识进程之间提供简洁的 API(即 ABCI),简化了区块链设计。EVM 兼容性
Cosmos EVM 通过实现多个组件来提供 EVM 兼容性,这些组件共同支持全部 EVM 状态转换,同时确保与以太坊一致的开发者体验:- 将以太坊交易格式实现为 Cosmos SDK 的
Tx与Msg接口 - 为 Cosmos Keyring 支持以太坊的
secp256k1曲线 - 用于状态更新与查询的
StateDB接口 - 用于与 EVM 交互的 JSON-RPC 客户端
贡献
你可以参考 Cosmos EVM 贡献指南,通过 GitHub issues 为 Cosmos EVM 开源代码库做出贡献。This architecture enables users to perform both Cosmos and EVM formatted transactions, allows developers to scale EVM dApps cross-chain via IBC, and supports tokens and assets from multiple independent sources. Cosmos EVM enables these key features by:
- Leveraging modules and other mechanisms implemented by the Cosmos SDK.
- Implementing CometBFT’s Application Blockchain Interface (ABCI) to manage the blockchain.
- Utilizing
gethas a library to promote code reuse and improve maintainability. - Exposing a fully compatible Web3 JSON-RPC layer for interacting with existing Ethereum clients and tooling (MetaMask, Remix, etc.).
Cosmos SDK
Cosmos EVM enables the full composability and modularity of the Cosmos SDK. It includes standard modules from the Cosmos SDK that work side by side with EVM-specific modules. Check out the list of modules to get an overview of what each module is responsible for.CometBFT & ABCI
CometBFT consists of two core technical components: a blockchain consensus engine and a generic application interface. The consensus engine ensures that the same transactions are recorded on every machine in the same order. The application interface, called the Application Blockchain Interface (ABCI), enables transactions to be processed in any programming language. CometBFT has evolved into a general-purpose blockchain consensus engine that can host arbitrary application states. Since it can replicate arbitrary applications, it can be used as a plug-and-play replacement for the consensus engines of other blockchains. Cosmos EVM is an example of an ABCI application replacing Ethereum’s Proof-of-Stake consensus via CometBFT’s consensus engine. Another example of a cryptocurrency application built on CometBFT is the Cosmos Hub. CometBFT simplifies blockchain design by offering a simple API (the ABCI) between the application process and consensus process.EVM Compatibility
Cosmos EVM enables EVM compatibility by implementing various components that together support all the EVM state transitions while ensuring the same developer experience as Ethereum:- Ethereum’s transaction format as a Cosmos SDK
TxandMsginterface - Ethereum’s
secp256k1curve for the Cosmos Keyring StateDBinterface for state updates and queries- JSON-RPC client for interacting with the EVM