<p>Solved with this answer and by looking how bitcoin core does it:</p>
<p><a href="https://bitcoin.stackexchange.com/a/89010/123917">https://bitcoin.stackexchange.com/a/89010/123917</a></p>

CC BY-SA 4.0
2022-03-24T09:32:33.680Z
2022-03-24T09:32:33.680Z
ByteFlowr
<p>In a Tapscript Keypath Transaction <em>(there is an unrelated Scriptpath too)</em> I can have outputs to all possible address?</p>
<p>(I.e. to P2PKH, P2SH, P2WPKH / P2WSH and P2TR)</p>
<p>I have a list of addresses in all possible formats (including bech32(m)). How can I ensure / verify that the <code>scriptPubKey</code> is mappable to an address in this list?</p>
<p>The signing client has access to every part of transaction's construction.</p>

CC BY-SA 4.0
2022-03-23T20:10:18.567Z
I don't understand what you're trying to do.
Pieter Wuille
CC BY-SA 4.0
2022-03-23T20:35:25.450Z
Based off the taproot-workshop on Github I constructed this Transaction: `CTransaction(nVersion=1 vin=[CTxIn(prevout=COutPoint(hash=d66a46336b05c3f1550fd0983db887f4244570c06538cb05f68afed99d84ea71 n=0) scriptSig= nSequence=0)] vout=[CTxOut(nValue=0.49999000 scriptPubKey=0014a9d0682aaa00c327dbb3fd32c9dedcfcfbec1a69)] wit=CTxWitness() nLockTime=0)` I want `scriptPubKey` to be matchable against wallet addresses in various formats
ByteFlowr
<address><public-key><taproot><bech32-address><p2tr>
Keypath spending: Verify destination address across address formats
ByteFlowr
# Keypath spending: Verify destination address across address formats

(Asked by: username_0 on 2022-03-23)

In a Tapscript Keypath Transaction *(there is an unrelated Scriptpath too)* I can have outputs to all possible address?

(I.e. to P2PKH, P2SH, P2WPKH / P2WSH and P2TR)

I have a list of addresses in all possible formats (including bech32(m)). How can I ensure / verify that the `scriptPubKey` is mappable to an address in this list?

The signing client has access to every part of transaction's construction.

**Tags:** address, public-key, taproot, bech32-address, p2tr

> **Comments:**
> **username_1**: I don't understand what you're trying to do.  
> **username_0**: Based off the taproot-workshop on Github I constructed this Transaction: `CTransaction(nVersion=1 vin=[CTxIn(prevout=COutPoint(hash=d66a46336b05c3f1550fd0983db887f4244570c06538cb05f68afed99d84ea71 n=0) scriptSig= nSequence=0)] vout=[CTxOut(nValue=0.49999000 scriptPubKey=0014a9d0682aaa00c327dbb3fd32c9dedcfcfbec1a69)] wit=CTxWitness() nLockTime=0)` I want `scriptPubKey` to be matchable against wallet addresses in various formats  

---

## 1 answers

### Answer by username_0 on 2022-03-24. Score: 0

Solved with this answer and by looking how bitcoin core does it:

<https://bitcoin.stackexchange.com/a/89010/123917>


---

