Skip to content

44 dkg improvements - #45

Draft
JonKuqi wants to merge 2 commits into
mainfrom
44-dkg-improvements
Draft

JonKuqi wants to merge 2 commits into
mainfrom
44-dkg-improvements

Conversation

@JonKuqi

@JonKuqi JonKuqi commented Aug 27, 2026 •

Copy link
Copy Markdown
Collaborator

This PR brings updates from d-voting's Pedersen DKG into dela/dkg/pedersen, together with the minimal generic helpers needed for d-voting to use DELA directly without accessing private DKG state.

Some changes come from d-voting, while others are new helpers added to DELA so d-voting does not need to access private DKG state.

closes #44

Peer public-key discovery

Adds GetPeerPubKey / GetPeerPubKeyResp and SetupWithPlayers(mino.Players, int).

DELA's current Setup(coAuth, threshold) expects the caller to already know the DKG public key of every participant. d-voting already solved this by asking every peer for its public key before starting the DKG.

SetupWithPlayers now does this in DELA:

  • asks every participant for its DKG public key
  • matches responses using the sender address
  • rejects duplicate, unknown, or nil responses
  • then uses the same setup logic as the existing Setup

The existing Setup method stays unchanged.

This flow was originally added in d-voting by Noémien Kocher in commit 4ac9e957 (Updates the election flow).

Actor persistence

Adds MarshalBinary() and Restore(mino.Mino, []byte) so a DKG actor can be saved and restored after a restart.

d-voting already had persistence for its DKG state using HandlerData and MarshalJSON. This work was added by Auguste Baum in commits:

  • fefc7fbe
  • d572abe2
  • 42dd96f0

The DELA version follows the same idea but is made generic:

  • no form-specific state
  • no database dependency
  • no hardcoded address factory
  • uses m.GetAddressFactory() when restoring
  • snapshots are versioned

Only stable initial and certified states can be saved. sharing and resharing are rejected.

The snapshot contains private DKG state, so it must be stored securely.

Helpers that make d-voting work but may not be used by DELA

Local partial decryption

Adds DecryptShare(K, C).

d-voting needs each node to calculate its own partial decryption before publishing it. Its current implementation does this directly using privShare.V.

DELA already does the same calculation internally during decryption, but there was no actor method for doing it locally.

DecryptShare exposes this operation without exposing the private share itself. It only returns the share index and the partial decryption.

This is new in DELA and is not directly ported from d-voting.

Shared decrypt helper

The existing network decrypt path and the new DecryptShare method now both use the same internal decryptShare helper.

This is just a small refactor so both paths use the same calculation.

Tests

go test ./dkg/... -count=1

And a d-voting temorrary adapter was tested with the new dela changes. All pass.

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.

D-voting dkg improvements

1 participant