Skip to content

Allow m prefix in derivation paths#2677

Merged
apoelstra merged 1 commit intorust-bitcoin:masterfrom
tcharding:04-11-allow-parsing-m
Apr 15, 2024
Merged

Allow m prefix in derivation paths#2677
apoelstra merged 1 commit intorust-bitcoin:masterfrom
tcharding:04-11-allow-parsing-m

Conversation

@tcharding
Copy link
Copy Markdown
Member

Recently in #2451 we disallowed bip32 derivation paths with the leading 'm' variable.

There is some confusion as to what exactly the bip specifies however Bitcoin Core RPC call getaddressinfo returns a derivation path with a leading "m/". This means we need to be able to parse it irrespective of what the bip says.

Be more liberal in what we accept as a derivation path, including both with and without the leading 'm/'.

Leave the full investigation of the bip to a later date.

Change back some of the test strings as makes sense and include test strings to showcase the full current behaviour.

This PR replaces #2674.

Recently in rust-bitcoin#2451 we disallowed bip32 derivation paths with the leading
'm' variable.

There is some confusion as to what exactly the bip specifies however
Bitcoin Core RPC call `getaddressinfo` returns a derivation path with a
leading "m/". This means we need to be able to parse it irrespective of
what the bip says.

Be more liberal in what we accept as a derivation path, including both
with and without the leading 'm/'.

Leave the full investigation of the bip to a later date.

Change back some of the test strings as makes sense and include test
strings to showcase the full current behaviour.
@github-actions github-actions bot added C-bitcoin PRs modifying the bitcoin crate test labels Apr 10, 2024
@tcharding tcharding added port-0.32.x Needs porting to 0.32.x branch and removed C-bitcoin PRs modifying the bitcoin crate test labels Apr 10, 2024
@coveralls
Copy link
Copy Markdown

Pull Request Test Coverage Report for Build 8638018440

Details

  • 37 of 37 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.005%) to 83.132%

Totals Coverage Status
Change from base Build 8629812825: 0.005%
Covered Lines: 19196
Relevant Lines: 23091

💛 - Coveralls

Copy link
Copy Markdown
Member

@apoelstra apoelstra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK 830c1e9

@apoelstra
Copy link
Copy Markdown
Member

cc @sanket1729 could you take a look and ACK this?

I believe this is the only issue with our first rc, so if we can merge this (and backport it) we can release another.

@tcharding
Copy link
Copy Markdown
Member Author

I believe this is the only issue with our first rc

We have the other two trivial ones too, but you are correct in that this PR has the only code change: https://github.com/rust-bitcoin/rust-bitcoin/pulls?q=+is%3Apr+label%3Aport-0.32.x+

Copy link
Copy Markdown
Member

@sanket1729 sanket1729 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK 830c1e9

Copy link
Copy Markdown
Contributor

@junderw junderw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK 830c1e9

@apoelstra apoelstra merged commit f18bd22 into rust-bitcoin:master Apr 15, 2024
apoelstra added a commit that referenced this pull request Apr 17, 2024
b7f61e2 Allow m prefix in derivation paths (Tobin C. Harding)

Pull request description:

  This PR contains a single patch that was created using `cargo cherry-pick 830c1e9` - i.e., it is a backport of #2677.

  ----

  Recently in #2451 we disallowed bip32 derivation paths with the leading 'm' variable.

  There is some confusion as to what exactly the bip specifies however Bitcoin Core RPC call `getaddressinfo` returns a derivation path with a leading "m/". This means we need to be able to parse it irrespective of what the bip says.

  Be more liberal in what we accept as a derivation path, including both with and without the leading 'm/'.

  Leave the full investigation of the bip to a later date.

  Change back some of the test strings as makes sense and include test strings to showcase the full current behaviour.

ACKs for top commit:
  apoelstra:
    ACK b7f61e2 confirmed that diff exactly matches 2451. CI failure is unrelated.

Tree-SHA512: 075e8a7d368dd216f947954459f67812b248982b5e022ac158e1022d8adcb7ce603f63951385fb88c397a66305e1cb3a25c89fdf4726bddc1fa1e2d190950f41
@tcharding tcharding deleted the 04-11-allow-parsing-m branch April 24, 2024 22:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

port-0.32.x Needs porting to 0.32.x branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants