bcoin-org/bcoin

Bitcoin Taproot compatibility

razorman8669 opened this issue · 2 comments

Just wanted to start a thread/discussion about how bcoin will be affected by the taproot softfork this coming November 2021. Will P2TR outputs be recognized and handled appropriately
will taproot/Schnorr addresses be recognizable and spent to without error?

Hi Ray! The most important thing to have ready by Taproot activation is the ability to SEND to Taproot addresses, so if Purse customers are super excited about Taproot and have addresses ready to go on day one we can at least send them their BTC. The hard part is the full validation of all the new consensus rules. However, because Taproot is "just" a soft fork, it is (I'm cringing saying this but) kind of okay if bcoin is not fully validating by activation time.

Ok, so sending BTC to Taproot addresses: Taproot does introduce a new address type, bech32m. For bcoin this means an update to bcrypto, which I've already opened a PR for: bcoin-org/bcrypto#61 We also have two new bcoin contributors (courtesy of a sponsor we'll announce soon) and I've asked them to write a PR to implement the application-level usage of bech32m (specifically in address.js), so this should be ready in time.

As far as full validation, I have an old branch for Taproot: #948 and I'm going to spend the next few weeks updating that (the specification itself has changed a good deal since I first wrote this). Last week I used Bitcoin Core to generate test vectors for Taproot (https://github.com/pinheadmz/bitcoin/tree/taproottest-0.21.1) and that's the beginning of my returning to working on Taproot for bcoin ;-)

Once we have validation rules merged, we can start working on the real fun stuff which will be adding Taproot wallets to bcoin so bcoin users can take advantage of Schnorr and all other cool stuff.

If you or anyone at Purse (or anyone else you know!) wants to help, all this stuff is obviously going to need a ton of review. I'm happy to meet with anyone interested and just explain what Taproot is from soup to nuts and then talk about the code we need. Hit me up yo!

Looking for reviewers for this PR: #1038

This isnt full taproot validation, just bech32m support so bcoin can send BTC to Taproot addresses after activation.