paulmillr / scure-btc-signer

Audited & minimal library for creating, signing & decoding Bitcoin transactions.
https://paulmillr.com/noble/#scure
MIT License
151 stars 39 forks source link

P2TR: invalid leaf script=tr #22

Closed mahnunchik closed 1 year ago

mahnunchik commented 1 year ago

I have faced with the following error while running examples from the readme: Error: P2TR: invalid leaf script=tr

https://github.com/paulmillr/scure-btc-signer/blob/26216a976c767ec66a7d75afc1ef1881b48d3c69/README.md?plain=1#L283-L293

I'm not sure:

mahnunchik commented 1 year ago

One more potential mistype in the readme. According to the latest sources: https://github.com/paulmillr/scure-btc-signer/blob/26216a976c767ec66a7d75afc1ef1881b48d3c69/index.ts#L1222

There is should not be tapMerkleRoot key: https://github.com/paulmillr/scure-btc-signer/blob/26216a976c767ec66a7d75afc1ef1881b48d3c69/README.md?plain=1#L280

mahnunchik commented 1 year ago

I think the readme should be updated because there is another not existent function tr():

https://github.com/paulmillr/scure-btc-signer/blob/26216a976c767ec66a7d75afc1ef1881b48d3c69/README.md?plain=1#L373

paulmillr commented 1 year ago

fixed: updated readme

mahnunchik commented 1 year ago

@paulmillr thank you for the quick fix.

P2TR-NS, P2TR-MS, and P2TR-PK should be fixed the same way to work.