# Cook 质押

## 规则

游戏规则很简单:每 **5000 个$COOK（5张）下注** 等于一张抽奖入场券。 门票号码将显示在RuneAlpha结束块的出现之前

**快照时期:**

* **开始块:** 待定
* **结束块:** 待定

## 选拔过程

确定获胜者的选择过程经过精心设计，以确保公平性和随机性，利用区块链技术。下面是我们选择算法的一步一步指南:

#### 事前公告

* 在**结束块**时，将宣布获胜者。

#### 初步获奖者评选

* 从**结束块**中提取哈希的最后8个字符
* 将这8个字符转换为十进制数，记为`s`
* 计算第一张中奖彩票的索引为`index_1 = s mod n`，其中`n`是彩票的初始总数
* 从列表中删除中奖彩票，减少总彩票计数`1`

#### 随后的获奖者评选

对于每个后续获奖者' i '(从第二个获奖者开始):

1. 使用前一位获奖者地址的最后5个字符。
2. 将这5个字符转换为十进制数`s_i`。
3. 计算中奖彩票的索引为`index_i = s_i mod (n - (i-1))`，其中`n - (i-1)`反映删除中奖者后更新的彩票总数。
4. 从列表中删除中奖彩票，继续调整每次选择的总票数。

#### 重复这个过程

* 继续这个过程，使用最近赢家地址的最后8个字符来选择下一个赢家。
* 重复，直到所有所需的票被选中或没有票剩下

#### Example:

* 假设结束区块是834200，它的区块散列是:\
  <https://mempool.space/block/000000000000000000001b95867e0182e85e74313cf5b6b1080fe762634b70dd>
* 有效门票总数: **888**\
  \
  **选择第一名获胜者:**
* 提取哈希码的最后8个字符: `634b70dd`
* 将' 634b70dd '转换为十进制数: **1665888477**
* 执行操作: **1665888477 mod 888** = **477**
* 因此，票号**477**是第一张被选中的票.\
  \
  与彩票号码477相关联的钱包地址将作为决定下一位获胜者的基础(或“种子”) 这个过程将重复，使用每个新获胜者的钱包地址作为后续选择的种子，直到总共333名获胜者被选中。


---

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