feat: Privacy-Preserving AI Bounty Judge — Commit-Reveal with Ritual LLM Precompile - #1
Open
Babasss-hub wants to merge 3 commits into
Open
feat: Privacy-Preserving AI Bounty Judge — Commit-Reveal with Ritual LLM Precompile#1Babasss-hub wants to merge 3 commits into
Babasss-hub wants to merge 3 commits into
Conversation
added 3 commits
June 24, 2026 19:58
- PrivacyBounty.sol: commit-reveal pattern with Ritual LLM precompile 0x0802 - PrivacyBounty.t.sol: 10/10 Foundry tests passing - ARCHITECTURE.md: system design documentation - REFLECTION.md: design reflections - DEPLOYMENT.md: Ritual Chain testnet deployment info Deployed to Ritual Chain Testnet: - Contract: 0xFede5f85E239F8e2FB5f4cd55d8Eff905F42109C - Deployer: 0x8f8E6a010e8A8eB76be350FDF2bB8A3CEDa42De8 - Chain ID: 1979
…b4d23f8 (deployed from 0xb31b...4617)
Aphelios01-sdk
added a commit
to Aphelios01-sdk/ritual-chain-workshop
that referenced
this pull request
Jun 26, 2026
…proof + doc polish - Removed unused IRitualWallet interface and LLM_INFERENCE_PRECOMPILE constant (dead code — judgeAll uses configurable LLM_PRECOMPILE immutable). - Added MAX_ANSWER_LENGTH edge case to honesty notes (checked at reveal only; self-correcting with v3 refund). - Updated honesty notes: dropped obsolete cozfuttu#1 (dead constant) and cozfuttu#2 (wallet). - Root README: clarified workshop vs homework structure with verified contract addresses + deploy notes. - Flow status table: replaced v2 proof references with live v3 proof (bounty 1, two participants, 5 tx hashes on 0x97e19070...). - .deploy-info.txt: added commit-reveal live proof entries (v3, bounty 1). - 52/52 tests passing.
Aphelios01-sdk
added a commit
to Aphelios01-sdk/ritual-chain-workshop
that referenced
this pull request
Jun 27, 2026
CRITICAL cozfuttu#1: judgeAll now decodes the LLM precompile envelope and reverts atomically on hasError — judged stays false so the owner can retry once the LLM recovers (no permanent lock, no reset mechanism needed). Decode is guarded for empty payloads to preserve Ritual async-delivery compatibility. - Added ConvoHistory struct + 5-tuple decode. - MockLLMPrecompile: setShouldError toggle (returns hasError envelope). - testRevertJudgeAllOnLLMError: asserts revert + judged==false + successful retry. - Renamed 2 mislabeled invariant_ functions to test* (they were single-flow). - 79/79 tests passing. NOTE on reviewer's cozfuttu#2 (force winnerIndex == AI verdict): intentionally NOT applied — the assignment explicitly forbids auto-paying from AI output and requires human-in-the-loop. answersHash/inputHash already make the judging auditable; the owner veto is by-design.
Trevor00s
added a commit
to Trevor00s/ritual-chain-workshop
that referenced
this pull request
Jun 28, 2026
- live bounty cozfuttu#1: createBounty + submitSealed (ECIES ciphertext, no plaintext) + escrow-funded judgeAll + finalize, all confirmed on-chain - judgeAll returned a real GLM-4.7-FP8 verdict {"winnerIndex":0,"summary":"ok"} via executor 0xB42e...c91B (tx 0x336bc233...) - scripts/live-sealed-demo.mjs + judge-now.mjs + diag.mjs; ADVANCED.md records the live tx hashes + honest scope (inline judge path used for the verdict)
stevan-99
pushed a commit
to stevan-99/ritual-chain-workshop
that referenced
this pull request
Jul 1, 2026
…uttu#7 — commit-reveal + parseBounty + Disputable bounty + privacy-preserving
HadesDev99
pushed a commit
to HadesDev99/ritual-chain-workshop
that referenced
this pull request
Jul 5, 2026
reclaimReward sets bounty.finalized but never touches winnerIndex, which stays at its uint256-max sentinel from createBounty. BountyView only checked bounty.finalized before rendering SettledBanner, so a reclaimed bounty (nobody revealed) showed "Settled - winner paid" with "Entry cozfuttu#1.157...e+77" -- a nonsensical winner for a bounty nobody won. Branch on revealedCount to show a distinct ReclaimedBanner instead, once that count has actually loaded (so we don't guess "won" while it's still pending). Separately, both finalizeWinner and reclaimReward zero bounty.reward on-chain before paying out, so any refetch after either action always reads back 0 -- the Payout/Refunded amount was silently wrong for every settled bounty. finalizeWinner emits WinnerFinalized with the real amount, so parse that from the confirming tx's receipt; reclaimReward emits nothing, so capture the pre-tx bounty.reward snapshot before submitting instead. Both are session- local: a fresh page load of an already-settled bounty still has no way to recover the historical amount. Verified against real on-chain data: a real finalized bounty now shows "Entry #0" (not garbage), and a real reclaimed bounty shows "Settled - reclaimed, nobody revealed" instead of a fake winner banner. Also fixes the same masthead border/heading-size overflow issue described in the next commit, since it lives in this file.
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.
🔐 Privacy-Preserving AI Bounty Judge
Commit-reveal pattern smart contract for hidden bounty submissions with AI judging via Ritual Chain LLM precompile.
What's included:
Deployed to Ritual Chain Testnet:
Design:
The contract implements a two-phase commit-reveal pattern:
This ensures fair judging — proposals are hidden until all submissions are in, preventing copycat submissions.
Built for the Ritual Chain Workshop