IsStandard [combined summary]



Individual post summaries: Click here to read the original discussion on the bitcoin-dev mailing list

Published on: 2019-05-03T09:51:25+00:00


Summary:

In a recent bitcoin-dev discussion, the standardness of bitcoin scripting was brought into question. Contributors discussed whether non-usual transactions would be relayed by nodes and how to determine what nodes will accept. It was agreed upon that any custom script can be wrapped in P2SH and P2WSH and it will be propagated. However, P2PKH and P2WPKH cannot have custom scripts. Once a claim on a modified x-of-3 is propagated, the redeemScript becomes known and someone can attempt to RBF with a modified witness stack or scriptSig to claim the UTXO. The standardness of Bitcoin Cash (BCH) transactions is still unclear. SHA bounties were also discussed, which can be propagated if they are wrapped in P2SH or P2WSH. However, the redeemScript must be published by the creator or bribed a miner if the transaction is not time-sensitive.Pieter clarified that all spends of P2SH/P2WSH are standard, except for non-push operations in the scriptSig, resource limitations, protections against known attack vectors, and usage of unconditionally spendable constructions intended for future extensions. He also confirmed that redeem scripts for the sha bounties are in op_return.James Prestwich provided a reference for default TX_NONSTANDARD policies in v0.18, but noted that documenting standardness is challenging as it varies from version to version. His reference only applied to v0.18 and may already be outdated.The conversation highlighted that P2PKH, P2WPKH, P2SH, and P2WSH are recognized as templates by most current nodes and are expected to be propagated by a majority of nodes. Any custom script can be wrapped in P2SH and P2WSH and will be propagated, as these templates hide the details of the custom script. However, filtering based on the custom script is not possible. For BCH, it was noted that P2PKH and P2WPKH cannot have custom scripts, but the standardness of other transactions remains unclear.ZmnSCPxj explained that nodes can have any policy for propagating transactions, but transactions that do not pay out to P2PKH, P2WPKH, P2SH, or P2WSH are unlikely to be propagated by most nodes. However, coordination with miners is still possible to get these non-standard transactions mined. The standardness of Bitcoin transactions and scripts is not described in a single document and may change over time or across different implementations.Luke Dashjr emphasized that IsStandard, which implements a node's policy, should not be given much attention when defining new standards. Instead, he recommended focusing on documenting actual standards rather than IsStandard beyond the code.In conclusion, the standardness of Bitcoin transactions varies from version to version and across different implementations. P2PKH, P2WPKH, P2SH, and P2WSH are generally recognized as standard templates, but anything that does not fit into these templates is less likely to be propagated by nodes. However, coordination with miners can still allow non-standard transactions to be mined. It is important to document actual standards rather than relying solely on IsStandard function in the code.


Updated on: 2023-08-02T00:45:44.650088+00:00