Closed radicleart closed 4 months ago
Not the same.
const script = btc.p2tr(xOnlyPubKey, undefined, net) script.address
By default, p2tr uses the tweaked public key to generate the address.
const addr = btc.Address(net).encode({type: 'tr', pubkey: xOnlyPubKey})
And here you use xOnlyPubKey AS the tweaked public key to generate the address.
You should tweak the xOnlyPubKey first to generate the same address:
const addr = btc.Address(net).encode({type: 'tr', pubkey:btc.taprootTweakPubkey(xOnlyPubKey, new Uint8Array())[0]})
Hey there,
wondering why these two methods yield different bech32m addresses?
this test fails but we expected it to pass - how are the two different addresses connected ?