MCPcopy Create free account
hub / github.com/ElementsProject/elements / compute_taproot_address

Function compute_taproot_address

test/functional/wallet_taproot.py:170–175  ·  view source on GitHub ↗

Compute the address for a taproot output with given inner key and scripts.

(pubkey, scripts)

Source from the content-addressed store, hash-verified

168 return (None, CScript([bytes.fromhex(hex_key), OP_CHECKSIG]))
169
170def 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
177class WalletTaprootTest(BitcoinTestFramework):
178 """Test generation and spending of P2TR address outputs."""

Callers 1

make_addrMethod · 0.85

Calls 2

taproot_constructFunction · 0.90
encode_segwit_addressFunction · 0.90

Tested by

no test coverage detected