Why does the time interval for OP_CSV need to be in the nSequence field when it is already in the script? BIP68 prescribes how to put the time interval into the nSequence field but then BIP112 tells you that it is possible to specify it in the script with a notation like &quot;30d&quot;.
Why are there two ways of doing the same thing? Are they both necessary, or is only one of the two necessary in the verification phase?
They do not serve the same function.
Putting a relative locktime in the nSequence value means &quot;this transaction cannot be mined until its input is at least that old&quot;.
Putting a relative locktime with OP_CSV in the script means &quot;Require that the transaction spending this sets an nSequence of at least this value&quot;.
The reason why they are split up is to make transaction validation independent of time. If the value passed to OP_CSV would be compared against the time directly, and it failed, there would be no way to distinguish whether the transaction is just outright invalid or it's due to a temporary locktime/nsequence constraint.
In other words: splitting them up allows us to see the spending transaction, verify it once, and know for certain that it's valid. We never need to evaluate it again, as this validity never changes; if it is valid once, it is valid always. The question of when it can be mined remains independent of this, and can easily be checked by just looking at the nSequence value and comparing it with the blockchain's time.