Custom script = nonstandard

P2SH custom script = standard

Why don't we set non-p2sh custom scripts standard too? Forcing P2SH requires adding hashes to the chain causing more bloating


To answer your question exactly: why were they made non-standard? Because originally (after a few vulnerabilities in the Script logic in 2010), all scripts were made non-standard except a few whitelisted ones. Since then, more and more groups of scripts have been added to that category (including almost all P2SH scripts, with a few exceptions).

Why have bare scripts (non-P2SH,non-segwit) not been made non-standard except for P2PK, P2PKH, and multisig up to 3 keys?

UTXO bloat.

Yes, P2SH implies slightly more blockchain space usage. But not using P2SH for potentially long scripts means those scripts have to enter the UTXO set, where they burden full nodes until spent. With P2SH, only the script hash enters the UTXO set.

In addition, there just isn't much use for non-P2SH scripts as there are no standardized way of sending to them. The ones that are permitted are due to historical usage.

  • 1
    Did you perhaps mean "on-chain data" or "slightly more blockspace used"? – Murch Feb 12 at 4:03

P2SH addresses already do allow custom scripts.

So I guess your question is why aren't custom scripts, that are not encoded as apart of a P2SH address, considered standard. They are not user-friendly -- they can be quite long, and the sender doesn't really need to know the full script, so it would be a lot of added complexity for no reason. There just aren't many common use cases for it, and edge cases are inherently not "standard".

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.