Questions tagged [checklocktimeverify]

26 questions
12
votes
3 answers

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 submit a transaction that will fail to verify to…
mulllhausen
  • 1,713
  • 2
  • 14
  • 33
6
votes
1 answer

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: If any input has a sequence less than…
5
votes
1 answer

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 1st 2030.
Michal
  • 609
  • 1
  • 7
  • 8
5
votes
2 answers

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 than the time parameter provided to the CLTV…
qweruiop
  • 161
  • 6
5
votes
1 answer

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, I am going to describe my understanding of how…
mulllhausen
  • 1,713
  • 2
  • 14
  • 33
4
votes
1 answer

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 format? Byte swapping associated with endianess has a…
skaht
  • 3,017
  • 1
  • 12
  • 23
3
votes
1 answer

Clarification on execution of complex script with OP_CHECKLOCKTIMEVERIFY

I'm quoting this example of BIP65 BIP 65 has this bitcoin script code IF CHECKLOCKTIMEVERIFY DROP CHECKSIGVERIFY 1 ELSE 2 ENDIF 2 CHECKMULTISIG And with this…
vincenzopalazzo
  • 1,303
  • 1
  • 8
  • 26
3
votes
1 answer

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 leaves something on the stack and hence has to be…
Ugam Kamat
  • 7,263
  • 2
  • 13
  • 38
3
votes
1 answer

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 be accepted (included in block) and after 3 month…
Andrew
  • 173
  • 8
3
votes
2 answers

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 give it to someone (actually the owner of wallet Y)…
knocte
  • 1,764
  • 1
  • 17
  • 32
3
votes
1 answer

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 Issuance of building permits Yearly net company…
Nagu Dalal
  • 270
  • 1
  • 6
3
votes
1 answer

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: CHECKLOCKTIMEVERIFY DROP DUP HASH160 EQUALVERIFY CHECKSIG How is the time value encoded in this…
Wizard Of Ozzie
  • 5,268
  • 4
  • 30
  • 63
2
votes
0 answers

Locktime requirement not satisfied when locktime set to 1 in p2sh

I've created the following script on testnet: OP_IF 2 3 OP_CHECKMULTISIG OP_ELSE 1 OP_CHECKSEQUENCEVERIFY OP_DROP OP_CHECKSIG OP_ENDIF I am currently able to unlock the funds when I…
2
votes
2 answers

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 the partners "reset" the clock every 29 or 89 days…
Charlie L
  • 123
  • 3
2
votes
1 answer

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 for some time (until the draw for example, like 5…
skydanc3r
  • 179
  • 9
1
2