Skip to content

Privacy preserving ai bounty judge - #9

Open
evmpapa wants to merge 3 commits into
cozfuttu:mainfrom
evmpapa:privacy-preserving-ai-bounty-judge
Open

Privacy preserving ai bounty judge#9
evmpapa wants to merge 3 commits into
cozfuttu:mainfrom
evmpapa:privacy-preserving-ai-bounty-judge

Conversation

@evmpapa

@evmpapa evmpapa commented Jul 2, 2026

Copy link
Copy Markdown

Summary

Implemented the Privacy-Preserving AI Bounty Judge homework by replacing the public plaintext submission flow with a commit-reveal bounty flow.

Participants now submit only a commitment hash during the submission phase, then reveal their answer and salt during the reveal phase. The contract verifies the reveal using:

keccak256(abi.encodePacked(answer, salt, msg.sender, bountyId))

Only valid revealed answers are eligible for AI judging.

What changed

  • Added commit-reveal submission flow
  • Added submission and reveal deadlines
  • Added one-commitment-per-user-per-bounty rule
  • Added reveal validation with answer, salt, sender, and bountyId
  • Excluded unrevealed submissions from judging
  • Added owner-only batched judgeAll
  • Added validated finalizeWinner
  • Added single payout protection
  • Added mock Ritual LLM output for tests
  • Updated the web app flow for commit/reveal/judge/finalize
  • Updated README, lifecycle docs, architecture note, and reflection answer

Testing

Verified successfully:

  • npx hardhat test — 13 passing
  • npm run build — passing
  • npm run lint — passing

Security notes

  • No private key or local .env file was committed
  • Only .env.example placeholders were committed
  • Sensitive local environment files remain gitignored
  • The final diff was checked for private-key-shaped values

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.

1 participant