kleros-v2 icon indicating copy to clipboard operation
kleros-v2 copied to clipboard

Auto-Reveal via Shutter Network

Open jaybuidl opened this issue 2 years ago • 0 comments

### Tasks
- [ ] PoC for the Shutterized hidden votes
- [ ] Shutterized voting - DisputeKit
- [ ] Shutterized voting - Frontend

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

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

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 avatar Oct 30 '23 19:10 jaybuidl