Skip to content

feat(draws): fix #30 verifiable unbiased commit-reveal draws - #78

Merged
BigDella merged 3 commits into
Vaultquest:mainfrom
fhayvy:feature/30-verifiable-draws
Jul 27, 2026
Merged

feat(draws): fix #30 verifiable unbiased commit-reveal draws#78
BigDella merged 3 commits into
Vaultquest:mainfrom
fhayvy:feature/30-verifiable-draws

Conversation

@fhayvy

@fhayvy fhayvy commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Closes #30

Summary

Implemented a production-grade, verifiable, and manipulation-resistant commit-reveal draw mechanism in the drip-pool Soroban smart contract to replace the deterministic/admin-only placeholder draw winner selection.

Key Technical Enhancements:

  • Commit-Reveal Mechanism: Initiates draws in two steps (commit_draw and finalize_draw) to prevent admins or providers from predicting or skewing outcomes before commitment.
  • Freeze Boundary Lock: Blocks all joins, deposits, and withdrawals while a committed draw is active. This naturally freezes eligible participants and weights at the freeze_ledger boundary without requiring expensive storage snapshots.
  • Verification & Completeness Enforcement: Requires the caller of finalize_draw to submit a complete participant address list whose deposit weights sum exactly to the pool's total deposited balance, preventing provider-side omission bias.
  • Domain Separation: Combines network passphrase hash, contract address, round ID, freeze sequence, and the revealed secret to generate a secure random seed.
  • Modulo Bias Mitigation: Maps the seed to the winners using a mathematical rejection sampling loop.
  • Liveness & Timeout Fallbacks: Implements a time-bounded deadline (reveal_deadline) after which anyone can call cancel_draw to unlock the pool and allow normal participant operations to resume.

@BigDella

Copy link
Copy Markdown

@fhayvy fix the error

@BigDella

Copy link
Copy Markdown

@fhayvy fix merge conflict

@fhayvy
fhayvy force-pushed the feature/30-verifiable-draws branch from be225a1 to 3231fd5 Compare July 23, 2026 10:49
@fhayvy

fhayvy commented Jul 23, 2026

Copy link
Copy Markdown
Contributor Author

@BigDella

@BigDella

Copy link
Copy Markdown

@fhayvy great job

@BigDella
BigDella merged commit 8b3c8a7 into Vaultquest:main Jul 27, 2026
4 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[HARD][RANDOMNESS] Replace deterministic prize selection with verifiable unbiased draws

2 participants