Skip to content

feat: sign DKLS safe VRF keygen messages and send BIP44 path on safe derive - #9983

Merged
davidkaplanbitgo merged 2 commits into
masterfrom
WCN-2969-derive-r1-path
Oct 16, 2026
Merged

davidkaplanbitgo merged 2 commits into
masterfrom
WCN-2969-derive-r1-path

Conversation

@davidkaplanbitgo

@davidkaplanbitgo davidkaplanbitgo commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Tickets: WCN-3084, WCN-2969

Two commits, two independent changes to the safe MPC flows in sdk-core:

  1. feat: align DKLS safe VRF keygen with the HSM (WCN-3084)
  2. feat(sdk-core): send the full BIP44 path on safe derive round 1 (WCN-2969)

The first commit is the work from #9982 (branch sibikrishnan/wcn-3084-dkls-vrf-keygen-signed-messages), brought in here so both land together.

1. DKLS safe VRF keygen signed messages (WCN-3084)

  • Safe ecdsaMpc keygen fails at R1: the HSM returns 400 because the VRF messages are sent as unsigned base64(JSON) strings.
  • Sign each party's VRF message with its GPG key (DklsComms.detachSignData), in the {from, message, signature} shape the HSM verifies.
  • Verify BitGo's signature on bitgoVrfMsg1. Decrypt and verify bitgoVrfMsgToUser / bitgoVrfMsgToBackup.
  • R2 sends only each party's opening addressed to BitGo, signed.
  • Remove the nonexistent bitgoVrfMsg2 assertion, the local opaque VRF types, and the serialize helpers.
  • The fake HSM in the tests follows the hsm-api contract, with cases for a forged R1 commitment and forged R2 openings.

2. Full BIP44 path on safe derive round 1 (WCN-2969)

  • ECDSA and EdDSA sendDerivationRound1BySender send the Safe child path (m/44'/<coinType>'/<slot>'/<account>') in place of the account index. Removes the TODO(WCN-2969) markers.
  • KeyGenSenderForSafeChild (both curves) now takes and sends coin, so wallet-platform can resolve the coin type it expects in the path.
  • The EdDSA createSafeChildKeychains keeps validating the path with parseSafeBip44Path before any network call.

Dependency bump

@bitgo/public-types 6.83.0 to 6.90.0 in sdk-core, sdk-lib-safes, abstract-lightning, express, passkey-crypto, sdk-coin-flrp, sdk-coin-sol and bitgo. 6.88.0 added the DKLS VRF codecs (change 1); 6.90.0 adds path on the derive round 1 requests (change 2).

Depends on

  • Merge after the matching wallet-platform change for the signed VRF messages is deployed: each side rejects the other's old format (safe ecdsaMpc only; it already fails today).
  • wallet-platform accepting path and coin on POST /mpc/generatekey (bitgo-microservices draft PR, WCN-2963).

Test

  • Root yarn build passes.
  • bitgo test/v2/unit/internal/tssUtils/ecdsaVrfMPCv2/: 13 passing (createKeychains.ts for change 1; the R1 nock in createSafeChildKeychains.ts matches path and coin for change 2).
  • sdk-core unit tests filtered to VRF|Vrf|derive|Derive|safe: 130 passing (includes eddsaVrfMPCv2.ts: R1 body carries path and coin, no derivationIndex).
  • Not run against a real HSM or wallet-platform.

@linear-code

linear-code Bot commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

WCN-2969

@davidkaplanbitgo
davidkaplanbitgo marked this pull request as ready for review October 15, 2026 19:49
@davidkaplanbitgo
davidkaplanbitgo requested review from a team as code owners October 15, 2026 19:49
@davidkaplanbitgo
davidkaplanbitgo changed the base branch from WCN-2964 to master October 15, 2026 20:59
danielpeng1
danielpeng1 previously approved these changes Oct 15, 2026
@davidkaplanbitgo
davidkaplanbitgo marked this pull request as draft October 16, 2026 00:09
pranishnepal
pranishnepal previously approved these changes Oct 16, 2026
@davidkaplanbitgo
davidkaplanbitgo force-pushed the WCN-2969-derive-r1-path branch 2 times, most recently from dfb4169 to 6f8d566 Compare October 16, 2026 14:15
@github-actions

github-actions Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ Unit tests are failing on Node 26.x (Current release line, non-blocking). This is not an LTS version yet, so it does not block merge, but it signals an incompatibility to fix before Node 26.x becomes LTS.

View run

@davidkaplanbitgo
davidkaplanbitgo requested a deployment to breaking-changes-override October 16, 2026 15:31 — with GitHub Actions Waiting
@danielpeng1
danielpeng1 self-requested a review October 16, 2026 15:44
Derive round 1 now sends the Safe child path
m/44'/<coinType>'/<slot>'/<account>' in place of the account index, and
the safe child sender sends the coin so the service can resolve the
expected coin type. Removes the TODO(WCN-2969) markers.

Ticket: WCN-2969
@davidkaplanbitgo davidkaplanbitgo changed the title feat(sdk-core): send the full BIP44 path on safe derive round 1 feat: sign DKLS safe VRF keygen messages and send BIP44 path on safe derive Oct 16, 2026
@davidkaplanbitgo
davidkaplanbitgo deployed to breaking-changes-override October 16, 2026 16:20 — with GitHub Actions Active
@danielpeng1
danielpeng1 marked this pull request as ready for review October 16, 2026 16:36
@danielpeng1
danielpeng1 requested a review from a team as a code owner October 16, 2026 16:36
@melizafranco

Copy link
Copy Markdown

Breaking change linter override approved. Re: Pre-GA. Note that the Audit API CI will continue to show as failing. That’s expected, but non blocking now.

@davidkaplanbitgo
davidkaplanbitgo merged commit 8fe7ada into master Oct 16, 2026
25 of 26 checks passed

This branch was successfully deployed

1 active deployment
breaking-changes-override — cc54e4e0 Deployed Oct 16, 2026 by davidkaplanbitgo via Linter Override #5736
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.

7 participants