Skip to main content
Share Your Experience: Take the 2024 Developer Survey

Questions tagged [locktime]

Defines the block number or timestamp until this transaction is locked, or 0 if the transaction is always locked.

Filter by
Sorted by
Tagged with
0 votes
1 answer
33 views

Got sendrawtransaction RPC error: {"code":-26,"message":"non-final"} when broadcast to https://blockstream.info/testnet

I am trying to broadcast this transaction and got this error : Got sendrawtransaction RPC error: {"code":-26,"message":"non-final"} What does this error message mean? ...
Trí Lương's user avatar
0 votes
1 answer
24 views

Make signed transaction invalid after specified time

Is it possible to construct a valid signed transaction that will become invalid if it hasn't been included in a block before a specified height? Is there any opcode or other way to accomplish this? ...
f321x's user avatar
  • 3
2 votes
2 answers
49 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
1 vote
1 answer
54 views

Identifying change addresses by locktime?

I know that Blocksci is no longer being actively developed but I was reading through some of the documentation about identifying change addresses and came across this: change.locktime = <blocksci....
user2334659's user avatar
2 votes
1 answer
96 views

Does the stack have access to the current block height when validating transaction?

In the "Freezing funds until a time in the future" example here https://en.bitcoin.it/wiki/Script it mentions that the "Top stack item is checked against the current time or block ...
Steve's user avatar
  • 99
0 votes
1 answer
140 views

What are the correct "threshold" values of the nSequence in order to activate relative time lock and only absolute time lock?

Based on BIP68, relative lock time is activated if the most significant bit in nSequence value is not set. In other words, if the 32th (1<<31) bit is not set. So for the nSequence values less-...
LeaBit's user avatar
  • 950
1 vote
1 answer
190 views

What was the first original purpose of the nLocktime? Was it only the time bound to nSequence?

Pieter Wuille gave an amazing answer related to the connection between nSequence and nLocktime in the early days of Bitcoin. However, based on his answer it looks like the nLocktime was NOT really ...
LeaBit's user avatar
  • 950
4 votes
1 answer
258 views

What is the logic (if there is) behind linking the nSequence and nLockTime?

The nSequence transaction field was originally intended for a replacement logic, but since it was never well thought out, it was never implemented. However, it has been implemented since the beginning ...
LeaBit's user avatar
  • 950
2 votes
1 answer
147 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
  • 950
4 votes
1 answer
203 views

What are all the meanings of the nSequence field?

I know the original purpose of the nSequence field was to hold the transaction in the mempool with the transaction being replaced when the larger value comes and so on up to 0xFFFFFFFF when the ...
LeaBit's user avatar
  • 950
2 votes
2 answers
86 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
1 vote
1 answer
72 views

Is there locktime but in the other way around? (valid until block x) [duplicate]

Locktime defines the earliest block number that the transaction can be added to the blockchain. Is there any way to define the latest block number that a transaction can be mined? For example, ...
Angelo's user avatar
  • 423
2 votes
1 answer
80 views

What will happen if I try to broadcast a transaction before the established locktime block height passed?

If someone send me BTC with locktime and I accidentally try to broadcast transaction before the established block height passed, what will happen? Am I still be able to broadcast it after the ...
Mike's user avatar
  • 21
10 votes
2 answers
387 views

Why is the locktime set at transaction level while the sequence is set at input level?

Giacomo Zucco pointed out the oddity of there being one timelock field per transaction, but one sequence per input. Even for the original use of determining the order of replacement, it would seem ...
Murch's user avatar
  • 75.7k
2 votes
1 answer
121 views

Can a signed raw transaction's locktime be changed?

If I create a signed raw transaction with a locktime in the future, and give this raw transaction to somebody else, can they edit the locktime so that they recieve the bitcoin immediately? For example,...
Cannabijoy's user avatar
1 vote
1 answer
117 views

Unable to use UNIX timestamp for locktime on testnet

I am trying to create a timelock transaction, but I am unable to use a UNIX timestamp on testnet. However, if I use a block height the transaction works. When I use a block height that is in the ...
Cannabijoy's user avatar
0 votes
1 answer
142 views

Should an offline address generated from private key send funds to wallet?

I'm trying to use the python package python-bitcoinlib to send a timelock transaction on testnet. The github has two examples to create an address, and then use that address to send the bitcoin to ...
Cannabijoy's user avatar
5 votes
2 answers
679 views

Why would a transaction have a locktime of 1987!

I don't understand the locktime in transaction 97DC62BAB016D8EE5C828C76318FE01E9A70992F150838960122DFA9BF8089BC Hexadecimal Data Meaning 82BF3B20 LockTime 1987-02-20 02:29 The locktime is ...
RedGrittyBrick's user avatar
2 votes
1 answer
201 views

How to create a valid time locked descriptor?

I am attempting to bitcoin-cli getdescriptorinfo "wpkh([00000000/84h/1h/0h/2]tpubDECM3jqdpSiGU2mKmo6xXxxXwFcmz6fX9EHMV3zbTY236jYYK9tM57cRFWaHqNjLbqAy52P6wkyo9wCAnr4P7Q1hGGFnrW98LPLajXEZPez/35:...
Fontaine's user avatar
  • 466
1 vote
1 answer
238 views

nLocktime for Bitcoin Core

I was reading this while doing some research: https://github.com/achow101/wallet-fingerprinting/blob/main/fingerprints.md and had some questions: What is the default nLocktime for a transaction in ...
user avatar
2 votes
1 answer
159 views

Time delayed transactions as a solution for the inheritance problem?

Is it possible to construct a transaction which is delayed in time, more specifically blocks? The idea being that you have a device which has a signed transaction, which sends all of your Bitcoin to ...
MManke's user avatar
  • 212
1 vote
2 answers
580 views

Question about Bitcoin's Median Time Past

I was currently reading the book Mastering Bitcoin written by Andreas and was pretty confused about the concept called Median Time Past. Hopefully I can get some of your advice. From my understanding, ...
John Pham's user avatar
2 votes
1 answer
295 views

Are attempts to spend from a timelocked UTXO rejected?

Background I was reading a bit about Bitcoin time locked transactions within the context of the Lightning Network. One thing that was never explained is what happens when one tries to prematurely ...
juan_more_bitcoin's user avatar
0 votes
0 answers
97 views

Coinbase transaction UTXOs are prohibited until 100 confirmed? By what?

I notice that many coinbase transactions(like in block 720,815) with locktime=0x00000000 and sequence=0xFFFFFFFF, which means UTXO could be spent immediately. There seems to be no limit to coinbase's ...
KHJUAF403456ZS3K564WAEF's user avatar
2 votes
1 answer
171 views

UNIX END TIME January 19, 2038 - Will it affect Timelock nLOCKTIME smart contracts past that date?

So UNIX END TIME is January 19, 2038. What will happen then to the btc TX that looks at Unixtime for nLOCKTIME transactions? Will any Locktime transaction past that date, say to 2040 be an issue? Or ...
krogoth's user avatar
  • 23
14 votes
1 answer
563 views

Why are miners setting the locktime in coinbase transactions?

Some coinbase transactions have locktime values set. One such recent example is: { "txid": "5166cb509a5d786db33963a269ea08ff82a1c40d37d4fb828a394b0465cd5efd", "hash": ...
TheCharlatan's user avatar
1 vote
0 answers
100 views

P2TR Scriptpath failing (Timelocked contract)

Goal is to archive the following logic: $alice = A; $bob = B; pk($bob) || (pk($alice) && older(10)) I went through The Taproot Workshop and came up with the following code: from io import ...
ByteFlowr's user avatar
  • 133
0 votes
2 answers
575 views

Why are OP_RETURN transactions discouraged? Does using version or locktime make any difference?

Why are OP_RETURN transactions discouraged? Are they paying less fees compared to other transactions? Will it make any difference if same thing is done using version or locktime when data is either 1 ...
user avatar
1 vote
1 answer
85 views

Is it possible to change `their_to_self_delay` after a channel is open?

Rene said here that a c-lightning node is safe for around 24 hours to be offline (depending on the locktime). This is set with watchtime-blocks in the configuration file of c-ligthning. But this will ...
user avatar
1 vote
1 answer
144 views

Best way to store fund on the lightning network

Suppose that someone want to store 0.1 bitcoin on the lightning network for a period of 1 year to use services such as buying and selling things but doesnt know which one and with who yet. What would ...
Saxtheowl's user avatar
  • 2,800
4 votes
2 answers
333 views

what if the timelock is in the past?

I just started learning about bitcoin scripting and wonder: what if the timelock in CLTV is in the past? what if the timelock in nLocktime is equal to 500.000?
Newdude's user avatar
  • 53
2 votes
2 answers
394 views

Should the nodes of a channel have the same Time Lock Delta?

Consider this channel https://1ml.com/channel/612829298476056576 : Node 1: Caffeine Time Lock Delta: 10 Node 2: HODLcat.com Time Lock Delta: 144 How is an HTLC passing through this ...
alec_djinn's user avatar
0 votes
0 answers
394 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,788
4 votes
1 answer
101 views

At what block height may locktimed transactions get included?

Transactions with outputs whose sequence is smaller than UINT_MAX are interpreted as locked until the timestamp or block height specified in nLockTime is reached. Specifically regarding the block ...
Murch's user avatar
  • 75.7k
1 vote
1 answer
72 views

Are both CSV and nLocktime unnecessary in Eltoo?

The Eltoo paper says "Notice that we could use nSequence for this purpose, but due to the interplay with OP_CSV we opted to use nLocktime". Now that Lau showed CSV not to be necessary, does that mean ...
Janus Troelsen's user avatar
2 votes
1 answer
228 views

In Lightning commitment transactions, what do the upper 8 bits of sequence and locktime represent?

In Bolt 3 of the Lightning Network specs, for commitment transactions it states: locktime: upper 8 bits are 0x20, lower 24 bits are the lower 24 bits of the obscured commitment number. sequence: ...
Darius's user avatar
  • 789
6 votes
1 answer
139 views

What does the 'n' in nLockTime and nSequence stand for?

I know what nLockTime and nSequence do, but I'm just curious about where the 'n' comes from. Thanks
Darius's user avatar
  • 789
7 votes
2 answers
650 views

nLockTime in Bitcoin Core

Currently, the Bitcoin Wiki states: A part of the original Bitcoin implementation, nLockTime is a field that specifies the earliest time a transaction may be added to a valid block. A later Bitcoin ...
Martin Harrigan's user avatar
5 votes
2 answers
588 views

Strange LockTime values in Electrum transactions?

Electrum includes a locktime in all transactions by default. Usually the value is equal to the current block height, eg 592918, however it sometimes drops perhaps 20 or so blocks. What is going on ...
Jonathan Cross's user avatar
1 vote
1 answer
485 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
2 answers
514 views

What is transaction "finality"?

bitcoind IsFinalTx() as seen here checks the properties of a transaction in this order: Is nLockTime exactly 0? That's final. return. If it's not 0, is it below the current block height / time? If so,...
pinhead's user avatar
  • 5,154
5 votes
1 answer
271 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
0 votes
1 answer
106 views

The nlocktime parameter in createrawtransaction seems not work using Bitcoin Core Wallet GUI

If I add the CLocktime (e.g 20) at the end it always gives: Error: Error parsing JSON:{"12CxqQHzhFxCm2TkGkKHdFFPyUerFXcSte":0.008,"1DBDDvpcHv66LD7sWz1mCitPALW1qfrga7":0.012}, If I delete the ...
yrm23's user avatar
  • 51
1 vote
1 answer
60 views

Where is a tx located before finalized with the sequence number or locktime?

My understand, for a tx, before it finalized with the locktime, it can not go into mempool. But, which specified location is the tx to stay for waiting the locktime come. Similiar, for before the ...
yrm23's user avatar
  • 51
1 vote
1 answer
57 views

How does one lock their own Bitcoins for X amount of blocks and prove that you locked it?

Is there a method of locking Bitcoins for X amount of blocks and also being able to prove its locked? How would one do this and with what wallet? Mobile wallet possible? Reason why is I'd imagine one ...
Patoshi パトシ's user avatar
1 vote
1 answer
237 views

Create a transaction spendable in a specific block height

I am new in Bitcoin and I try to create an address in Bitcoind and send a transaction that the amount will be spendable in a specific height of the blockchain. Here is what I have done: privateKey = ...
Tasos's user avatar
  • 129
3 votes
1 answer
256 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,407
2 votes
1 answer
218 views

How to spend a multisignature, CLTV time-locked UTXO?

I am using this locking script with libbitcoin explorer to create a bitcoin testnet transaction: bx script-to-address -v 196 "[efa716] checklocktimeverify drop 2 [...
rusticbison's user avatar
0 votes
2 answers
65 views

Reference an UTXO of a transaction that has not been yet mined

How to reference an UTXO that has not been yet mined? I want to prepare a transaction and, before spreading it, use its UTXO as input for another relative timelocked transaction. Then, spread the ...
Bruce Wayne's user avatar
5 votes
2 answers
1k views

How does nSequence/Check Sequence Verify work?

How does relative timelock work? I mean, I know the theoretical description, but how to use nSequence concretely ? Can you do me a practical example with 2 sample transactions one of which locked with ...
Bruce Wayne's user avatar