If after key data is OP_CHECKSIG then "digital signature must be provided that matches the public key hash" - keys started with "1..."
else if is only OP_EQUAL (or OP_EQUALVERIFY?) it is "script must be provided that fits the hash, as well as an input that evaluates to true"
- kwy started with "3.." ?
Pay-to-pubkey-hash (p2pkh) has a standard format. It is
OP_DUP OP_HASH160 <20 byte hash> OP_EQUALVERIFY OP_CHECKSIG
p2pkh outputs correspond to '1...' addresses.
Pay-to-script-hash (p2sh) also has a standard format. It is
OP_DUP <20 byte hash> OP_EQUAL
p2sh outputs correspond to '3...' addresses.
The 20 byte hash is not a key. It is the ripemd160 hash of the sha256 hash of a public key.