> For the complete documentation index, see [llms.txt](https://casefun.gitbook.io/casefun/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://casefun.gitbook.io/casefun/provably-fair-protocol.md).

# Provably Fair Protocol

## 🎲 Provably Fair Protocol

Trust and statistical transparency form the foundation of the **CaseFun Protocol**. To eliminate suspicions of manipulation or hidden house edges, CaseFun utilizes a **Provably Fair Engine** that allows players and creators to independently verify every case drop, upgrade outcome, and PvP battle result.

***

### ⚙️ Core Architecture & Cryptographic Mechanics

Every randomized event on CaseFun relies on cryptographic hashing functions combining three distinct inputs:

1. **Server Seed:** A cryptographically secure random string generated by the protocol server before the roll occurs. The server provides an encrypted hash of this seed *prior* to execution.
2. **Client Seed:** A user-controlled or wallet-generated random value that the server cannot predict or alter.
3. **Nonce:** A sequential integer counter that increments with every execution to ensure unique outcomes across multiple openings.

<figure><img src="https://3846067308-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWXVg3TFaAQ9m2NpLh5tl%2Fuploads%2Fx9eey4V0W5F7XqJrF6KQ%2F%D0%9F%D1%80%D0%BE%D0%B1%D0%B0%D0%B1%D0%BB%D0%B8.png?alt=media&amp;token=8b13865f-f8e6-4356-a7d2-08bca5c3ca86" alt=""><figcaption></figcaption></figure>

***

### ⚡ Dual Randomness Providers

CaseFun supports two verifiable randomness execution pipelines to balance execution speed, friction, and cryptographic strictness:

| Feature               | Random.org Engine (Default)                                             | Chainlink VRF / On-Chain VRF                                 |
| --------------------- | ----------------------------------------------------------------------- | ------------------------------------------------------------ |
| **Randomness Source** | True Random Number Generation (TRNG) via atmospheric noise              | Cryptographically secure on-chain verifiable random function |
| **Execution Latency** | Instantaneous (\~1 second)                                              | Network block confirmation dependent (\~5–15 seconds)        |
| **UX & Signatures**   | Zero additional wallet signatures required                              | Requires on-chain randomness verification signature          |
| **Best Used For**     | High-velocity Telegram Mini App sessions, Fast/Flash modes, PvP battles | Institutional audits, high-value drop verifications          |

***

### 🔍 Independent Verification Process (Coming Soon)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://casefun.gitbook.io/casefun/provably-fair-protocol.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
