Skip to content

ADD: BIP47 (m/47') derivation path support for message signing#891

Open
MightyMercurian wants to merge 1 commit intoSeedSigner:devfrom
MightyMercurian:bip47-message-signing
Open

ADD: BIP47 (m/47') derivation path support for message signing#891
MightyMercurian wants to merge 1 commit intoSeedSigner:devfrom
MightyMercurian:bip47-message-signing

Conversation

@MightyMercurian
Copy link
Copy Markdown

Summary

Adds 47h (BIP47) to the recognized purpose bytes in parse_derivation_path(), enabling message signing with BIP47 identity keys through the existing signmessage flow.

Why: BIP47 payment codes, PayNym identities, and Auth47 authentication all require signing messages with keys derived at m/47'/0'/0'. The signing primitive (sign_message()) already accepts any derivation path — the only blocker was the policy gate in the derivation path parser rejecting unrecognized purpose bytes.

What changed:

  • src/seedsigner/helpers/embit_utils.py: Added "47h": SettingsConstants.LEGACY_P2PKH to the script_types lookup in parse_derivation_path(). BIP47 v1/v2 notification addresses are P2PKH, so the address displayed on the confirmation screen is the correct notification address.
  • tests/test_flows_seed.py: Added test_sign_message_bip47_flow covering the full signing flow with a BIP47 derivation path (m/47h/0h/0h/0/0).

What this enables:

  • Auth47 challenge signing — coordinator formats signmessage m/47h/0h/0h/0/0 ascii:<challenge>, SeedSigner signs, coordinator POSTs response
  • PayNym claim/follow proofs — same signing mechanism with PayNym API tokens
  • BIP47 identity message signing — general-purpose signing with payment code keys

What this does NOT change:

  • No new QR types, views, or cryptographic code
  • No changes to the signing primitive
  • All existing tests pass unchanged

Context: https://gist.github.com/arkfile/7a320dbb4377c5e1b65250b2049e941d

Enable message signing with BIP47 identity keys by adding 47h to the
recognized purpose bytes in parse_derivation_path(). This unlocks Auth47
challenge signing, PayNym claim proofs, and BIP47 identity message
signing through the existing signmessage flow.

The signing primitive (embit_utils.sign_message) already accepts any
derivation path. This change updates the parser so BIP47 paths pass
the policy gates in SeedSignMessageStartView and
SeedSignMessageConfirmAddressView instead of redirecting to
NotYetImplementedView.
@arkfile
Copy link
Copy Markdown

arkfile commented Mar 19, 2026

Thanks, @MightyMercurian, for opening this PR. The concept / proposal has been iterated over a number of times with some feedback from MM and others who are familiar with the BIP47 / PayNym side. Thank you for your consideration, SeedSigner devs!

Proposal link: https://gist.github.com/arkfile/7a320dbb4377c5e1b65250b2049e941d (as linked by MM above).

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.

2 participants