Skip to content

feat: store and restore ecdsa dkg sessions #6368

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

Merged

Conversation

mohammadalfaiyazbitgo
Copy link
Contributor

Ticket: WP-5188

TICKET: WP-5188

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds functionality to store and restore ECDSA DKG sessions, enabling session state to be saved and later recovered during the multi-round DKG protocol.

  • Introduces new methods getSessionData() and restoreSession() in the DKG class.
  • Updates unit tests to verify that a DKG session can be resumed from stored session data.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
modules/sdk-lib-mpc/test/unit/tss/ecdsa/dklsDkg.ts Adds an extensive test to simulate and verify session restoration across DKG rounds.
modules/sdk-lib-mpc/src/tss/ecdsa-dkls/dkg.ts Implements session serialization (getSessionData) and restoration (restoreSession) functionality.
Comments suppressed due to low confidence (1)

modules/sdk-lib-mpc/src/tss/ecdsa-dkls/dkg.ts:292

  • Adding inline comments to explain the purpose and expected format of each field in DkgSessionData could improve code clarity for future maintainers.
  getSessionData(): DkgSessionData {

@@ -282,4 +282,210 @@ describe('DKLS Dkg 2x3', function () {
assert.deepEqual(DklsTypes.getCommonKeychain(userKeyShare), DklsTypes.getCommonKeychain(bitgoKeyShare));
assert.deepEqual(DklsTypes.getCommonKeychain(backupKeyShare), DklsTypes.getCommonKeychain(bitgoKeyShare));
});

it('should successfully finish DKG using restored sessions', async function () {
Copy link
Preview

Copilot AI Jun 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] This test block is very long and complex; consider splitting it into smaller, focused tests to improve maintainability and ease debugging.

Copilot uses AI. Check for mistakes.

Copy link
Contributor

@johnoliverdriscoll johnoliverdriscoll left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mohammadalfaiyazbitgo mohammadalfaiyazbitgo merged commit 1d4cbf4 into master Jul 2, 2025
13 checks passed
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.

3 participants