Skip to content
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

Auto-Reveal via Shutter Network #1314

Open
3 tasks
Tracked by #1588
jaybuidl opened this issue Oct 30, 2023 · 0 comments
Open
3 tasks
Tracked by #1588

Auto-Reveal via Shutter Network #1314

jaybuidl opened this issue Oct 30, 2023 · 0 comments
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

Tasks

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
    participant Juror
    participant Kleros Frontend
    participant Kleros Dispute Contract
    participant Shutter Key Broadcast Contract
    participant Shutter Reveal Submitter
    participant Shutter Keypers

    Note over Juror: Wants to cast a Vote
    Kleros Frontend->>Shutter Key Broadcast Contract: Fetch Eon pub key
    Note over Kleros Frontend: Derive encryption key<br/>from Eon pub key using<br/>(disputeId, round, chainId)

    Juror->>Kleros Frontend: Perform regular vote signing
    Juror->>Kleros Frontend: Also provide plaintext<br/>vote and justification
    Note over Kleros Frontend: Encrypt vote and justification<br/>using Shutter JS/WASM Lib

    Juror->>Kleros Dispute Contract: Submits commit and encrypted vote
    Note over Kleros Dispute Contract: Emits the encrypted vote as an event

    Note over Shutter Keypers: Monitor Kleros Dispute Contract<br/>for commits containing encrypted<br/>votes and disputes     entering the<br/>`vote` period

    Note over Shutter Keypers: Generate and assemble key shares
    Shutter Keypers->>Shutter Reveal Submitter: Publish decryption<br/>key via p2p network

    Note over Shutter Reveal Submitter: Decrypts votes
    Shutter Reveal Submitter->>Kleros Dispute Contract: Submits decrypted votes

Loading

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
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

No branches or pull requests

1 participant