Skip to content

Expose the BIP-32 chain code from a key share - #7

Open
Jossec101 wants to merge 2 commits into
0xCarbon:mainfrom
Lunar-Rails:upstream/chain-code
Open

Jossec101 wants to merge 2 commits into
0xCarbon:mainfrom
Lunar-Rails:upstream/chain-code

Conversation

@Jossec101

Copy link
Copy Markdown
Contributor

Why

A wallet service hands out a new deposit address for each customer or payment. Today every new address needs every party to run derive_child. The group key plus the chain code make a BIP-32 xpub, which lets the server derive addresses on its own, offline. Those addresses match the ones the parties later sign for.

CI also fails on every PR right now, because current stable clippy rejects four format! calls.

What

  • chain_code() on the key share handle, in Rust, the C API (tss_handle_chain_code) and every binding (Go, Node, Python, .NET, React Native, WASM).
  • DKLs23 shares return the chain code made at DKG.
  • FROST Taproot returns the value derive.rs already uses. Both now go through one helper, so they can't drift apart.
  • Other suites return ProtocolMismatch.
  • The four format! args inlined.
  • Tests check derived child keys against a separate BIP-32 implementation.

Replaces #3.

CI runs clippy on the latest stable with -D warnings, and that version
rejects uninlined format args, so every pull request fails before its own
changes are even checked.

Inlines the four format! calls it flags, in the tokio example, the FFI
memory hardening test and the protocol tests.
A wallet service hands out a new address for every customer or payment,
and today each one needs every party to run derive_child. The group key
plus the chain code make a BIP-32 xpub, so a server can derive addresses
on its own, and they match the ones the parties later sign for.

Adds chain_code() to the key share handle, in Rust, the C API
(tss_handle_chain_code) and every binding. DKLs23 returns the chain code
made at DKG; FROST Taproot returns the value derive.rs already uses,
through one shared helper. Other suites return ProtocolMismatch. Tests
check child keys against a separate BIP-32 implementation, and the FFI
tests get a shared DKG and signing driver.
@Jossec101
Jossec101 marked this pull request as ready for review October 15, 2026 15:28
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