Skip to content

SFT-7483: Preserve master private HD key bytes during UR decoding - #56

Merged
Jacksper13 merged 1 commit into
mainfrom
agent/sft-7483-hdkey-decode
Aug 10, 2026
Merged

Jacksper13 merged 1 commit into
mainfrom
agent/sft-7483-hdkey-decode

Conversation

@Jacksper13

@Jacksper13 Jacksper13 commented Aug 10, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fix master-private hdkey decoding so it validates the required zero prefix and copies all 32 secret-key bytes from the 33-byte BIP32 key-data field.

The previous decoder copied bytes 0..32, retaining the prefix and dropping the final secret-key byte while returning success.

Changes

  • require the master private key-data prefix to be zero
  • decode the secret from bytes 1..33
  • verify exact round trips through both hdkey and crypto-hdkey generic Value routes
  • reject nonzero prefixes and key-data fields that are not exactly 33 bytes

@Jacksper13
Jacksper13 marked this pull request as ready for review August 10, 2026 07:48
@Jacksper13
Jacksper13 merged commit 32c1aec into main Aug 10, 2026
3 checks passed
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