Compute the address for a taproot output with given inner key and scripts.
(pubkey, scripts)
| 168 | return (None, CScript([bytes.fromhex(hex_key), OP_CHECKSIG])) |
| 169 | |
| 170 | def compute_taproot_address(pubkey, scripts): |
| 171 | """Compute the address for a taproot output with given inner key and scripts.""" |
| 172 | tap = taproot_construct(pubkey, scripts) |
| 173 | assert tap.scriptPubKey[0] == OP_1 |
| 174 | assert tap.scriptPubKey[1] == 0x20 |
| 175 | return encode_segwit_address("ert", 1, tap.scriptPubKey[2:]) |
| 176 | |
| 177 | class WalletTaprootTest(BitcoinTestFramework): |
| 178 | """Test generation and spending of P2TR address outputs.""" |
no test coverage detected