Published on: 2013-07-14T19:40:21+00:00
In a mailing list conversation, Pieter Wuille and John Dillon discussed the potential benefits of using P2SH (Pay-to-Script-Hash) with an inner OP_CHECKSIG for most addresses in the long term. This implementation would save 1 byte. They suggest starting with change addresses, and they mention that bitcoinj support will assist sites like satoshidice in paying to P2SH change addresses.When it comes to multisig's P2SH overhead, the percentages for a 1-of-2, 2-of-2, and 3-of-3 are 10%, 8.6%, and 6.2% respectively. These figures are considered minor, especially if the blocksize limit is expected to be raised. However, Pieter Wuille points out that the current implementation in the reference client uses a custom script encoder for the UTXO (Unspent Transaction Output) database. This means that for "standard" address payments, there is no storage impact when using P2SH instead.The author of the message offers a reward of 1BTC for creating a patch to change IsStandard() code. The goal is to make it accept only P2SH and pubkeyhash in a raw scriptSig, allowing other forms only when used with P2SH. The issue with the current code is that it accepts up to 120 bytes of junk data as a pubkey, which allows for the injection of 240 bytes of spendable data into the UTXO set with bare OP_CHECKMULTISIG. The author emphasizes the importance of keeping the size of the UTXO set small and mentions problems with distasteful data being added to it.Gregory Maxwell proposes P2SH as an excellent solution to the problem of distasteful data, and Peter Todd explains how it can be implemented using the existing P2SH form. They plan to introduce some form of OP_RETURN soon, which will handle timestamping and similar use-cases without impacting the UTXO set. Currently, the only scriptPubKey form with significant use is checksighash, while bare pubkey is used by some miners and Deepbit due to their outdated codebase. However, this is expected to change as hardware wallets and the payment protocol become more prevalent. It is important to ensure that these protocols utilize P2SH before getting locked into multiple OP_CHECKMULTISIG implementations.Pieter Todd's timestamper currently uses OP_CHECKMULTISIG, but it can be easily changed to OP_RETURN. The implementation of P2SH can begin with change addresses, and bitcoinj support will assist sites like satoshidice in paying to P2SH change addresses. Ultimately, the overhead for multisig's P2SH (1-of-2, 2-of-2, and 3-of-3) is considered minor, especially if the blocksize limit is raised.
Updated on: 2023-08-01T05:17:28.270249+00:00