bitcoin-dev

Making OP_TRUE standard?

Making OP_TRUE standard?

Original Postby ZmnSCPxj

Posted on: May 10, 2018 03:07 UTC

A low value OP_TRUE-only script was identified as an example of where the weight doesn't reflect the true cost, causing it to use a UTXO forever while only costing a weight of 4.

Johnson's idea is to have a template, such as OP_2-only, that when combined with a 0-value is always valid only if spent in the same block. On the Lightning side, two commitment transaction options were proposed to address this issue. The first option involves using the minimum feerate but always having the above OP_TRUE output, which requires more blockchain space for unilateral closes. The second option stores two versions of a commitment transaction: one with a negotiated feerate without the OP_TRUE output and another with a slightly increased feerate and an OP_TRUE output. At unilateral close, the version with a negotiated feerate is used if possible, but if not, the other version is RBF'd with a higher feerate and CPFP'd on top. There are no legitimate reasons for having multiple dummy outputs.