I'm running through raw transaction data, and I'd like to be able to gather addresses (where possible).
So far, I've made this diagram to help me understand when it's possible to figure out addresses from the scriptPubKey
of each output:
However, as you can see, I'm not sure how I can work out an address from a P2WSH.
Is it possible to get addresses from the scriptPubKey
alone, or can I only get them when the witness is revealed when the output has been spent? (as shown here):
witness: 0 <signature1> <1 <pubkey1> <pubkey2> 2 CHECKMULTISIG>
scriptSig: (empty)
scriptPubKey: 0 <32-byte-hash>
(0x0020{32-byte-hash})
EDIT: Also, please let me know if you notice that any of my pattern matching in this diagram is incorrect (or if I'm missing any patterns that allow me to find out more addresses).
base58('00' + hash160 + checksum)