Skip to main content

All Questions

Filter by
Sorted by
Tagged with
1 vote
1 answer
36 views

Can the CLTV opcode be included in a Bitcoin wallet creation script?

I want to understand if it is possible to include an absolute locktime during the wallet generation process. If I understand correctly, this would mean that the send function would be non-operational ...
SeedCard's user avatar
2 votes
1 answer
121 views

Properly Import P2WSH Descriptors into a Watch-Only Wallet to Reflect All Balances and Transactions

I'm trying to import a Pay-to-Witness-Script-Hash (P2WSH) descriptor into my Bitcoin Core watch-only wallet using the importdescriptors command. My goal is to ensure that the wallet reflects all ...
Al Nostru's user avatar
2 votes
1 answer
60 views

How this transaction was included in the block if CLTV is much larger than a current block height?

So here's transaction in question: 04c2ad1e2ac3651e0cda0d2a3cc4b43434ad45de8330a526ab87aabb67587cc6 It's taproot script is: OP_PUSHBYTES_32 ...
Norm's user avatar
  • 23
2 votes
1 answer
71 views

Non-witness P2SH spending using C++ libbitcoin

I am trying to spend an UTXO (non-witness P2SH) using libbitcoin. I've look at libbitcoin-system wiki documentation (https://github.com/libbitcoin/libbitcoin-system/wiki) but haven't found a solution ...
paranoid's user avatar
  • 187
2 votes
2 answers
65 views

Can a spend before a timestamp condition be put on a Bitcoin UTXO?

How to make spending conditions of a UTXO in Bitcoin such that before a particular timestamp, say t, it can be spent only in one way and, after t, it can be spent only in another way.
Kirti Singh's user avatar
0 votes
1 answer
111 views

What are the default timelocks in Lightning implementations today? How are they negotiated on channel opening?

There are two timelocks in Lightning that both channel counterparties must agree to if a channel is going to be opened between them. These are (from BOLT5) to_self_delay (a CSV relative timelock) ...
Michael Folkson's user avatar
2 votes
1 answer
121 views

Does the nSequence of the input that consumes the CLTV output have to be different from 0xffffffff?

Looking at the BIP65, it says that the CLTV will fail if the nSequence field of the txin is 0xffffffff. It seems logical to me since if the nSequence of all inputs are set to 0xffffffff, the value of ...
LeaBit's user avatar
  • 990
2 votes
1 answer
186 views

What is the relation between nLockTime and nSequence?

Here Antoine said the following: This introduced absolute timelock capability through the nLockTime transaction field, which is disabled if all the transactions inputs have an nSequence that is ...
LeaBit's user avatar
  • 990
2 votes
2 answers
91 views

How does CLTV prevent spender from spending the output? [duplicate]

I have difficulty understanding how does CheckLockTimeVerify works. The BIP-65 which proposed CTLV says: This BIP describes a new opcode (OP_CHECKLOCKTIMEVERIFY) for the Bitcoin scripting system that ...
Amir reza Riahi's user avatar
0 votes
1 answer
72 views

HTLC routing issues in custom LN plugin (c-lightning) on regtest network

I am working on a custom routing plugin for CLN on a regtest network. My goal is to compare its performance against the classical rebalancing plugin provided by the CLN community. Now I am trying to ...
dancingsushi's user avatar
2 votes
1 answer
190 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 ...
wazint's user avatar
  • 21
2 votes
1 answer
1k 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 ...
zerotobtc's user avatar
  • 323
0 votes
0 answers
471 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'...
arshbot's user avatar
  • 1,808
0 votes
1 answer
235 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 = ...
Ali's user avatar
  • 15
1 vote
1 answer
122 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 ...
Ali's user avatar
  • 15
3 votes
1 answer
154 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 <...
vincenzopalazzo's user avatar
1 vote
1 answer
509 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 ...
Yash Madhwal's user avatar
5 votes
1 answer
299 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 ...
Michal's user avatar
  • 609
3 votes
1 answer
260 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 ...
Ugam Kamat's user avatar
  • 7,467
5 votes
1 answer
101 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 ...
skaht's user avatar
  • 3,077
3 votes
1 answer
138 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 ...
Andrew's user avatar
  • 173
1 vote
2 answers
160 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 ...
Wapac's user avatar
  • 1,074
2 votes
0 answers
376 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&...
Zargoon's user avatar
  • 121
1 vote
1 answer
130 views

Bitcoin multisig contract - to Lock coins with nTimeLock (BIP65)

I really need help. I am currently Developing a Bitcoin wallet and want to build in a SMS Based send function where the sender does not need to know the receiver publicKey. After the contract get ...
marigold's user avatar
1 vote
1 answer
246 views

ScriptSig in bip65 escrow example

In the bip65 there is an example how it can be used for escrow in combination with a multisig. See: https://github.com/bitcoin/bips/blob/master/bip-0065.mediawiki#Escrow There it claims that the ...
blues's user avatar
  • 294
7 votes
2 answers
671 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 ...
qweruiop's user avatar
  • 181
3 votes
2 answers
268 views

How is the clock reset in the Complex Script Example?

At the end of Mastering Bitcoin Chapter 7, in the "Complex Script Example", they ask this question in regards to the script: How do the partners "reset" the clock every 29 or 89 ...
Charlie L's user avatar
  • 133
2 votes
1 answer
177 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 ...
skydanc3r's user avatar
  • 179
6 votes
1 answer
800 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: ...
Simone Bronzini's user avatar
1 vote
2 answers
111 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?
Felipe's user avatar
  • 1,778
5 votes
2 answers
689 views

Are Micropayment channels still subject to malleability after BIP65?

After BIP 65, are simple, unidirectional, MPC still subject to transaction malleability? More specifically: Is the payee at risk because of malleability? If yes, how? (as far as I understood, the ...
hartmut's user avatar
  • 691
5 votes
1 answer
1k views

BIP 65 - how standard is it?

I read in this great thread that which BIP are standards is not always obvious. What about BIP 65? To which extent is it standard? Currently, all I know is that "Miners following the developers of ...
hartmut's user avatar
  • 691
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 ...
knocte's user avatar
  • 1,784
3 votes
1 answer
111 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 ...
Nagu Dalal's user avatar
1 vote
1 answer
758 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 ...
Tom Taylor's user avatar
2 votes
1 answer
745 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 ...
Scott Driscoll's user avatar
5 votes
1 answer
3k 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, ...
mulllhausen's user avatar
  • 1,713
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 ...
mulllhausen's user avatar
  • 1,713
3 votes
1 answer
353 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> ...
Wizard Of Ozzie's user avatar
4 votes
1 answer
798 views

BIP65: "replacing ntimelock entirely"?

BIP65 discusses replacing the ntimelock field with the new CHECKLOCKTIMEVERIFY OP code: As an aside, note how if the SignatureHash() algorithm could optionally cover part of the scriptSig the ...
Wizard Of Ozzie's user avatar