Get the public key hash by computing OP_HASH160 of public key
In this example:
- public key: 033e8c5dcb8e35670de496b57c1fa4366800ce3be5fded9b8800759881bc8da2e5
- public key hash: 60d47ac02b129c08f94232ea506d1826424fe7be
> export PUB_KEY_HASH=60d47ac02b129c08f94232ea506d1826424fe7be
OP_DUP OP_HASH160 <pubKeyHash> OP_EQUALVERIFY OP_CHECKSIG
OP_DUP | OP_HASH160 | bytes to push | pubKeyHash | OP_EQUALVERIFY | OP_CHECKSIG |
---|---|---|---|---|---|
76 | a9 | 14 | 60d47a... | 88 | ac |
> echo 76a914${PUB_KEY_HASH}88ac
76a91460d47ac02b129c08f94232ea506d1826424fe7be88ac
In bitcoin-qt debug console
> decodescript 76a91460d47ac02b129c08f94232ea506d1826424fe7be88ac
{
"asm": "OP_DUP OP_HASH160 60d47ac02b129c08f94232ea506d1826424fe7be OP_EQUALVERIFY OP_CHECKSIG",
...
}