> For the complete documentation index, see [llms.txt](https://docs.uniocean.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.uniocean.io/forecast-platform/settlement/merkle-proofs.md).

# Merkle Proofs

A Merkle proof verifies that a specific winner and reward amount are included in the finalized reward dataset — without requiring all data to be stored on-chain.

## How It Works

After ranking and reward calculation, the settlement system constructs a Merkle tree:

1. Each rewarded wallet address and reward amount form a **leaf** in the tree
2. Leaves are hashed together in pairs, building upward to a single **Merkle root**
3. Only the Merkle root is stored on the blockchain
4. Each rewarded participant receives a **proof** — a small set of hashes showing their leaf is part of the tree

```mermaid
flowchart TD
    A[Merkle Root] --> B[Hash AB]
    A --> C[Hash CD]
    B --> D["Leaf A<br/>Wallet + Reward"]
    B --> E["Leaf B<br/>Wallet + Reward"]
    C --> F["Leaf C<br/>Wallet + Reward"]
    C --> G["Leaf D<br/>Wallet + Reward"]
```

## Why It Matters

Instead of storing every individual reward on-chain (expensive and slow), Uniocean stores a single 32-byte Merkle root. This supports large markets with 10,000+ participants at the same cost as a market with 15 participants.

## Benefits

| Benefit                | Description                                                |
| ---------------------- | ---------------------------------------------------------- |
| Efficiency             | Single on-chain value represents all rewards               |
| Scalability            | Works for any number of winners without increased gas cost |
| Cryptographic security | Impossible to forge a valid proof without the full dataset |
| Tamper resistance      | Any change to any reward invalidates the entire root       |
| Verifiability          | Anyone can independently verify a reward using the proof   |
| Auditability           | Full proof data is published in settlement audit reports   |

## Verification

Users and auditors can verify any reward:

1. Take the rewarded wallet address and reward amount
2. Hash them together (the leaf)
3. Use the proof hashes to reconstruct the path to the root
4. Compare against the on-chain Merkle root

If the computed root matches the stored root, the reward is genuine and was included in the settlement.

## Claiming With Proofs

When rewards are auto-claimed, the smart contract verifies the Merkle proof on-chain before releasing funds. This means:

* Only legitimate winners can receive rewards
* The exact reward amount is enforced
* No one can claim more than their calculated share
* No one can claim on behalf of another wallet

## Audit Reports

Every settlement audit report includes complete Merkle proof data for all winners, enabling full independent verification.

***

## Related Pages

* [Settlement Process](/forecast-platform/settlement/settlement-process.md)
* [Auto Claims](/forecast-platform/settlement/auto-claims.md)
* [Audit Reports](/forecast-platform/transparency/audit-reports.md)
* [Public Verification](/forecast-platform/transparency/public-verification.md)
