# 共识机制 PoAW

EMC 链采用 **PoAW（Proof of AI Work）** 权益证明通过在公链上运行的资产化的AI Agent来验证交易和维护网络安全，旨在提高区块链的真实应用效率和AI的去中心化特性。

### **1. 分层结构**

* 执行层：兼容EVM的智能合约引擎，支持AI任务调度合约
* 共识层：改良的伊斯坦布尔BFT共识机制，集成AI工作量验证模块
* 存储层：混合式存储架构（链上元数据+IPFS/Filecoin数据存储）
* 跨链层：支持多链资产互操作的桥接协议

### **2. 核心组件**

* **资产化的AI代理**：每个AI Agent代表一定的代币资产或硬件资源，AI Agent由EMC公链的算力节点产生，用户可以通过质押EMC来激活AI Agent。
* **智能合约**：AI Agent通过智能合约与区块链交互，执行复杂的计算和决策。
* AI Agent管理合约：处理质押、激活、权重计算
* 预言机网络：提供外部数据输入和验证服务
* 任务验证节点：执行拜占庭容错的任务结果验证

### **3. 质押规则：**

* 最低质押量：3000 EMC（动态可调整）
* 权重计算公式：

$$
\ \sqrt{\frac{\text{质押量}}{\text{基础阈值}}} \times \frac{\text{任务数}}{\text{AI Agent质押总量}}
$$

* 质押锁定周期：与任务执行周期挂钩（最少90天）
* **奖励机制**：成功参与共识的AI代理将根据其权重获得奖励，激励其持续参与网络维护。

### **4. 工作量验证流程**

* **交易提交**：用户提交交易请求，AI代理接收并验证请求。
* **计算验证**：AI代理通过计算验证交易的有效性，并生成结果的哈希指纹。
* **数据验证**：采用Merkle Patricia Tree结构存储哈希指纹。
* **结果广播**：哈希指纹通过网络广播，经由验证节点进行IBFT。
* **达成共识**：一旦达到2/3的验证阈值，交易被记录在区块链上。

### **5. 工作量验证流程安全性与去中心化**

* **多样性**：鼓励不同类型的AI代理参与共识，增强网络的多样性和安全性。
* **动态调整**：根据网络状态动态调整质押要求和奖励机制，确保网络稳定性。


---

# 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://docs.emc.network/emc/zhong-wen/emc-network/he-xin-chan-pin/gong-lian/gong-shi-ji-zhi-poaw.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.
