4

If I send bitcoins to an output whose script will execute 0 OP_CHECKSEQUENCEVERIFY when it is spent, does that require the spender to set the BIP125 signal indicating that the transaction is replacable?

For example, in cases where participants in a contract protocol (like Lightning Network) wanted to ensure a transaction would signal it was replacable, could adding 0 OP_CSV to all script branches provide that guarantee of replacability?

Additionally, would 0 OP_CSV impose any additional requirements on the transaction executing that operation beyond it needing to signal replacability and having a transaction version number greater than 1?

David A. Harding
  • 11,626
  • 2
  • 44
  • 71

1 Answers1

3

Yes, since the OP_CSV requires setting a non-maximal nSequence in the spending input, an input spending it is forced to signal replaceability.

Ruben Somsen mentions that he used this construction in his Spacechains Proof of Concept and explains that it indeed enforces use of RBF (and permits the UTXO to be spent within the same block).

He points out that with the anyone can spend construction he was using, this would leave a 0 on the stack, which would fail the script evaluation. He worked around this issue by adding an OP_1ADD to the script. Ruben suggests that this outcome is why Miniscript disallows timelocks of 0.

Source: Tweet by Ruben Somsen

Murch
  • 71,155
  • 33
  • 180
  • 600