The steps to convert a private key to a SegWit (version 0, bech32) address are roughly as follows:
1. public_key = Generator * private_key (use the compressed version)
2. public_key_hash = RIPEMD160(SHA256(public_key)))
3. bech32_encode
For taproot address (version 2 witness), is the tweak mandatory or optional? Are the following calculations correct? (No tweak):
Suppose the private key is 1
1. The corresponding 32-byte compressed key (x-only, without oddness indicator): 79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798
2. Directly encode the above 32 bytes using the new modified bech32m encoding, and witness version 1:
bech32m_encode(hrp='bc', witness_version=1, bytes.fromhex('79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798'))
result: bc1p0xlxvlhemja6c4dqv22uapctqupfhlxm9h8z3k2e72q4k9hcz7vqzk5jj0
Also, what the point of adding a tweak step? It doesn’t seem to improve any security by adding a number to privkey. Thanks.