dgarage / NBXplorer

NBitcoin Explorer
MIT License
320 stars 212 forks source link

How to use TaprootDerivationStrategy #444

Closed bitcoinbrisbane closed 12 months ago

bitcoinbrisbane commented 12 months ago

I keep getting invalid base58 issues because of the [taproot] flag in my expubkey.

                BitcoinExtPubKey root = new BitcoinExtPubKey(_exPubKey, Network);
                this.ExPub = new TaprootDerivationStrategy(root);

Where _exPubKey = tpubDF2xZjR3QU4hmS4iqAHx4MirMtoUrh1Np1X6KRYWBK6uSBAcxbjNWoaqHJQmjtUpduYMCbUMK9m1HCCh2Jtr85GUdHMgKp2NYPniwaDjhWp-[taproot]

https://github.com/dgarage/NBXplorer/blob/master/NBXplorer.Client/DerivationStrategy/TaprootDerivationStrategy.cs

bitcoinbrisbane commented 12 months ago

Actually, might be an Nbitcoin issue (or me know knowing how to do it) https://github.com/MetacoSA/NBitcoin/blob/5c8c6f8fb042b933fa7c749179dcd5716b207346/NBitcoin/Network.cs#L2717C15-L2717C15

bitcoinbrisbane commented 12 months ago

Yay i figured it out! This guy casts https://github.com/dgarage/NBXplorer/blob/master/NBXplorer.Client/DerivationStrategy/TaprootDerivationStrategy.cs#L43

So just drop the [taproot]