Conversation
Contributor
Contributor
|
|
davidkaplanbitgo
approved these changes
Sep 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ticket: WCN-2446
Adds a standalone round-driver for the DKLS VRF DKG — VrfDkg — to sdk-lib-mpc, letting one party (user/backup/BitGo) run its side of a 2-of-3 VRF key generation. This is the crypto primitive for safe MPC root
keys that carry a VRF share for hardened derivation; it wraps the VrfKeygenSession wasm (deps added in #9635) behind the same session-persistence and message-handling patterns as the existing signing Dkg, and
reuses the existing comms layer unchanged. No platform, wire-format, or createKeychains changes — the driver is fully exercisable with a local 3-party in-process run.
Changes
src/tss/dkls-vrf/dkg.ts— VrfDkg class: initDkg() (broadcast commitment), handleIncomingMessages() (round routing incl. the measured n−1 / n message asymmetry; round-2 openings are emitted per-recipient),getKeyShare() / getPublicKey() / getKeyId() / getRootChainCode(), and getSessionData() / restoreSession() with round state re-derived from the wasm session bytes (_deserializeState) rather than trusted from
the caller.
src/tss/dkls-vrf/types.ts— VrfDkgState + VrfDkgSessionData (own enum, kept separate from DkgState since round counts differ).src/tss/dkls-vrf/util.ts— generateVrfDKGKeyShares() local 3-party helper, mirroring generateDKGKeyShares.src/tss/dkls-vrf/index.ts+src/tss/index.ts— exported as DklsVrf, matching the DklsDkg/DklsComms naming convention.test/unit/tss/dkls-vrf/dkg.ts— 10 tests: 3-party agreement on publicKey/keyId/rootChainCode, deterministic pinned seed fixture, full round-trip through the comms layer (openpgp sign/verify),serialize/deserialize round-trip, session restore after each round, and rejection cases (wrong message count, duplicate senders, early getKeyShare).