<p>Bitcoin Core does not support signing scripts with CLTV instructions.</p>

<p>It only supports:</p>

<ul>
<li>P2PK</li>
<li>P2PKH</li>
<li>k-of-n multisig</li>
<li>P2WSH wrapped versions of the above</li>
<li>P2WPKH</li>
<li>P2SH wrapped versions of the above</li>
</ul>

<p>If you want to sign anything else, you'll need to implement your own signing logic.</p>

<p>The error you're seeing is due to the spending transaction not having the <code>nLockTime</code> field set. In general, CLTV works indirectly:</p>

<ul>
<li>A CLTV output puts a requirement on the spending transaction to have an <code>nLockTime</code> field larger than the time specified by the CLTV instruction.</li>
<li>A transaction with a <code>nLockTime</code> field can only be confirmed when the blockchain time is after the value in that field (this is even the case when no CLTV is present).</li>
</ul>

<p>But regardless, even if you did have a correct <code>nLockTime</code> field, <code>signrawtransaction</code> would still not know how to sign for that script.</p>

CC BY-SA 4.0
2018-11-11T09:06:08.800Z
is there a reason for it? To prevent users losing funds or a protection measure for the end-user without detailed knowledge? I was wondering if there may be activities to allow more sophisticated use cases (following s.th. like a "--experimental" switch)?
pebwindkraft
CC BY-SA 4.0
2018-11-11T17:03:17.167Z
No, it's just not implemented. Bitcoin Core has no idea what that script does, or how to construct a satisfying input for it.
Pieter Wuille
CC BY-SA 4.0
2019-04-08T16:08:42.217Z
Is there any plan to implement this?
Nikos Kostoulas
CC BY-SA 4.0
2018-11-11T05:40:50.607Z
2018-11-11T05:52:37.583Z
2018-11-11T05:52:37.583Z
Pieter Wuille
<p>Previously I generated tx with CHECKLOCKTIMEVERIFY
Here is the transaction <a href="https://tchain.btc.com/bb1415c166fd9f767c06d34d539f4b110ef4445f74a76c5ffad1ded33032e872" rel="nofollow noreferrer">https://tchain.btc.com/bb1415c166fd9f767c06d34d539f4b110ef4445f74a76c5ffad1ded33032e872</a></p>

<p>It lock funds before block 1442909. 
I create a new spend transaction. </p>

<p>When I trying to sign it:</p>

<pre><code>bitcoin-cli -testnet signrawtransactionwithwallet "020000000172e83230d3ded1fa5f6ca7745f44f40e114b9f534dd3067c769ffd66c11514bb0000000000ffffffff01443dd200000000002676a92103e8546cfe53ca9014f6a352bc2e5c1f7cec1f5b344c73d4db3ed3b8f075d5c9ef88ac00000000"
{
  "hex": "020000000172e83230d3ded1fa5f6ca7745f44f40e114b9f534dd3067c769ffd66c11514bb0000000000ffffffff01443dd200000000002676a92103e8546cfe53ca9014f6a352bc2e5c1f7cec1f5b344c73d4db3ed3b8f075d5c9ef88ac00000000",
  "complete": false,
  "errors": [
    {
      "txid": "bb1415c166fd9f767c06d34d539f4b110ef4445f74a76c5ffad1ded33032e872",
      "vout": 0,
      "witness": [
      ],
      "scriptSig": "",
      "sequence": 4294967295,
      "error": "Locktime requirement not satisfied"
    }
  ]
}
</code></pre>

<p>I got "Locktime requirement not satisfied" ? The height of blockchain now is 1,442,912</p>

<p>What I'm doing wrong?</p>

<bitcoin-core><bitcoind><script>
Transaction still unspendable with CLTV
Andrew
# Transaction still unspendable with CLTV

(Asked by: username_0 on 2018-11-11)

Previously I generated tx with CHECKLOCKTIMEVERIFY
Here is the transaction <https://tchain.btc.com/bb1415c166fd9f767c06d34d539f4b110ef4445f74a76c5ffad1ded33032e872>

It lock funds before block 1442909.
I create a new spend transaction.

When I trying to sign it:

```
bitcoin-cli -testnet signrawtransactionwithwallet "020000000172e83230d3ded1fa5f6ca7745f44f40e114b9f534dd3067c769ffd66c11514bb0000000000ffffffff01443dd200000000002676a92103e8546cfe53ca9014f6a352bc2e5c1f7cec1f5b344c73d4db3ed3b8f075d5c9ef88ac00000000"
{
  "hex": "020000000172e83230d3ded1fa5f6ca7745f44f40e114b9f534dd3067c769ffd66c11514bb0000000000ffffffff01443dd200000000002676a92103e8546cfe53ca9014f6a352bc2e5c1f7cec1f5b344c73d4db3ed3b8f075d5c9ef88ac00000000",
  "complete": false,
  "errors": [
    {
      "txid": "bb1415c166fd9f767c06d34d539f4b110ef4445f74a76c5ffad1ded33032e872",
      "vout": 0,
      "witness": [
      ],
      "scriptSig": "",
      "sequence": 4294967295,
      "error": "Locktime requirement not satisfied"
    }
  ]
}

```

I got "Locktime requirement not satisfied" ? The height of blockchain now is 1,442,912

What I'm doing wrong?

**Tags:** bitcoin-core, bitcoind, script


---

## 1 answers

### Answer by username_1 on 2018-11-11. Score: 1

Bitcoin Core does not support signing scripts with CLTV instructions.

It only supports:

* P2PK
* P2PKH
* k-of-n multisig
* P2WSH wrapped versions of the above
* P2WPKH
* P2SH wrapped versions of the above

If you want to sign anything else, you'll need to implement your own signing logic.

The error you're seeing is due to the spending transaction not having the `nLockTime` field set. In general, CLTV works indirectly:

* A CLTV output puts a requirement on the spending transaction to have an `nLockTime` field larger than the time specified by the CLTV instruction.
* A transaction with a `nLockTime` field can only be confirmed when the blockchain time is after the value in that field (this is even the case when no CLTV is present).

But regardless, even if you did have a correct `nLockTime` field, `signrawtransaction` would still not know how to sign for that script.

> **Comments:**
> **username_2**: is there a reason for it? To prevent users losing funds or a protection measure for the end-user without detailed knowledge? I was wondering if there may be activities to allow more sophisticated use cases (following s.th. like a "--experimental" switch)?  
> **username_1**: No, it's just not implemented. Bitcoin Core has no idea what that script does, or how to construct a satisfying input for it.  
> **username_3**: Is there any plan to implement this?  

---

