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
11 votes
3 answers
3k views

Can someone explain nLockTime?

I'm having a hard time understanding how nLockTime works. The Bitcoin wiki has an explanation that is confusing to me: nLockTime is a parameter that can be attached to a transaction, that mandates ...
  • 361
9 votes
1 answer
3k views

Why Bitcoin core creates time locked transactions by default?

I've noticed recently that Bitcoin Core is producing transactions with non-zero lock-time and sequence numbers of inputs being 0xFFFFFFFE, even though I didn't instruct it to do so. The lock-time ...
9 votes
1 answer
2k views

How is locktime enforced in the standard client?

I am trying to study the locktime feature of transactions ( https://en.bitcoin.it/wiki/Protocol_specification#tx ). I have created some raw transactions in the testnet with different locktimes, but, ...
  • 1,408
8 votes
3 answers
13k views

What does "lock time" mean?

I got a transaction that is still not confirmed for about one week, and I can see a field called "Lock Time" that says: Lock Time Block: 419382 https://blockchain.info/en/tx/...
  • 83
8 votes
3 answers
614 views

Can nLockTime TX be used to flood Mempools?

What would happen, if I would create a large number of large transactions with a very high nLockTime? Would something stop me from filling not only the miners', but also regular nodes' mempools? ...
  • 1,999
8 votes
0 answers
193 views

Miners setting locktime in coinbase transaction

Some coinbase transactions have locktime values set. One such recent example is: { "txid": "5166cb509a5d786db33963a269ea08ff82a1c40d37d4fb828a394b0465cd5efd", "hash": ...
6 votes
2 answers
470 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 ...
6 votes
1 answer
107 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
  • 779
5 votes
3 answers
983 views

Is there any way to make an UTXO that cannot be spent until a certain block #?

In bitcoin, each transaction has an nLockTime integer to specify the earliest allowed block number/time that the transaction can be added to the blockchain. In addition, each transaction input has an ...
  • 13.8k
5 votes
2 answers
483 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 ...
5 votes
1 answer
699 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: ...
5 votes
2 answers
423 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,...
  • 4,706
5 votes
1 answer
78 views

Is it possible to determine the total amount of timelocked Bitcoin?

Now that is possible to lock funds until a certain date (https://coinb.in/#newTimeLocked). How to calculate how many of all bitcoin in existence is locked until a certain date? Any service that does ...
4 votes
2 answers
818 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 ...
4 votes
1 answer
558 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 ...
4 votes
2 answers
626 views

Is it possible to schedule a transaction in the future?

Wondering if it's technically possible to set up a transaction to be sent in the future, for example 6 months? Is this related to block timestamps parameters? Transaction timestamps?
4 votes
2 answers
287 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?
  • 53
4 votes
1 answer
210 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 ...
  • 599
4 votes
1 answer
421 views

Could I mine a non-final transaction?

I know that non-final transactions (locktime in future and sequence number < MAX_UINT) are not "accepted by miners". However, I could not figure out the exact behavior. If I mined my own block ...
4 votes
1 answer
335 views

Lightning: why do we need decrementing timelocks in multi-hop payments?

The video (at 28:25) from the official Lightning website describes a multi-hop payment. I understand what a hash-locked contract is, but I still don't understand why we need a timelock aspect here. As ...
4 votes
1 answer
81 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 ...
  • 65.9k
4 votes
2 answers
917 views

Is it possible to combine multi-sig and locktime?

Is it possible to create a 1 of 2 multi-sig address in which only one of the keys is time-locked and the other can sign any time?
  • 43
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
4 votes
1 answer
687 views

nLockTime transactions, how do they persist? Are they broadcast before they are valid?

If nLockTime transactions aren't added to the blockchain until the nLockTime is met, then aren't they just being stored in memory of the miners and is there a risk they could get "lost"? I guess I'm ...
  • 308
4 votes
1 answer
68 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,957
3 votes
1 answer
208 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,063
3 votes
2 answers
1k views

Understanding GreenAddress nLocktime/recovery transactions

What I understand is that Greenaddress locks a recovery transaction to be spend 90 days in the future. Whats the advantage in doing this? Why not creating a recovery transaction without nLocktime?
  • 97
3 votes
2 answers
983 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,696
3 votes
1 answer
108 views

How to create a valid time locked descriptor?

I am attempting to bitcoin-cli getdescriptorinfo "wpkh([00000000/84h/1h/0h/2]tpubDECM3jqdpSiGU2mKmo6xXxxXwFcmz6fX9EHMV3zbTY236jYYK9tM57cRFWaHqNjLbqAy52P6wkyo9wCAnr4P7Q1hGGFnrW98LPLajXEZPez/35:...
  • 456
3 votes
3 answers
314 views

What will happen when nLockTime is used along with Counterparty transactions

I heard that Counterparty cannot handle lock time, but I cannot understand why. What will happen when we use nLockTime in a transaction which includes Counterparty transactions?
3 votes
0 answers
102 views

Claim or Refund Functionality Implementation in Bitcoin

I was reading the paper written by Kuramesan and Bentov with title "How to use Bitcoin to Design Fair Protocols". Source: https://eprint.iacr.org/2014/129.pdf Specifically, the sender creates a ...
2 votes
1 answer
66 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,...
2 votes
1 answer
195 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 ...
2 votes
2 answers
303 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 ...
2 votes
1 answer
202 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: ...
  • 779
2 votes
1 answer
292 views

Simple explanation of how a hash timelock function works with an atomic trade of bitcoin / litecoin trade without a 3rd party?

From my understanding a hash timelock function trade or atomic swap involves 2 transactions one separate blockchains. The BTC user named Bob is making a trade with Alice for her LTC. Assuming its a 1 ...
2 votes
1 answer
716 views

What is Bitcoin's locktime feature exactly? How can it be used?

What is Bitcoin's locktime feature and what are some example use cases? And how can a user make use of this new feature? Is it in any gui wallet? And how would one use it in the command line if its ...
2 votes
1 answer
254 views

Is the time value in transaction or block information the time it arrived at my client? [duplicate]

Both transactions and blocks have a time field when you use Bitcoin's getblock or gettransaction methods. The API method list defines the transaction time as " time the transaction occurred". Is this ...
  • 11.5k
2 votes
1 answer
49 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 ...
  • 210
2 votes
1 answer
196 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 [...
2 votes
1 answer
54 views

Is it posible to create a transaction output that can either be reddemed by privK of Addr A or by privK of Addr B AFTER certain blockheight?

I am thinking about how to secure your Bitcoin savings. One idea I had was to create sort of a "backup" address B for an address A which stores the bitcoins. So what I want to achieve is that you ...
2 votes
3 answers
157 views

CHECKSEQUENCEVERIFY After x time of last transaction

Is there a way where i can have a multi-sig address which will allow one of the signers to use only their single key after a set amount of time after each transaction/update on the address? I want ...
  • 121
2 votes
1 answer
174 views

Which clients support nLockTime?

I want to use nLockTime, but I don't know what clients support it?
  • 9,929
2 votes
0 answers
310 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
2 votes
2 answers
202 views

Encrypted message with nLockTime

I know you can delay a transaction's accepted date by using nLockTime. I'm still looking for the simplest way to generate a transaction with nLockTime, but that's another topic. I'm wondering if ...
  • 21
2 votes
0 answers
80 views

Bitcoin contracts with stickK.com functionality

Does a BTC service/application allow me to set a nTimeLock transaction that can be interrupted by a single predetermined 3rd party before the transaction has been made public? If a service like this ...
1 vote
2 answers
306 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, ...
1 vote
2 answers
109 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
1 vote
1 answer
72 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 ...
1 vote
1 answer
135 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 ...
  • 2,453