Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: bitaps on July 03, 2018, 09:13:27 PM



Title: P2PUBKEY in witness program
Post by: bitaps on July 03, 2018, 09:13:27 PM
Old standard transactions format included 3 types: P2PUBKEY, P2PKH, P2SH. After Segwit soft fork, we have got 2 additional types: P2WPKH and P2WSH.

If we compare cost of spending inputs (in bytes we write on HDD) for   P2PUBKEY, P2PKH and P2WPKH and  we got next values:
  • P2PUBKEY  33 bytes public key(we do not consider uncompressed keys)  + signature 72 bytes = 105 bytes
  • P2PKH        20 bytes public key hash + 33 bytes public key + 72 bytes signature = 125 bytes
  • P2WPKH     20 bytes public key hash + 33 bytes public key + 72 bytes signature = 125 bytes

From this comparison we can conclude that P2PUBKEY the best for reduce blockchain size. We can save about 19% of spending input size. I understand that P2PKH give more
security in case we do not reuse address. In case we reuse address there are no advantages use P2PKH. We can observe quite frequent use of addresses repeatedly. For a certain range of tasks we not need extra security like P2PKH. Why in Segwit transaction types we don't have ability to use P2WPUBKEY as standard transaction?  This type of transaction help to reduce blockchain size in case user do not need/want use "no address reuse" security model? 20 bytes for each input this is good opportunity to save the size of blockchain.

Also I read this thread https://bitcointalk.org/index.php?topic=6430.0, what is the reason why bitcoin core developers do not want use public key recovery and save 33 bytes for each input?  If the concerns are related to performance, we can observe how the ethereum works and reaches about 1M tx per day (this is like 1M inputs per day in Bitcoin).


Title: Re: P2PUBKEY in witness program
Post by: RGBKey on July 04, 2018, 12:43:06 AM
The way I see it, when you start enabling people to "turn off" privacy features like not reusing addresses, you also weaken the privacy of the people who still value their privacy and do not reuse addresses. Because when you start reusing addresses frequently, the amount of unique addresses shrinks and it's easier to tie together transactions.

I could be wrong, but that's my understanding of it.