Skip to content

Commit

Permalink
parser: Support WIF with BIP32 origin
Browse files Browse the repository at this point in the history
This uncovered a bug in rust-miniscript causing the origin information
to be lost, so it will not actually work until the fix is merged:
rust-bitcoin/rust-miniscript#753
  • Loading branch information
shesek committed Oct 17, 2024
1 parent d1bb206 commit cf7f2c4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/parser/grammar.lalrpop
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ match {
r"(\[[a-fA-F0-9]{8}(/\d+['h]?)*\])?[xt]pub[0-9a-zA-Z]{100,120}" => XPUB,
r"(\[[a-fA-F0-9]{8}(/\d+['h]?)*\])?[xt]prv[0-9a-zA-Z]{100,120}" => XPRV,
r"\[[a-fA-F0-9]{8}(/\d+['h]?)*\]([a-fA-F0-9]{64}|[a-fA-F0-9]{66})" => SINGLE_PK_ORIG, // single pubkey with BIP32 origin
r"[KLc][1-9A-HJ-NP-Za-km-z]{51}|[59][1-9A-HJ-NP-Za-km-z]{50}" => WIF,
r"(\[[a-fA-F0-9]{8}(/\d+['h]?)*\])?([KLc][1-9A-HJ-NP-Za-km-z]{51}|[59][1-9A-HJ-NP-Za-km-z]{50})" => WIF,
_,
}

Expand Down

0 comments on commit cf7f2c4

Please sign in to comment.