Name it a pay-to-public-key-script-hash (P2PKSH), like so:
- Locking script:
OP_HASH160 OP_DATA_20 redeem_script OP_EQUAL
- Redeem script:
OP_DATA_20 pubkey OP_CHECKSIG
- Unlocking script:
<push signature> <push redeem_script>
.
Both method, wallets must course of an inventory of keys and compute a 20-byte hash and tackle corresponding to every key, however tackle era could be barely completely different.
Complete dimension of prevout + enter could be the identical in both case:
- P2PKH tackle (25 bytes):
0x76a914 || hash160(pubkey) || 0x88ac
- P2PKSH tackle (23 bytes):
0xa914 || hash160(0x21 || pubkey || 0xac) || 0x87
Spending enter script would even be barely completely different:
- P2PKH spend (66 + 34 bytes):
<push signature> <push pubkey>
- P2PKSH spend (66 + 36 bytes):
<push signature> <push (0x21 || pubkey || 0xac)>
Word: ||
signifies byte concatenation.
Each would require assist by functions comparable to wallets, and each would have the identical transaction (enter+output) dimension.
The P2PKSH choice has some benefit in that it might make the tackle comparatively smaller and in that it might make all 20-byte outputs indistinguishable from one another.
It would not make sense to start out utilizing this type of tackle now, however there was a window of alternative within the interval 2012-2016 so I questioned. If Bitcoin had shipped with P2SH proper from the beginning, would we now have only one tackle sort?