Zero-Collateral Lottery System for Arkade#19
Open
pingu-73 wants to merge 15 commits into
Open
Conversation
Signed-off-by: Dikshant <dikshant.073@gmail.com>
Signed-off-by: Dikshant <dikshant.073@gmail.com>
Signed-off-by: Dikshant <dikshant.073@gmail.com>
Signed-off-by: Dikshant <dikshant.073@gmail.com>
Signed-off-by: Dikshant <dikshant.073@gmail.com>
Signed-off-by: Dikshant <dikshant.073@gmail.com>
Signed-off-by: Dikshant <dikshant.073@gmail.com>
Signed-off-by: Dikshant <dikshant.073@gmail.com>
Signed-off-by: Dikshant <dikshant.073@gmail.com>
This was
linked to
issues
Aug 14, 2025
Signed-off-by: Dikshant <dikshant.073@gmail.com>
Signed-off-by: Dikshant <dikshant.073@gmail.com>
Signed-off-by: Dikshant <dikshant.073@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
This PR introduces zero-collateral lottery system built on top of the Ark Protocol, enabling provably fair, self-custodial lottery games with$O(log N)$ complexity as described in the 1. The implementation leverages Ark's efficient off-chain execution layer while maintaining Bitcoin's security guarantees.
Closes #10, #7, #6, #5
Architecture Overview
The lottery system implements a cryptographic
commitment-revealscheme on Ark:Features
1. Provably Fair Randomness
The system implements a mathematically sound randomness extraction mechanism:
Mathematical Proof of Fairness:
Let
P = {p₁, p₂, ..., pₙ}be the set of n participants, each submitting:sᵢ ∈ {0,1}^{256}nᵢ ∈ {0,1}^{256}cᵢ = H(sᵢ || nᵢ || lottery_id || pᵢ)Randomness Extraction:
seed = H(∑(sᵢ || nᵢ))for all i ∈ [1,n]winner_index = seed mod nSecurity Properties:
2. Trustless Execution BUT with ASP Cosigning
The system operates in a trustless manner while leveraging the Ark Service Provider (ASP) as a cosigner:
Trust Model:
Security Guarantees:
Paper Compliance:
Current Implementation Scope:
While the 1 describes full binary tournament trees, this pr focuses on the core cryptographic mechanisms and single-round lotteries as a foundation for more complex tournament structures.
Enhancements to Ark Protocol and Bitcoin Ecosystem
1. Application Layer
This implementation demonstrates Ark's capability to support complex cryptographic protocols beyond simple payments:
2. Scalability Benefits
Leveraging Ark's batching capabilities provides significant scalability improvements:
3. Bitcoin Ecosystem Value
The system enhances Bitcoin's utility as a gaming and financial platform:
Additions
Mathematical Fairness Proof
Lottery is provably fair and unbiased.
Proof:
Let the system have n participants, each submitting secret
sᵢand noncenᵢ.Hiding Property:
cᵢ = H(sᵢ || nᵢ || lottery_id || pᵢ)cᵢ, findingsᵢrequires inverting SHA256 (computationally infeasible)Binding Property:
σᵢ = Sign(pᵢ, cᵢ)Unbiasability:
seed = H(∑(sᵢ || nᵢ))index = seed mod nP(winner = pᵢ) = 1/nfor all iVerifiability:
H(sᵢ || nᵢ || lottery_id || pᵢ) = cᵢSign(pᵢ, cᵢ) = σᵢH(∑(sᵢ || nᵢ)) mod n = winner_indexTrust Model
Trustless Properties:
Ark Service Provider Role (Cosigner):
Security Assumptions:
Current Limitations:
Future Extensions:
Footnotes
Miller, A., & Bentov, I. (2017). Zero-Collateral Lotteries in Bitcoin and Ethereum. arXiv:1612.05390. https://arxiv.org/abs/1612.05390 ↩ ↩2 ↩3 ↩4