The description states:
A script hash is the hash of the binary bytes of the locking script (ScriptPubKey), expressed as a hexadecimal string. The hash function to use is given by the “hash_function” member of server.features() (currently sha256() only). Like for block and transaction hashes, when converting the big-endian binary hash to a hexadecimal string the least-significant byte appears first, and the most-significant byte last. For example, the legacy Bitcoin address from the genesis block: 1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa has P2PKH script: 76a91462e907b15cbf27d5425399ebf6f0fb50ebb88f1888ac with SHA256 hash: 6191c3b590bfcfa0475e877c302da1e323497acf3b42c08d8fa28e364edf018b which is sent to the server reversed as: 8b01df4e368ea28f8dc0423bcf7a4923e3a12d307c875e47a0cfbf90b5c39161 By subscribing to this hash you can find P2PKH payments to that address.
Can anybody explain what these numbers are:
and how to get them?
Using the bx command line tool, the Satoshi address:
looks like this decoded (using bx)
$ bx base58-decode 1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa
The first 2 digits (
00) is the version number, the last 8 digits (
c29b7d93) is the checksum. Leaving
62e907b15cbf27d5425399ebf6f0fb50ebb88f18 as your payload (pubkey in this instance).
Now if I were to make a basic P2PKH locking script with the above pubkey it would look like this:
dup hash160 [62e907b15cbf27d5425399ebf6f0fb50ebb88f18] equalverify checksig
and now encode it in base16:
bx script-encode "dup hash160 [62e907b15cbf27d5425399ebf6f0fb50ebb88f18] equalverify checksig"
bx sha256 76a91462e907b15cbf27d5425399ebf6f0fb50ebb88f1888ac
result is your number:
The second number,
is serialized in the little-endian (least-significant-byte-first) order. As stated in the link:
When transactions are transmitted over the network or exchanged between applications, they are serialized. Serialization is the process of converting the internal representation of a data structure into a format that can be transmitted one byte at a time, also known as a byte stream. Serialization is most commonly used for encoding data structures for transmission over a network or for storage in a file.
so they're the same number, except byte by byte backwards (I exploded the last 3 bytes of the first to make it apparent).
6191c3b590bfcfa0475e877c302da1e323497acf3b42c08d8fa28e364e df 01 8b 8b 01 df ...