script – Why wrapping P2PK inside P2SH did not catch on?

on

|

views

and

comments


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?

Share this
Tags

Must-read

US regulators open inquiry into Waymo self-driving automobile that struck youngster in California | Expertise

The US’s federal transportation regulator stated Thursday it had opened an investigation after a Waymo self-driving car struck a toddler close to an...

US robotaxis bear coaching for London’s quirks earlier than deliberate rollout this yr | London

American robotaxis as a consequence of be unleashed on London’s streets earlier than the tip of the yr have been quietly present process...

Nvidia CEO reveals new ‘reasoning’ AI tech for self-driving vehicles | Nvidia

The billionaire boss of the chipmaker Nvidia, Jensen Huang, has unveiled new AI know-how that he says will assist self-driving vehicles assume like...

Recent articles

More like this

LEAVE A REPLY

Please enter your comment!
Please enter your name here