Bitcoin Forum
May 05, 2024, 12:58:00 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Do transactions need to be accurately timestamped?  (Read 132 times)
ltcltcltc (OP)
Newbie
*
Offline Offline

Activity: 26
Merit: 64


View Profile
December 13, 2023, 01:30:29 PM
 #1

A block header must be timestamped less than 2h into the future in order to be confirmed by the network. Is there a similar rule for transaction timestamps?
If you want to be a moderator, report many posts with accuracy. You will be noticed.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714913880
Hero Member
*
Offline Offline

Posts: 1714913880

View Profile Personal Message (Offline)

Ignore
1714913880
Reply with quote  #2

1714913880
Report to moderator
mocacinno
Legendary
*
Offline Offline

Activity: 3388
Merit: 4919


https://merel.mobi => buy facemasks with BTC/LTC


View Profile WWW
December 13, 2023, 01:36:46 PM
Last edit: December 13, 2023, 02:08:31 PM by mocacinno
Merited by pooya87 (2)
 #2

no, a transaction can have a lock_time, but even that is not mandatory. A lock_time is not equal to the current timestamp!

here's some extra documentation
https://en.bitcoin.it/wiki/Transaction

EDIT: typo... I meant to say that there's no obligation to add a lock_time (it can be zero), so i i forgot the word "not" in front of mandatory.... I'm not a native English speaker, so mistakes like this are bound to happen from time to time Smiley

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
pooya87
Legendary
*
Offline Offline

Activity: 3444
Merit: 10549



View Profile
December 13, 2023, 01:56:41 PM
Merited by hosseinimr93 (1)
 #3

Bitcoin transactions are not timestamped, they are included in a block that has a timestamp.
The last 4 bytes of a transaction that is known as a locktime is there to indicate a time or a block height after which the transaction can be included in a block.

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
Churchillvv
Full Member
***
Offline Offline

Activity: 392
Merit: 166


Eloncoin.org - Mars, here we come!


View Profile WWW
December 13, 2023, 02:04:41 PM
 #4

A block header must be timestamped less than 2h into the future in order to be confirmed by the network. Is there a similar rule for transaction timestamps?
Transactions do not have timestamps, so the timestamp that blockchain.info displays is whatever time their node received the transaction. The time shown will also change to the time that it was included in a block. In general, it is not reliable to trust the timestamp given for an unconfirmed transaction on blockchain.info as it is entirely dependent on their node.

Information source

garlonicon
Hero Member
*****
Offline Offline

Activity: 803
Merit: 1932


View Profile
December 13, 2023, 05:34:06 PM
 #5

Quote
Do transactions need to be accurately timestamped?
No, because Bitcoin is not about measuring time. It is about double-spending problem.

Which means, if you run for example regtest, then you can include a lot of mainnet transactions directly, even though they happened in a completely different network, on a completely different time. If regtest would have 21 million coins, it could be copy-pasted "as is", but because amounts are different, it is somewhat limited, because you cannot copy-paste for example a transaction with 500k BTC.

So yes, you can take some mainnet transaction from 2009, and include it into regtest, in 2023. Which means, the time is not really enforced, because if you can clone the coinbase transaction, and if you can clone the whole flow, then you can perform 1:1 testing, on exactly the same transaction hashes. But as I said, there are limitations, like coin amounts, that prevents users from using regtest as a mainnet mirror (but probably testnet3 or signet could still do that; and it is a proof, that time is not really enforced, and transactions are reorg-resistant).
NotATether
Legendary
*
Offline Offline

Activity: 1596
Merit: 6728


bitcoincleanup.com / bitmixlist.org


View Profile WWW
December 14, 2023, 06:57:24 AM
 #6

It's the blocks that are timestamped, but even they don't need to be accurately timestamped. That's because the full node implementations such as Bitcoin Core has a window within which a block is allowed to be received. It's usually between a few hours before and a few hours after the current system time (on the node), so as long as the timestamp is within that dynamic range, its block is accepted. Otherwise, it is rejected.

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!