> For the complete documentation index, see [llms.txt](https://docs.emc.network/emc/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.emc.network/emc/products/emc-mainnet/consensus-mechanism-poaw-proof-of-ai-work.md).

# Consensus Mechanism ： PoAW (Proof of AI Work)

**EMC** adopts a **Proof of AI Work (PoAW)** consensus mechanism that relies on tokenized AI Agents running on a public chain to validate transactions and maintain network security. Its primary objective is to enhance the real-world efficiency of blockchain applications while promoting the decentralized nature of AI.

### **1. Layered Architecture**

* **Execution Layer**\
  An EVM-compatible smart contract engine that supports AI task scheduling contracts.
* **Consensus Layer**\
  A modified Istanbul BFT (IBFT) consensus mechanism integrated with an AI workload verification module.
* **Storage Layer**\
  A hybrid storage framework, combining on-chain metadata with IPFS/Filecoin for off-chain data storage.
* **Cross-Chain Layer**\
  A bridging protocol that enables interoperability of assets across multiple blockchains.

### 2. Core Components

* **Tokenized AI Agent**\
  Each AI Agent represents a certain amount of tokenized assets or hardware resources. These AI Agents are created by EMC public chain’s computing nodes. Users can stake EMC tokens to activate an AI Agent.
* **Smart Contracts**\
  AI Agents interact with the blockchain via smart contracts, executing complex computations and making decisions on-chain.
* **AI Agent Management Contract**\
  Handles staking, activation, and weight calculation for each AI Agent.
* **Oracle Network**\
  Provides external data feeds and verification services for on-chain operations.
* **Task Validation Nodes**\
  Execute Byzantine fault-tolerant verification of AI task results.

### 3. Staking Rules

* **Minimum Staking Amount**\
  3,000 EMC (dynamically adjustable).
* **Weight Calculation Formula**

$$
\ \sqrt{\frac{\text{Staked Amount}}{\text{Base Threshold}}} \times \frac{\text{Number of Tasks}}{\text{Total AI Agent Stake}}
$$

* **Staking Lock-Up Period**\
  Tied to the task execution cycle, with a minimum of 90 days.
* **Reward Mechanism**\
  AI Agents that successfully participate in consensus are rewarded based on their weight, incentivizing ongoing participation in network maintenance.

### 4. Workload Verification Process

1. **Transaction Submission**\
   A user submits a transaction request, which is received and verified by an AI Agent.
2. **Computation Verification**\
   The AI Agent computes and verifies the validity of the transaction, generating a hash fingerprint of the result.
3. **Data Verification**\
   The hash fingerprint is stored in a Merkle Patricia Tree structure for tamper-proof verification.
4. **Result Broadcasting**\
   The hash fingerprint is broadcast across the network and undergoes IBFT-based validation by the task validation nodes.
5. **Consensus**\
   Once the verification threshold of two-thirds is reached, the transaction is recorded on the blockchain.

### 5. Security and Decentralization of the Workload Verification Process

* **Diversity**\
  Encourages participation from various types of AI Agents to enhance network diversity and security.
* **Dynamic Adjustments**\
  Staking requirements and reward mechanisms are dynamically adjusted based on network conditions to ensure stability over time.
