<p>i manage to find answer for myself.</p>

<p>OP_CSV date consensus is based on median time past (mtp), not block's confirmed date.</p>

<p>once funding tx above has been confirmed, it is located in block#1609592 with block MTP is 2019-11-24 09:05:26 (UTC 0). At same time, chain's MTP is 2019-11-24 09:25:27 (UTC 0)</p>

<p>now come to spending tx, since utxo's confirmed date i used is 2019-11-24 09:05:26, plus 512 seconds = 2019-11-24 09:13:58. Therefore i can spend immediately as chain's MTP is more than 2019-11-24 09:13:58.</p>

CC BY-SA 4.0
2019-11-25T07:26:02.250Z
2019-11-25T07:26:02.250Z
Atlas Chiew
<p>i have trouble in using op_csv. The spending condition is not match to my expectation.</p>

<p><strong>FUNDING</strong></p>

<p>Redeem Script Hex: 03010040b27576a91451d2a5e04d25ceaa86e600a6ec34bd24431c675d88ac
Redeem Script Asm: 03&lt;010040> OP_CHECKSEQUENCEVERIFY OP_DROP OP_DUP OP_HASH160 14&lt;51d2a5e04d25ceaa86e600a6ec34bd24431c675d> OP_EQUALVERIFY OP_CHECKSIG</p>

<p>P2SH base85 address: 2NFRizqW8XpNQm7nxYvFpYTvYsy3BqgsEx2 (bitcoin testnet3)</p>

<p>Based on my mentioned redeem script, i set time parameter as 1 along with OP_CHECKSEQUENCEVERIFY. Now my expectation is once blockchain confirms this TX, supposedly, miner will accept my spending TX after 512 seconds.</p>

<p>here is my funding tx
<a href="https://testnet.smartbit.com.au/tx/318462c4f6fef6e3c4fc58e8803c1ca43f20d162ca41d5c74f9e89725d8b300d" rel="nofollow noreferrer">https://testnet.smartbit.com.au/tx/318462c4f6fef6e3c4fc58e8803c1ca43f20d162ca41d5c74f9e89725d8b300d</a></p>

<p><strong>SPENDING</strong></p>

<p>02000000010d308b5d72899e4fc7d541ca62d1203fa41c3c80e858fcc4e3f6fef6c4628431000000008b483045022100f995ccfb8ce2bda36c4ec0f37f067ee6c87c58043155b3a583da201ffaaa4db50220794d23e402b3f0a9579ab9bb8fbb573eba8cffed27542c162b629aa0f914b10d01210292dbb331c39d84611fbaa8e225d781ec50c2ed21fbf311bfeb869042f4b3e1781f<strong>03010040</strong>b27576a91451d2a5e04d25ceaa86e600a6ec34bd24431c675d88ac0100400001d40c0600000000001976a91451d2a5e04d25ceaa86e600a6ec34bd24431c675d88ac00000000</p>

<p>i set this TX's version as 2 and input's nsequence as 03010040. Now, i am waiting for blockchain to confirm my funding tx. Not so long, my funding tx was confirmed with date 2019-11-24T10:46:05Z. Now, I expect that 2019-11-24T10:46:05Z + 512 seconds = 2019-11-24 10:54:37 is time miner will accept my spending tx. As the result once my funding TX has been confirmed then i can spend immediately without any relative time restriction. ANYONE know what is happening?</p>

<p>here is my spending tx
<a href="https://testnet.smartbit.com.au/tx/a68a821e06c1156d5fe80f3662c941142ed2ce1a57e597ce05bf167bce21fe2d" rel="nofollow noreferrer">https://testnet.smartbit.com.au/tx/a68a821e06c1156d5fe80f3662c941142ed2ce1a57e597ce05bf167bce21fe2d</a></p>

<p>P/S: i further test by changing time parameter in redeem script from 1 to 4 and 5, then the result is slightly match to my expectation.</p>

<transactions><sequence><checksequenceverify>
Problem using op_checksequenceverify (op_csv) with relative time flag
Atlas Chiew
# Problem using op_checksequenceverify (op_csv) with relative time flag

(Asked by: username_0 on 2019-11-24)

i have trouble in using op\_csv. The spending condition is not match to my expectation.

**FUNDING**

Redeem Script Hex: 03010040b27576a91451d2a5e04d25ceaa86e600a6ec34bd24431c675d88ac
Redeem Script Asm: 03<010040> OP\_CHECKSEQUENCEVERIFY OP\_DROP OP\_DUP OP\_HASH160 14<51d2a5e04d25ceaa86e600a6ec34bd24431c675d> OP\_EQUALVERIFY OP\_CHECKSIG

P2SH base85 address: 2NFRizqW8XpNQm7nxYvFpYTvYsy3BqgsEx2 (bitcoin testnet3)

Based on my mentioned redeem script, i set time parameter as 1 along with OP\_CHECKSEQUENCEVERIFY. Now my expectation is once blockchain confirms this TX, supposedly, miner will accept my spending TX after 512 seconds.

here is my funding tx
<https://testnet.smartbit.com.au/tx/318462c4f6fef6e3c4fc58e8803c1ca43f20d162ca41d5c74f9e89725d8b300d>

**SPENDING**

02000000010d308b5d72899e4fc7d541ca62d1203fa41c3c80e858fcc4e3f6fef6c4628431000000008b483045022100f995ccfb8ce2bda36c4ec0f37f067ee6c87c58043155b3a583da201ffaaa4db50220794d23e402b3f0a9579ab9bb8fbb573eba8cffed27542c162b629aa0f914b10d01210292dbb331c39d84611fbaa8e225d781ec50c2ed21fbf311bfeb869042f4b3e1781f**03010040**b27576a91451d2a5e04d25ceaa86e600a6ec34bd24431c675d88ac0100400001d40c0600000000001976a91451d2a5e04d25ceaa86e600a6ec34bd24431c675d88ac00000000

i set this TX's version as 2 and input's nsequence as 03010040. Now, i am waiting for blockchain to confirm my funding tx. Not so long, my funding tx was confirmed with date 2019-11-24T10:46:05Z. Now, I expect that 2019-11-24T10:46:05Z + 512 seconds = 2019-11-24 10:54:37 is time miner will accept my spending tx. As the result once my funding TX has been confirmed then i can spend immediately without any relative time restriction. ANYONE know what is happening?

here is my spending tx
<https://testnet.smartbit.com.au/tx/a68a821e06c1156d5fe80f3662c941142ed2ce1a57e597ce05bf167bce21fe2d>

P/S: i further test by changing time parameter in redeem script from 1 to 4 and 5, then the result is slightly match to my expectation.

**Tags:** transactions, sequence, checksequenceverify


---

## 1 answers

### Answer by username_0 on 2019-11-25. Score: 1

i manage to find answer for myself.

OP\_CSV date consensus is based on median time past (mtp), not block's confirmed date.

once funding tx above has been confirmed, it is located in block#1609592 with block MTP is 2019-11-24 09:05:26 (UTC 0). At same time, chain's MTP is 2019-11-24 09:25:27 (UTC 0)

now come to spending tx, since utxo's confirmed date i used is 2019-11-24 09:05:26, plus 512 seconds = 2019-11-24 09:13:58. Therefore i can spend immediately as chain's MTP is more than 2019-11-24 09:13:58.


---

