test: add BIP32 vectors 3 and 4 to the extendedkey self-test #36185

Open
fametrano wants to merge 1 commit from test-bip32-vectors into master AGit
fametrano commented 2026-09-07 18:06:45 +00:00 (Migrated from github.com)

test_bip32_vectors covers BIP32 vectors 1 and 2 only. Vectors 3 and 4 test retention of leading zeros in a private key and hardened derivation over such a key — the cases implementations have historically got wrong.

Both run against the existing API; no new capability is needed.

Made with my usual tools: a computer, the Internet and an LLM. The mistakes, as usual, are all mine.

`test_bip32_vectors` covers BIP32 vectors 1 and 2 only. Vectors 3 and 4 test retention of leading zeros in a private key and hardened derivation over such a key — the cases implementations have historically got wrong. Both run against the existing API; no new capability is needed. *Made with my usual tools: a computer, the Internet and an LLM. The mistakes, as usual, are all mine.*
DrahtBot commented 2026-09-07 18:07:01 +00:00 (Migrated from github.com)

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

External sites

Reviews

See the guideline and AI policy for information on the review process.

Type Reviewers
ACK rkrux

If your review is incorrectly listed, please copy-paste <!--meta-tag:bot-skip--> into the comment that the bot should ignore.

<!--e57a25ab6845829454e8d69fc972939a--> The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. <!--006a51241073e994b41acfe9ec718e94--> ### External sites * Code coverage & benchmarks: https://corecheck.dev/bitcoin/bitcoin/pulls/36185 * Ralph review <img src=https://review.fish.foo/assets/bitcoin/bitcoin/36185.png alt="Ralph review status"> https://git.fish.foo/bitcoin/bitcoin/pulls/36185#author-ralph <!--021abf342d371248e50ceaed478a90ca--> ### Reviews See [the guideline](https://github.com/bitcoin/bitcoin/blob/master/CONTRIBUTING.md#code-review) and [AI policy](https://github.com/bitcoin/bitcoin/blob/master/doc/AI_POLICY.md) for information on the review process. | Type | Reviewers | | ---- | --------- | | ACK | [rkrux](https://github.com/bitcoin/bitcoin/pull/36185#pullrequestreview-5491183889) | If your review is incorrectly listed, please copy-paste <code>&lt;!--meta-tag:bot-skip--&gt;</code> into the comment that the bot should ignore. <!--5faf32d7da4f0f540f40219e4f7537a3-->
fametrano commented 2026-09-26 06:14:03 +00:00 (Migrated from github.com)

@rkrux @w0xlt @pseudoramdom @achow101 since you wrote or reviewed #35543: this adds BIP32 vectors 3 and 4 to its test_bip32_vectors. Would you take a look?

@rkrux @w0xlt @pseudoramdom @achow101 since you wrote or reviewed #35543: this adds BIP32 vectors 3 and 4 to its `test_bip32_vectors`. Would you take a look?
First-time contributor

Base: 228877d7836a55c1d6fde90b0b7ba2d4c90248ab
Head: 5b761e399ce39dad65382a4665d3b00e87da9c9a

No verified findings are available from this review.

Review coverage was incomplete. adversarial_glm: Runner code (where extendedkey.ExtendedPrivateKey is called for path "m/0h" with parser hardened(int(part[:-1]))) is in an unexamined harness; if that harness were changed in this PR (it is not in the patch), vector 3 coverage could silently degrade. The diff shows only the data addition, so this does not affect the current review.

Full review report

<!-- forgejo-review-bot:bitcoin/bitcoin --> Base: `228877d7836a55c1d6fde90b0b7ba2d4c90248ab` Head: `5b761e399ce39dad65382a4665d3b00e87da9c9a` No verified findings are available from this review. Review coverage was incomplete. adversarial_glm: Runner code (where extendedkey.ExtendedPrivateKey is called for path "m/0h" with parser `hardened(int(part[:-1]))`) is in an unexamined harness; if that harness were changed in this PR (it is not in the patch), vector 3 coverage could silently degrade. The diff shows only the data addition, so this does not affect the current review. [Full review report](<https://review.fish.foo/traces/36185-5b761e399ce39dad65382a4665d3b00e87da9c9a-657-4.html>)
rkrux (Migrated from github.com) approved these changes 2026-10-12 13:05:04 +00:00
rkrux (Migrated from github.com) left a comment

unenthusiastic ACK 5b761e399c

I reviewed this PR because I authored this file but usually marginal impact PRs such as this don't get much review.

unenthusiastic ACK 5b761e399ce39dad65382a4665d3b00e87da9c9a I reviewed this PR because I authored this file but usually marginal impact PRs such as this don't get much review.
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
bitcoin/bitcoin!36185
No description provided.