# Provable fairness

BeatPot uses verifiable on-chain randomness to ensure every raffle is completely fair. No one can predict or manipulate the outcome.

### What Does "Provably Fair" Mean?

Provably fair means you don't have to trust anyone. The randomness used to select winners can be verified by anyone, and the selection process is transparent and deterministic.

Unlike traditional raffles where you trust the operator, BeatPot's fairness is guaranteed by cryptography and smart contracts.

### How Randomness Works

BeatPot uses [**Pyth Entropy**](https://www.pyth.network/entropy) for verifiable randomness.

#### The Process

{% stepper %}
{% step %}

#### Round Ends

When a round timer expires, execution is triggered.
{% endstep %}

{% step %}

#### Request Randomness

The BeatPot contract requests a random number from Pyth Entropy.
{% endstep %}

{% step %}

#### Generate Random Number

Pyth Entropy generates a verifiable random number.
{% endstep %}

{% step %}

#### Callback

The random number is sent back to the BeatPot contract.
{% endstep %}

{% step %}

#### Select Winner

The random number determines which ticket wins.
{% endstep %}
{% endstepper %}

{% hint style="info" %}
**What is Pyth Entropy?**

Pyth Entropy is a decentralized randomness service. It generates random numbers that:

* Cannot be predicted before they're revealed
* Cannot be manipulated by any party
* Can be verified by anyone after the fact

This is achieved through cryptographic commitments—values are committed before the outcome is needed, making manipulation impossible.
{% endhint %}

### Verification

Anyone can verify past raffle results:

#### On-Chain Verification

{% stepper %}
{% step %}

#### Find the round

Find the round you want to verify on HyperEVMScan.
{% endstep %}

{% step %}

#### Look at the event

Look at the `WinnerSelected` event.
{% endstep %}

{% step %}

#### Check the random number

Check the random number used.
{% endstep %}

{% step %}

#### Verify source

Verify that the random number came from Pyth Entropy.
{% endstep %}

{% step %}

#### Confirm selection

Confirm the winner was selected correctly based on that number.
{% endstep %}
{% endstepper %}

#### What You Can Verify

* The random number used for each round
* That the random number came from Pyth Entropy (not generated internally)
* That the winner selection matched the random number
* The total number of entries and who owned each range

### Why This Matters

#### Traditional Raffles

* You trust the operator
* No way to verify the draw
* Operator could theoretically cheat

#### BeatPot

* No trust required
* Every draw is verifiable
* Cheating is mathematically impossible

### Common Questions

<details>

<summary>Can the BeatPot team manipulate results?</summary>

No. The random number comes from Pyth Entropy, which BeatPot cannot control. The selection process is deterministic based on that random number.

</details>

<details>

<summary>Can someone predict the winner before the round ends?</summary>

No. The random number doesn't exist until after the round ends and randomness is requested.

</details>

<details>

<summary>What if there's a bug in the selection code?</summary>

The smart contract code is verified and visible on HyperEVMScan. Anyone can review it to ensure the selection logic is correct.

</details>

<details>

<summary>Can miners/validators manipulate the outcome?</summary>

Pyth Entropy's design prevents this. The randomness is generated through a commit-reveal scheme that makes manipulation impractical.

</details>


---

# 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://docs.hyperbeat.org/beatpot/provable-fairness.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.
