Skip to content

DKG Adapter Proof of concept - #252

Draft
JonKuqi wants to merge 1 commit into
mainfrom
dkg-adapter-poc
Draft

JonKuqi wants to merge 1 commit into
mainfrom
dkg-adapter-poc

Conversation

@JonKuqi

@JonKuqi JonKuqi commented Aug 27, 2026

Copy link
Copy Markdown

Replaces the standalone d-voting Pedersen DKG with a thin adapter that wraps pedersen, so d-voting gets dela's DKG features (resharing, reencryption, verifiable encryption) and we stop maintaining two divergent copies.

The old duplicated dkg on d-voting has 4,532 lines of code. The adapter wrapps dela's dkg and adds d-voting specific functionality that reduces it to 1,393 lines of code.

⚠ IMPROTANT: For now this is a Proof of Concept only. Dela PR 45 needs to be merged into main and decide which functions are needed, then this branch needs to be updated by fixing import paths directly to dela instead of having stubs. Therefore the goal of this PR is just to show a maintainable solution to the duplicate DKGs.

What d-voting-specific functionality the adapter adds

  • Form binding — one DKG actor per formID, stored in a dkgMap bucket (Listen(formID, txmngr) / GetActor(formID)).
  • On-chain pubshare publication — ComputePubshares() computes each node's partial decryptions and submits them as transactions to the evoting smart contract, retrying until accepted or enough nodes have submitted.
  • Status reporting — Status() with 7 status codes and a Prometheus metric, surfaced to the frontend.
  • Persistence — HandlerData + MarshalJSON + ReadActors so actors survive process restarts.
  • Encrypt signature shim — maps dela's Encrypt(K, Cs) to d-voting's (K, C, remainder).

Benefits

  • Less code to maintain
  • dela's features for free — resharing, reencryption, and verifiable encryption come automatically from dela, with no re-porting.
  • One source of truth — a single DKG implementation in dela, so future dela DKG work benefits d-voting automatically and the two copies can't drift apart.

@JonKuqi JonKuqi self-assigned this Aug 27, 2026
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