Bitcoin Forum
June 23, 2024, 12:31:53 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: A question regarding Timestamp  (Read 146 times)
webtricks (OP)
Legendary
*
Offline Offline

Activity: 1918
Merit: 1728


View Profile
January 01, 2020, 06:36:17 AM
 #1

As we all know nonce is the number that keeps on changing until the hash generated with the joint string of nonce and other block data matches the target difficulty requirement.
Other block data such as data, last hash and difficulty remain constant but what about timestamp? Does timestamp also changes alongside nonce at every iteration until required hash is found or it remains constant?
pooya87
Legendary
*
Offline Offline

Activity: 3486
Merit: 10666



View Profile
January 01, 2020, 07:14:55 AM
Merited by webtricks (2), malevolent (1), hugeblack (1), Heisenberg_Hunter (1)
 #2

not at every iteration but it also changes.
you have this structure:
1- version
2- Previous Block Header Hash
3- MerkleRoot Hash
4- Block Time (or timestamp)
5- N Bits
6- Nonce
these make up 80 bytes and 1&2&5 are fixed for that block while 3&4&6 can change. mining is basically changing 1 bit at a time (from the bits that can change) and hashing it again until you  get the result. so you start from somewhere (nonce) then when you run out of bits you move to another variable.

the loop could look like this:
start: nonce=0
increment nonce(+1)
reach nonce max (0xffffffff)
change nonce to 0 and change something else:
  - timestamp if enough time has been passed
  - merkle root if new transactions were added to the mempool and were included in this block
    or have a variable in coinbase tx called extranonce and change that.
increment nonce(+1)
...

.
.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!