# Proof of Burn (PoB)

## 🔥 Proof of Burn (PoB) — Consensus Algorithm

Ono Coin uses a **custom Proof of Burn (PoB)** mechanism for block generation and network consensus. Unlike Proof of Work (PoW) or Proof of Stake (PoS), **Proof of Burn** requires participants to "burn" (destroy) coins to gain the right to forge new blocks and earn rewards.

This approach aligns incentives around **long-term commitment** to the network, as burned coins represent a stake in the system.

***

### 🧠 How Proof of Burn Works in Ono Coin

#### ✅ 1. Burn Coins to Become a Forger

* To participate in block forging, users must **burn Ono Coins**, effectively removing them from circulation.
* The **more coins burned**, the **higher chance** to forge the next block.
* Burned coins are **tracked on-chain** and connected to a user's **public key**.

> 💡 **Note**: You can burn coins using wallet commands (coming soon) or via API.

***

#### ✅ 2. Calculating the Chance to Forge — "Target" and "Hit"

Ono Coin calculates a **Target** and a **Hit** value for each forging attempt. If **Hit > Target**, the forger wins and can create the next block.

***

#### 🔢 How "Target" is Calculated

The **Target** is a random-like value generated from the **previous block's signature** and the **candidate's public key**:

```js
const signatureWithPublicKey = latestBlock.signature + publicKey;
const hash = cryptoUtilsLib.hash(signatureWithPublicKey);
const target = parseInt(hash.substring(0, 9), 16);
```

* **Deterministic but unpredictable** until the last block is known.
* Ensures fairness and randomness in the selection process.

***

#### 🔢 How "Hit" is Calculated

The **Hit** measures the forger's "weight" and time since the last block:

```js
const forgerBalance = await balanceService.getBurnedBalance(publicKey, latestBlock.id);
if (forgerBalance < BLOCKCHAIN_SETTINGS.MIN_FORGER_BALANCE) return 0;

const elapsedTime = timestamp - latestBlock.timestamp;
const hit = previousTarget * forgerBalance * elapsedTime;
```

* **Depends on:**
  * **Amount of coins burned** (burned balance).
  * **Time elapsed** since the last block.
  * **Previous block's target** (difficulty adjustment).
* The **more coins burned** and the **longer the wait**, the higher the Hit — increasing the chance to forge.

***

#### ✅ 3. Verifying If a Block Can Be Forged

To verify if a forger is eligible to create a block:

```js
return target < hit;
```

* If **Hit > Target**, the forger wins the right to create the next block.
* This mechanism ensures **fair competition** among burners and prevents low-stake actors from dominating the chain.

***

### ⚙️ Technical Flow Summary

| Step                      | Description                                                   |
| ------------------------- | ------------------------------------------------------------- |
| **Burn coins**            | Lock and remove coins to gain forging rights.                 |
| **Calculate Target**      | Hash of last block's signature and public key.                |
| **Calculate Hit**         | Depends on burned balance, elapsed time, and previous target. |
| **Compare Hit vs Target** | If Hit > Target, the user can forge a block.                  |

***

### 🔒 Security and Fairness

* **No mining farms**: Since the system doesn't rely on hardware, it's eco-friendly.
* **Long-term commitment**: Only users who burn coins (invest in the network) can forge blocks.
* **Fair randomness**: Target calculation ensures unpredictable and fair block selection.
* **Burned balance**: Tied to public key, cannot be transferred or sold, representing real commitment.

***

### 💡 Benefits of Ono Coin's PoB

* ✅ **Eco-friendly** — No need for expensive hardware or energy consumption.
* ✅ **Decentralized** — Anyone can participate by burning coins.
* ✅ **Fair** — Larger burned balance and longer waiting period increases chances naturally.
* ✅ **Simple and effective** — Transparent algorithm that is easy to verify on-chain.

***

### 🎉 Conclusion

**Ono Coin's Proof of Burn** combines fairness, simplicity, and eco-friendliness to ensure **secure and decentralized block forging**. By burning coins, you prove your commitment to the network and earn the right to forge new blocks.

> 🔥 **Burn to earn — forge to grow. Welcome to Ono Coin!**
