What does OP_CHECKSEQUENCEVERIFY (OP_CSV) do?

10

3

Some people have suggested repurposing OP_NOP3 as a new opcode, OP_CHECKSEQUENCEVERIFY.

What would the new opcode do? Why is it useful? Can't the signer choose the sequence field when they sign?

Nick ODell

Posted 2015-07-28T06:50:43.137

Reputation: 26 536

Answers

6

OP_CHECKSEQUENCEVERIFY (a.k.a OP_RELATIVECHECKLOCKTIMEVERIFY) can do Relative lock times (used for sidechains and lightning).

It basically checks, if a inputs sequence number is smaller then the sequence threshold (1 << 31 = 2147483648), and if, it will compare the nLockTime against the sequence number of the input.

More info:

Jonas Schnelli

Posted 2015-07-28T06:50:43.137

Reputation: 5 465

OP_CSV (BIP112) only constrains the nSequence value. The comparison of nSequence against time happens independently of OP_CSV's usage (BIP68).Pieter Wuille 2016-02-08T02:41:31.467