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
116 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
  • 480
1 vote
1 answer
158 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
  • 480
4 votes
1 answer
232 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
  • 480
2 votes
1 answer
109 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
  • 480
4 votes
1 answer
141 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
  • 480
2 votes
2 answers
63 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
66 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
  • 413
2 votes
1 answer
70 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
357 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
  • 72.7k
2 votes
1 answer
102 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
109 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
112 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
647 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
180 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
156 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
109 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
488 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
266 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
86 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
0 votes
1 answer
151 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
14 votes
1 answer
543 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
98 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
515 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
82 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
142 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,770
4 votes
2 answers
316 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
381 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
359 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,710
4 votes
1 answer
90 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
  • 72.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
224 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
  • 779
6 votes
1 answer
136 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
  • 779
7 votes
2 answers
598 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
546 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
464 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
490 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
  • 4,992
5 votes
1 answer
253 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
99 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
54 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
212 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
248 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,348
2 votes
1 answer
212 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
4 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
5 votes
1 answer
82 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,047
2 votes
1 answer
61 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 ...
greenphone's user avatar
1 vote
2 answers
134 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
3 answers
174 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 ...
PixelPaul's user avatar
  • 121
2 votes
0 answers
341 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