const psbtData = bitcoin.Psbt.fromBase64('cHNidP8BAP0zAQIAAAACe6hpGYbsE3F7nF5M5sPIj63hB+/Gk6OX365hkOlzWbEFAAAAAP////+MKZJFhWtwxzSpGnelRzB3q5D533ymThr75ko15gR+DAIAAAAA/////wYQJwAAAAAAABYAFBDmp2yebwctpktA/wnQFed0rNPoIgIAAAAAAAAiUSCe9a8LWuYH0DuOroeU42lXZihRkaPfY+MOpiQ7pvNeZyICAAAAAAAAFgAUEOanbJ5vBy2mS0D/CdAV53Ss0+gAAAAAAAAAABtqXRgAxp2sATKXve/8ywEBAAC2oMfDrqjmCQIiAgAAAAAAABYAFJ61NjgWMz/tfd9RG+jnPL+QqC/n4OQOAAAAAAAiUSAJlh2k2v6/FWVALlQfWILFJF3Bnv+MZr2QwLrZGlgcGQAAAAAAAQErkhMPAAAAAAAiUSCe9a8LWuYH0DuOroeU42lXZihRkaPfY+MOpiQ7pvNeZwEDBIEAAAABFyDC0FkGA1Hx240xdRZ6pmmIJPJy9y+75j4whodc+MBP3QABAR8iAgAAAAAAABYAFBDmp2yebwctpktA/wnQFed0rNPoAQMEgQAAAAAAAAAAAAA=');
const network = bitcoin.networks.testnet;
const keyPair = ECPair.fromPrivateKey(Buffer.from('01da42c71e332f13aea72eef9c947ded5fc022124049f62e7d99656dd67176b7', 'hex'), { network: network });
const tweakedChildNode1 = child.tweak(
bitcoin.crypto.taggedHash("TapTweak", internalPubkey)
);
psbtData.signInput(0, tweakedChildNode1,0);
psbtData.finalizeAllInputs();
const signedTx = psbtData.extractTransaction().toHex();
console.log("Signed Transaction:", signedTx);
This is my code, but I'm getting signature errors all the time. Any idea what might be wrong when trying to sign taroot's psbt data?
Signing taroot's psbt data with bitcoinjs
2 replies 437 views
Thanks, it's solved
If your username represents your actual email address, it will be target of many spam PMs include scam, phishing emails. You did choose a bad username that breaks your privacy and security of not only that email but also many accounts related to that email address.
Forum account: security, privacy, and recovery