Every 1024 blocks, the Satoshi Lottery initiates a raffle where ticket holders get a chance to win a share of the prize pool when winners are drawn 1024 blocks later.
Tickets are purchased through the website and an inscription representing the ticket is delivered to the taproot ticket address specified by the buyer. When winning tickets are drawn, BTC is transferred from the pool to the Bitcoin address associated with the current address of the winning tickets. If the ticket is transferred to an address that is not associated with an account in the lottery, the BTC is sent directly to the address currently holding the ticket inscription.
The Satoshi Lottery leverages a tamper resistent, on-chain verifiable, and provable random drawing process explained in this document.
A raffle is initiated by the lottery creating a raffle inscription.
The metadata of the raffle inscription immutably defines
Each child inscription made before the draw condition is met represents a valid raffle ticket, equally participating in every draw (I.e. a single ticket can win multiple prizes in the same raffle).
When the draw condition is met (e.g. a specific block height is reached), the lottery initiates the drawing process using the hash of the block when the draw condition was met as the source of entropy.
Specifically, the winning ticket of draw number i
in a raffle is defined by its zero-based index in the raffle inscription's list of children, as follows:
winneri
Where
B
childrenh
h
blockhashh
h
, interpreted as a large integersha256(s)
s
, interpreted as a large integerstr(i)
i
encoded as UTF-8hex(i)
i
encoded as UTF-8l + r
l
and r
l % r
l
and r
This is a practical way to select a winner using a publicly verifiable and unpredictable seed. It aligns with Bitcoin's philosophy by leveraging the inherent randomness of the block hash, ensures transparency through a deterministic hash function, and is computationally efficient for an ongoing draw system.
Anyone can independently verify the process by checking the blockhash, performing the SHA-256 calculation, and computing the modulo with the known ticket count.
Since the blockhash is determined by the Bitcoin network's consensus and cannot be influenced by ticket buyers or the organizer, it provides a robust source of randomness.