Post
Topic
Board Project Development
Re: Javascript Taproot Address Generator for Browser
by
pooya87
on 26/08/2023, 10:45:59 UTC
I have another doubt in the hands, after google and ChatGPt the doubt subsist, is there any hashed Taproot address that protects the public key identity until 1st transaction be done as in Legacy and Segwit addresses or every Taproot address simple or with tweak never protect the public key identity ?
All Taproot addresses are always encoding a 32 byte data called the "witness program" that is always an x-only public key whether it is a single pubkey address like I explained above or if it is using the script spending route with a TapScript.
To put simply there no longer is hashing involved like P2PKH, P2WPKH, etc addresses.

Somebody have a nodejs script working that creates tweaked taproot addresses with "dummy" script that could share here?
Here is a NodeJS implementation of both bech32 and bech32m: https://github.com/sipa/bech32/tree/master/ref/javascript
You can test it with the following test vectors: https://github.com/bitcoin/bips/blob/master/bip-0341/wallet-test-vectors.json

An older version of the script can be installed with npm: https://www.npmjs.com/package/bech32
That's only the encoding part though. It doesn't have the code to Tweak public keys to create the address.