# BeaconKit 共识层

[BeaconKit](/berachain-docs/learn/introduction/what-is-beaconkit.md)既是共识客户端，也是构建EVM链的框架。

BeaconKit借鉴[CometBFT](https://cometbft.com/)来实现其共识算法，该算法可与任何EVM兼容的执行环境进行交互。作为共识客户端，它允许网络 (比如Berachain这样的EVM区块链) 根据执行客户端提供的数据达成协议共识。

BeaconKit遵循[Eth2](https://ethereum.org/zh/roadmap/)路线的模块化需求，将共识和执行分离，兼顾EVM执行客户端的所有优势。能够做到这一点，是因为它遵循[Ethereum Engine API](https://github.com/ethereum/execution-apis/blob/main/src/engine/common.md)，即JSON-RPC API，允许共识和执行客户端之间通信。

### BeaconKit的优势

以下是BeaconKit的优势所在：

1. **Eth2模块化**：坚持执行与共识分离，两者通过Engine API通信。
2. **执行客户端多样性**：无缝支持EVM执行客户端的任何升级，无需另外运行和维护一个分叉EVM执行客户端。
3. **CometBFT**：利用可信的共识算法。
4. **瞬时最终性 (Instant Finality)**：实现了[单时隙最终确定性](https://ethereum.org/zh/roadmap/single-slot-finality/#single-slot-finality) (Single Slot Finality)。区块可在同一时隙内提议并最终确定，而以太坊的最终确定时间约为13分钟。
5. **EVM工具兼容性**：支持所有基于EVM开发的工具，如果某工具能在以太坊网络使用，则也能在BeaconKit使用。
6. **模块化**：BeaconKit采用模块化框架，支持自定义区块生成器，可用于Layer 2网络，可用于数据可用性层等。

| 技术组件  | 以太坊                                                                                       | BeaconKit                           |
| ----- | ----------------------------------------------------------------------------------------- | ----------------------------------- |
| 执行客户端 | EVM (Geth, Reth, Erigon, ...)                                                             | EVM (Geth, Reth, Erigon, ...)       |
| 共识算法  | 基于[Gasper](https://ethereum.org/zh/developers/docs/consensus-mechanisms/pos/gasper/)的权益证明 | 基于[CometBFT](https://cometbft.com/) |
| 最终确定性 | Gasper FFG (约13分钟)                                                                        | 单时隙最终确定性 (即时)                       |
| 架构设计  | 支持模块化                                                                                     | 支持模块化                               |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://www.docszh.com/berachain-docs/nodes/berachain-nodes/beaconkit-consensus.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
