Questions tagged [checklocktimeverify]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
0 answers
44 views

Create and spend P2WSH that locks coins with OP_CHECKLOCKTIMEVERIFY

I'm attempting to create a P2SWH address with a script that locks the coins for some time. And then I want to spend those coins from that address. I've read a lot, some of the most relevant: BIP173 ...
  • 11
2 votes
1 answer
585 views

How to check OP_CHECKLOCKTIMEVERIFY?

I try to simply get into the OP_CHECKLOCKTIMEVERIFY opcode and test it. However I get the error error: Locktime requirement not satisfied no matter what unix- or blocktime I enter in my btcdeb. I ...
  • 323
0 votes
0 answers
282 views

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

I'm attempting to redeem the following htlc ( the python script below ) via timeout, however the redemption tx errors out upon validation with the error below: bitcoin.rpc.VerifyRejectedError: {'code'...
  • 1,588
0 votes
1 answer
179 views

How to add an address to a CheckLockTimeValue (CLTV) transaction output using bitcore-lib (or any other js lib)

I am using bitcore-lib to create transactions. I can add an output with CLTV to the transaction but am unable to add an output address to it. This is my code (typescript/node): const lockScript = ...
  • 15
1 vote
1 answer
85 views

Using CLTV can I freeze some funds from a wallet, and make them available, in a single transaction?

For my scenarios, I want freeze some funds from my wallet for some given time/block and then make that amount spendable in a single transaction. As I understand so far, I can do it using 2 ...
  • 15
3 votes
1 answer
125 views

Clarification on execution of complex script with OP_CHECKLOCKTIMEVERIFY

I'm quoting this example of BIP65 BIP 65 has this bitcoin script code IF <now + 3 months> CHECKLOCKTIMEVERIFY DROP <Lenny's pubkey> CHECKSIGVERIFY 1 ELSE 2 ENDIF <...
1 vote
1 answer
419 views

How to make a transaction with locktime on testnet?

I tried to make transaction with nLocktime on bitcoin testnet. I am not able to broadcast it. Can someone please help me to make a basic transaction with 1 input and 1 output, so that I can broadcast ...
5 votes
1 answer
222 views

How can I make transaction output time locked?

Is it possible to submit some coins to some address and make them spendable after some period of time? Like I want submit 1btc to address 1Kc24m... and make that output to be spendable after january ...
  • 609
3 votes
1 answer
217 views

Why CHECKLOCKTIMEVERIFY and CHECKSEQUENCEVERIFY opcodes have to be succeeded with DROP Opcode?

Opcodes that end in VERIFY generally do not leave anything on the stack. What's so different and the reasoning when designing these opcodes that CHECKLOCKTIMEVERIFY and CHECKSEQUENCEVERIFY opcodes ...
  • 7,163
4 votes
1 answer
71 views

Is the bit encoding format for the graphic in BIP 68 implicitly little-endian?

CLTV (OP_CHECKLOCKTIMEVERIFY - absolute locktime) and CSV (OP_CHECKSEQUENCEVERIFY - relative locktime) utilize BIP 68. Is the locktime for those two operations implicitly encoded in little-endian ...
  • 2,997
3 votes
1 answer
121 views

OP_CHECKLOCKTIMEVERIFY . Include / reject or will not included in block?

What happened if I translate to network transaction with the folowing redeem script: [now + 3 months] CHECKLOCKTIMEVERIFY DROP DUP HASH160 [Bob's Public Key Hash] EQUALVERIFY CHECKSIG This tx will ...
  • 173
1 vote
2 answers
116 views

BIP 113 - monotonic guarantee

BIP 113 mentions: Existing consensus rules guarantee this value to monotonically advance, thereby removing the capability for miners to claim more transaction fees by lying about the timestamps of ...
  • 1,034
2 votes
0 answers
317 views

Locktime requirement not satisfied when locktime set to 1 in p2sh

I've created the following script on testnet: OP_IF 2 <pubkey1> <pubkey2> <pubkey3> 3 OP_CHECKMULTISIG OP_ELSE 1 OP_CHECKSEQUENCEVERIFY OP_DROP <pubkey1&...
  • 121
5 votes
2 answers
494 views

CLTV vs nLockTime

What is the difference between nLockTime and CLTV? Bitcoin Wiki says: When the CLTV opcode is called, it will cause the script to fail unless the nLockTime on the transaction is equal to or greater ...
  • 161
2 votes
2 answers
249 views

Mastering Bitcoin: Advanced Scripting Question

At the end of Mastering Bitcoin Chapter 7. https://github.com/bitcoinbook/bitcoinbook/blob/second_edition/ch07.asciidoc#complex-script-example They ask this question in regards to the script: How do ...
  • 123
2 votes
1 answer
172 views

What OP code can I use in the scripting system to make a smart contract that acts similar to a lottery

I am trying to make a smart contract that acts similar to a lottery or gambling game. Here is an example: Alice and Bob send funds to a P2SH address. Bob is the lottery. The funds needs to be locked ...
  • 179
6 votes
1 answer
718 views

Sequence number semantics

Reading the following BIPs: 68, 112, 125, I got a few questions about the sematics of sequence numbers. As far as I understood, in version 1 transactions, sequence numbers have the following meaning: ...
1 vote
2 answers
102 views

Is it safe to keep ONLY a time-locked tx?

What if the tx become incompatible with future versions of Bitcoin? In which cases it would just stop being compatible? If there is no compatibility guarantee, how can this be useful at all?
  • 1,678
3 votes
2 answers
1k views

Can you "undo" an nlockTime transaction by spending a single UTXO of it before lockTime's block happens?

Let's say I have a wallet X with money from 3 unspent outputs (UTXOs) A, B and C. I make an nlocktime transaction to spend 2 of my 3 UTXOs (A & B) to wallet Y, 1 month in the future, sign it, and ...
  • 1,726
3 votes
1 answer
100 views

Can I program OP_CHECKLOCKTIMEVERIFY to trigger based on external verifiable events?

Can OP_CHECKLOCKTIMEVERIFY and multi-sig be used to trigger a transaction based on external verifiable events? Some potential uses I have in mind: Death College graduation of a child or grandchild ...
1 vote
1 answer
693 views

How do I use CHECKLOCKTIMEVERIFY to prevent a transaction being spent before 100 blocks?

I'm creating a Bitcoin based lottery application. An entry into the lottery is a transaction spending 1BTC. If someone guesses some arbitrary value correctly, they can claim the entry and send this ...
2 votes
1 answer
700 views

Do transactions including CHECKLOCKTIMEVERIFY get mined immediately?

As I understand it, nLockTime prevents transactions from being included in a block, or even relayed. The problem is, if I pre-sign a transaction, and give it to someone, they have no guarantee that I ...
4 votes
1 answer
2k views

Is my understanding of locktime correct?

I have been trying to understand locktimes and sequence numbers. I'm gradually building up a picture in my head based on code, code comments and info on the web. Rather than asking lots of questions, ...
  • 1,703
12 votes
3 answers
3k views

Why is OP_CHECKLOCKTIMEVERIFY disabled by maximum sequence number?

In the code for OP_CHECKLOCKTIMEVERIFY i noticed that if the txin sequence number is maxxed out then the script will fail to validate. I'm wondering what the point of this is? Why would anybody ever ...
  • 1,703
3 votes
1 answer
334 views

How is time encoded (BIP65) in scripts?

BIP65 has several examples where OP_CHECKLOCKTIMEVERIFY interprets the time value underneath it in the stack, for example: <expiry time> CHECKLOCKTIMEVERIFY DROP DUP HASH160 <pubKeyHash> ...