> For the complete documentation index, see [llms.txt](https://docs.runealpha.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.runealpha.xyz/en/ordinals-chef/cook-staking.md).

# Cook Staking

## Rules

\
The rules of the game are straightforward: every **5,000 $COOK** **STAKING** will equal one entry ticket for the prize draw.

The ticket numbers will be displayed on RuneAlpha before the appearance of the Root block.<br>

**Snapshot Period:**

* **Start Block:** 837669
* **End Block:** 838669

## Selection Process

The selection process for determining winners is carefully designed to ensure fairness and randomness, leveraging blockchain technology. Here is a step-by-step guide to our selection algorithm:

#### Pre-Event Announcement

* The **Root Block** to determine the winner(s) will be announced before the event.

#### Initial Winner Selection

* Extract the last 9 characters of the hash from the **Root Block**
* Convert these 9 characters into a decimal number, denoted as `s`.
* Calculate the index of the first winning ticket as `index_1 = s mod n`, where `n` is the initial total number of tickets.
* Remove the winning ticket from the list, decreasing the total ticket count by 1.

#### Subsequent Winner Selections

For each subsequent winner `i` (starting from the second winner):

1. Use the **ticket\_id** of the previous winner's address.
2. Declare **ticket\_id** is  `s_i`.
3. Calculate the index of the winning ticket as `index_i = s_i mod (n - (i-1))`, where `n - (i-1)` reflects the updated total number of tickets after removing winners.
4. Remove the winning ticket from the list, continuing to adjust the total ticket count for each selection.

#### Repeat the Process

* Continue the process, using the **ticket\_id** of the most recent winner's address to select the next winner.
* Repeat until all desired tickets are picked or no tickets remain.<br>

####

#### EXAMPLE:

* Let's say the **Root Block** will be 838769 Its blockhash will be:  \
  <https://mempool.space/block/000000000000000000001b95867e0182e85e74313cf5b6b1080fe762634b70dd>
* Total valid tickets: **888**\
  \
  **Select first winner:**
* Extract the last 9 characters of the hash code: `2634b70dd`
* Convert `634b70dd` to a decimal number: **10255823069**
* Perform the operation: **10255823069 mod 888** = **269**
* Therefore, address with index **269** is the first selected => **ticket\_id:** **7146**
* Next index selected will be **7146 mod 888** =  42 => **ticket\_id : 79040**
* **......**<br>

ticket\_id **79040** will serve as the basis (or 'seed') for determining the next winner\
This procedure will be repeated, using each new winner's wallet address as the seed for the subsequent selection, until a total of 333 winners have been chosen.


---

# 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://docs.runealpha.xyz/en/ordinals-chef/cook-staking.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.
