Skip to content

feat(wasm-mps): VRF-DKG + hard derive bindings for eddsaMpc hardened derivation - #363

Draft
joeypinz wants to merge 1 commit into
masterfrom
feat/mps-hard-derive
Draft

feat(wasm-mps): VRF-DKG + hard derive bindings for eddsaMpc hardened derivation#363
joeypinz wants to merge 1 commit into
masterfrom
feat/mps-hard-derive

Conversation

@joeypinz

Copy link
Copy Markdown

Summary

Adds Ristretto VRF-DKG and hard-derive bindings to wasm-mps, needed for hardened MPC derivation on the eddsaMpc (MPS/ed25519) Wallet Safes slot.

Context: TDD: Wallet Safes v1 — Part III-2: MPC Wallet Minting (VRF) (David Kaplan, draft). Opened as draft — the TDD is explicitly not final and no tickets exist yet; this is meant to give reviewers something concrete to look at, not to preempt that process.

  • New ed25519_vrf_dkg_round{0,1,2}_process and ed25519_hard_derive_round{0,1,2}_process, matching this file's own round0(bootstrap)/round1/round2 split — the closest match to precedent of the three repos touched by this work.
  • Golden-vector matched byte-for-byte against the companion hsm-firmware/sl-mps implementation (PR #2305), with deliberately different round seeds on each side, confirming hard-derive's output is a pure function of (root, vrf_share, path) as the VRF construction requires.
  • A real bug found and fixed here: the original functions read/wrote raw bincode with no domain-separator prefix, unlike every other function in this file (and unlike the matching sl-mps functions, which require one). A real message from either side would have failed to decode on the other in production — invisible to both repos' own test suites, since each only round-trips messages within itself. This is concrete evidence for the sl-mps/wasm-mps duplication risk flagged in the TDD's Open Item docs: use formal capitalization of Node.js #5 — worth a look before deciding whether independent implementations (this PR's shape) or a relinked shared binding is the long-term target.
  • Test suite extended in place (test/mps.ts, alongside ed25519/redpallas) rather than as a new file — no precedent in this repo for a second test binary/file per protocol addition.

What this doesn't do

Nothing in BitGoJS, wallet-platform, or hsm-api.

Test plan

  • cargo build, cargo test, cargo clippy --all-targets --all-features -- -D warnings, cargo fmt --check — all clean
  • npm test — 51/51 passing (49 pre-existing + 2 new), including the golden-vector cross-check against sl-mps
  • Review from HSM team / David before any merge consideration

@joeypinz
joeypinz force-pushed the feat/mps-hard-derive branch from d8dbb4c to bb0ffa5 Compare August 20, 2026 22:46
Safe creation advances signing DKG and VRF-DKG in the same three rounds
when round0 is called with with_vrf=true, and writes both finished shares
into one RootDocument. Ordinary DKG (with_vrf=false) keeps the previous
bare Keyshare encoding. Hard-derive takes that combined document; the
standalone VRF-DKG wasm exports are removed.

Co-authored-by: Cursor <cursoragent@cursor.com>
@joeypinz
joeypinz force-pushed the feat/mps-hard-derive branch from bb0ffa5 to a00b10f Compare August 20, 2026 22:49
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