Dear all,
I am currently studying the OP_CHECKSEQUENCEVERIFY (OP_CSV) opcode and trying to create transactions manually. I have this construction
OP_IF
2 [PUBKEY A] [PUBKEY B] 2 OP_CHECKMULTISIG
OP_ELSE
[CSV VALUE] OP_NOP3 OP_DROP
OP_DUP OP_HASH160 [PUBKEYHASH B] OP_EQUALVERIFY OP_CHECKSIG
OP_ENDIF
So far I have succeeded redeeming the P2SH tx above through the multisignature (the OP_IF.. block). But I have problems when redeeming the transaction through the OP_ELSE.. OP_ENDIF block which is when the OP_CSV is evaluated. I have set the [CSV VALUE] to 0x0a in hexadecimal (or 10 in decimal).
My current effort was to set the nSequence and the nLockTime variables to be more than the CSV value. I have created a raw tx to redeem the OP_CSV as follows
01000000010c3e18ff26e98ba39381c84d2fb9e8e198e63d0b3697f9bd57f63577c96da23f00000
000d5483045022100fc4f7bfa3c536e743b02af8b7de5d4052f43db54f59692478b25c585b9df21
1a02203cfcfc0ed618fae6aa49b11e803ec4e5654551fb52fe2d026929f4a307fe2ef0012103d7c
6052544bc42eb2bc0d27c884016adb933f15576a1a2d21cd4dd0f2de0c37d004c67635221025e37
e03703f001de34123b513beaf0e4044a2dd39a1dd92ec1706f184920031a2103d7c6052544bc42e
b2bc0d27c884016adb933f15576a1a2d21cd4dd0f2de0c37d52ae67010ab27576a914937fe2ee82
229d282edec2606c70e755875334c088ac680f0000000130750000000000001976a914937fe2ee8
2229d282edec2606c70e755875334c088ac0f000000
In the raw tx, I have set the nSequence to 15 and nLockTime to 15 (I know this is not a good idea, but I'm desperate).
The raw tx itself was rejected in many pushtx services, except the blockcypher, although it has not been confirmed to the blockchain.
https://live.blockcypher.com/btc/tx/bcfbb172403ba73643ae02d40cac1332b75173d9726917dd8263a15ce365c012/Please let me know if you have any suggestions. Thank you.