I've taken this example from a p2pkh guide:
This is broken down into:
19 - byte length of the following unlocking script 76 - OP_DUP: Duplicates the top stack item. a9 - OP_HASH160: The input is hashed twice: first with SHA-256 and then with RIPEMD-160. 14 - (20 bytes) length of the following public key hash 5fb0e9755a3424efd2ba0587d20b1e98ee29814a - public key hash of funds receiver 88 - OP_EQUALVERIFY: Returns 1 if the inputs are exactly equal, 0 otherwise. Then runs OP_VERIFY which fails and marks the transaction as invalid of the top stack value is false ac - OP_CHECKSIG: The entire transaction's outputs, inputs, and script are hashed. The signature used by OP_CHECKSIG must be a valid signature for this hash and public key. If it is, 1 is returned, 0 otherwise
How does Bitcoin determine that
0x14 is the length of the following public key hash, rather than interpreting this byte as an
opcode with the value
0x14 (20 decimal)? Is
0x14 special and will never be assigned to any opcode? I don't see any special handling of this value in the
GetScriptOp() routines here.
Is there a magic marker to detect P2PKH scripts?