Open afeezaziz opened 8 months ago
The time we added support for Taproot, BitcoinJS (which we fork from) didnt yet agreed on a payments.p2tr
interface, so you have to generate it low-level so to speak.
This is an example of how to build a Taproot address with https://github.com/vulpemventures/liquidjs-lib/blob/master/test/integration/taproot.spec.ts#L38-L73
The key-path spend is simply passing a public key as the first argument of bip341.taprootOutputScript
and the taproot tree as second.
You can then get the taproot address from the script passing the network object
const unconfidentialAddress = address.fromOutputScript(
output,
networks.regtest,
);
const confidentialAddress = address.toConfidential(
unconfidentialAddress,
bob.publicKey,
);
Let me know if it's enough, I keep it open in case, will close later
It seems that this library can support taproot receiving address, can there be example on how to generate a P2TR receiving address using this library?