1

i tried making a relative timelocked transaction with 1 block timelock (spendable after 1 confirmation)

funding tx: 0fda5412da2a2615361914fad007aac73154746108d44c04529e78f6c4424655

address: tb1qkrz7wne7p05fkgpzk8w9w8pzqswp85zcwcckr4s2z02qr03ksp6qmfduak

script:

$ bitcoin-cli -testnet decodescript 21020a14f343fa6b145921de84ff593e16007dcceba46550e2175e86cc14a8cf40cbad51b2
{
  "asm": "020a14f343fa6b145921de84ff593e16007dcceba46550e2175e86cc14a8cf40cb OP_CHECKSIGVERIFY 1 OP_CHECKSEQUENCEVERIFY",
  "type": "nonstandard",
  "p2sh": "2NFQbJj3QRhDXEa1TVoA92q5Ssygv7i4kK3",
  "segwit": {
    "asm": "0 b0c5e74f3e0be89b2022b1dc571c22041c13d058763161d60a13d401be368074",
    "hex": "0020b0c5e74f3e0be89b2022b1dc571c22041c13d058763161d60a13d401be368074",
    "address": "tb1qkrz7wne7p05fkgpzk8w9w8pzqswp85zcwcckr4s2z02qr03ksp6qmfduak",
    "type": "witness_v0_scripthash",
    "p2sh-segwit": "2N8xFW1ta5EhgMtsqRx32DCGwbUrey4rwvN"
  }
}

spending tx but it gives an error

01000000000101554642c4f6789e52044cd40861745431c7aa07d0fa14193615262ada1254da0f0000000000010000000179030000000000001600140aa46507f4b5c291f40224a8cb62cca18222d56d0247304402203216b9f5518ae00a8d8d16bf7c73376cc77c1f81bece6c3f4daac7f906e7030102201961be0b1464d3637e566765a37da6885e94b91155dbba4373d269840b4125f4012521020a14f343fa6b145921de84ff593e16007dcceba46550e2175e86cc14a8cf40cbad51b200000000

my first try also failed with the same error, it was a relative locktime of 5 blocks

address: tb1qmsws55wqcg6glcrk9urnjqfw0mpqp6uralha5y99wf8pvnh3sqjs8cm92l

script:

$ bitcoin-cli -testnet decodescript 21020a14f343fa6b145921de84ff593e16007dcceba46550e2175e86cc14a8cf40cbad55b2
{
  "asm": "020a14f343fa6b145921de84ff593e16007dcceba46550e2175e86cc14a8cf40cb OP_CHECKSIGVERIFY 5 OP_CHECKSEQUENCEVERIFY",
  "type": "nonstandard",
  "p2sh": "2MuimPJ2k6SArD9aCchJDdWbVHeyR2cBoUo",
  "segwit": {
    "asm": "0 dc1d0a51c0c2348fe0762f0739012e7ec200eb83efefda10a5724e164ef18025",
    "hex": "0020dc1d0a51c0c2348fe0762f0739012e7ec200eb83efefda10a5724e164ef18025",
    "address": "tb1qmsws55wqcg6glcrk9urnjqfw0mpqp6uralha5y99wf8pvnh3sqjs8cm92l",
    "type": "witness_v0_scripthash",
    "p2sh-segwit": "2N1iz6k1KgHRsYNWT64HF2fcCQduJ22DYfH"
  }
}

tx:

0100000000010171ea228f6f77c4a4fc427ca35cb09889d61673671d7321c07a2ceb5b653d62d90000000000010000000179030000000000001600140aa46507f4b5c291f40224a8cb62cca18222d56d02483045022100f33f68f8b67ab722ea82a125287bfd3d9cfd920df8a41d6286790e4fe65afe770220780cbc8b3b8d44fcc08237e7133c86d1a73b2d55cd3dadc0d850416fdd7e0164012521020a14f343fa6b145921de84ff593e16007dcceba46550e2175e86cc14a8cf40cbad55b200000000

error:

(-26)  non-mandatory-script-verify-flag (Locktime requirement not satisfied)

1 Answer 1

2

OP_CHECKSEQUENCEVERIFY is only available for transactions with their version number set to 2. Your transactions have a version number of 1, and so they fail.

1
  • thanks, after setting the version to 2 and signing them again they both went through.
    – Antoni
    Jan 26, 2022 at 19:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.