# APoS

APoS (Hybrid Delegated Proof of Stake) Consensus Mechanism

The APoS mechanism combines the characteristics of Proof of Stake (PoS) and Proof of Authority (PoA) to achieve reduced block generation times, high compatibility with Ethereum, and maintain decentralization.

**Features of the APoS Consensus Mechanism**

1. Block Generation: Blocks are generated by up to 41 validator nodes.
2. Eligibility: Anyone can become a validator node by staking AIA tokens.
3. Block Production Mechanism: Validator nodes take turns producing blocks. The difficulty for producing blocks normally is 2, but it is reduced to 1 if blocks are produced out of order. In the case of a chain fork, the system selects the chain with the highest difficulty.
4. Staking Option: Users can stake their AIA tokens to trusted nodes.

**Reward Mechanism**

Validator nodes are rewarded from two sources:

1. Block Rewards: Each block generates 2.89 AIA as a reward.
2. Transaction Fees: Validators also receive the transaction fees from the transactions included in their blocks.

Rewards are distributed based on the staking ratio of each validator node, meaning the node's income is proportional to its stake.

**Penalty Mechanism**

Validators that fail to produce blocks according to the predefined rules are penalized:

1. Counting Mechanism: If a validator fails to package blocks as expected, the system records the count of violations.
2. Penalties:

24 Violations: The system destroys up to 100 AIA from the validator's rewards.

48 Violations: The system destroys up to 100 AIA from the validator's collateral and removes the validator from the active list.

**AIA Burn Mechanism**

1. Black Hole Address:

10% of AIA from block rewards is burned.

5% is allocated to foundation management fees, which are also burned.

1. Price Fluctuations: The system records the AIA token price every 7 days. If the price drops by 100%, the burn ratio for block rewards increases to 50% in the next cycle.
2. Node Exit Penalty: Validator nodes that exit before operating for 3 months will have 20% of their collateral burned.


---

# 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://aia-chain-1.gitbook.io/aialabs/basics/consensus/apos.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.
