Skip to content

Auto-Reveal via Shutter Network #1314

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Tracked by #1588
jaybuidl opened this issue Oct 30, 2023 · 1 comment · May be fixed by #1965
Open
Tracked by #1588

Auto-Reveal via Shutter Network #1314

jaybuidl opened this issue Oct 30, 2023 · 1 comment · May be fixed by #1965
Assignees
Labels
Package: Contracts Court smart contracts Package: Web Court web frontend Status: Specifications Needed 📜 Type: Epic 🐉 A large user story that can be broken down into a number of smaller stories. Type: Feature🗿 Type: UX User Experience

Comments

@jaybuidl
Copy link
Member

jaybuidl commented Oct 30, 2023

High Level Specs

Initialization

sequenceDiagram
    participant Shutter Key Broadcast Contract
    participant Shutter Keypers

    Shutter Keypers->>Shutter Keypers: Keyper Set becomes active
    Shutter Keypers->>Shutter Keypers: Generate new Eon key
    Shutter Keypers->>Shutter Key Broadcast Contract: Broadcast Eon public key
Loading

During a dispute

sequenceDiagram
    %% Participants
    participant Voter as Juror
    participant Bot as Reveal Bot<br>(anyone)
    participant ShutterSDK as Shutter SDK
    participant Shutter as Shutter Network
    participant Contract as ShutterDisputeKit

    %% --- Vote Commitment Phase ---
    Note over Voter,Contract: Voting session opens
    Voter->>Shutter: register_identity(decryptionTimestamp)
    Shutter-->>Voter: {identity, eon_key}
    Voter->>Voter: generate random salt
    Voter->>ShutterSDK: encrypt(message: {choice, justification, salt}, identity, eon_key)
    ShutterSDK-->>Voter: {encryptedVote}
    Voter->>Voter: commitHash = keccak256(choice, justification, salt)
    Voter->>Contract: castCommit(voteIDs, commitHash, identity, encryptedVote)
    Contract-->>Contract: emits CommitCast(voter, voteIDs, commitHash, identity, encryptedVote)

    %% --- Vote Reveal Phase (after delay) ---
    Note over Voter,Contract: Voting session ends, Shutter Network releases decryption key
    Bot->>Contract: query CommitCast event({voter})
    Contract-->>Bot: CommitCast event(voter, voteIDs, commitHash, identity, encryptedVote)
    Bot->>ShutterSDK: decrypt(encryptedVote, identity)
    ShutterSDK->>Shutter: get_decryption_key(identity)
    Shutter-->>ShutterSDK: decryption_key
    ShutterSDK-->>Bot: {choice, justification, salt}
    Bot->>Contract: castVote(voteIDs, choice, salt, justification)
    Contract-->>Contract: verify vote hash against commitHash
    Contract-->>Contract: emits VoteCast(voteIDs, voter, choice, justification, salt)

Loading

The disputeID and roundID are omitted for clarity.

Considerations

  • Allow the encrypted vote and justification to be submitted along with the committment and emit the enrypted value as an Event so it can be picked up by the Keypers
  • Add a function batchCastVote that is callable by anyone (i.e. no check against msg.sender) and thereby allows third parties to submit decrypted vote batches on behalf of the users.
  • There could be a fee incentive for the third party to offset the transaction costs (deposited by jurors in castCommit, excess can be refunded).
  • Possible solution for the not commited to justification:
    Jurors EC-Recoverable sign the justification which allows verifivation of the sender.

Reference

Shutter JS library
Shutter JS example use by Snapshot
Default commit/reveal implementation

@jaybuidl jaybuidl added Type: Feature🗿 Status: Specifications Needed 📜 Package: Web Court web frontend Package: Contracts Court smart contracts Type: UX User Experience Type: Epic 🐉 A large user story that can be broken down into a number of smaller stories. labels Oct 30, 2023
@jaybuidl jaybuidl self-assigned this Mar 13, 2024
@jaybuidl
Copy link
Member Author

jaybuidl commented Mar 12, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Package: Contracts Court smart contracts Package: Web Court web frontend Status: Specifications Needed 📜 Type: Epic 🐉 A large user story that can be broken down into a number of smaller stories. Type: Feature🗿 Type: UX User Experience
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant