Bitcoin Forum
November 11, 2024, 05:25:09 AM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Deeper Technical Background for the blockchain?  (Read 676 times)
dognose (OP)
Newbie
*
Offline Offline

Activity: 1
Merit: 0


View Profile
April 01, 2013, 10:45:13 AM
 #1

Hello,

i'm a programer and interested in deeper technical background about the blockchain. (and the mining progress).

The block chain header is described over here: https://en.bitcoin.it/wiki/Block_hashing_algorithm

As far as I read, the nonce is a 32bit-number, which makes a total of 4.294.967.295 different nonces and hashes per
block header.

Now i wonder, why it takes "so long" to compute a block then? My Computer is doing 120 Mhashes/s, which in turn means,
the 2^32-1 hashes resulting from the different nonces should be done in like 35 seconds? (2^32-1 / 120 * 1000 * 1000)

So, i guess, the header is updating other values (timestamp?) during the time its beeing processed?
Who (or "what") is delivering the updated header, when theres no central authority?

Also: If THAT is the case, it seems like a computer only needs to be like 35 times faster than mine to be able to calculate a
block in One Second, and therefore ALWAYS finding the valid hash, for given timestamp and ALL nonces...

Can s.b. provide some additional details about the block chain, block hashing and the actuall hash operations that
need to be performed?
DannyHamilton
Legendary
*
Offline Offline

Activity: 3486
Merit: 4832



View Profile
April 01, 2013, 02:18:30 PM
 #2

- snip -
Now i wonder, why it takes "so long" to compute a block then? My Computer is doing 120 Mhashes/s, which in turn means,
the 2^32-1 hashes resulting from the different nonces should be done in like 35 seconds? (2^32-1 / 120 * 1000 * 1000)
- snip -

Because the difficulty is high enough that most of the time you won't successfully find a block after running through all possible nonces.  You then have to alter the header and try again.  This can be done by modifying the timestamp, by changing the list of transactions, or by using the "input" portion of the coinbase transaction as another nonce. This is explained in the page you linked to where it says:

Quote
Whenever Nonce overflows (which it does frequently), the extraNonce portion of the generation transaction is incremented, which changes the Merkle root.

So, i guess, the header is updating other values (timestamp?) during the time its beeing processed?

After each cycle through all possible nonces, yes. Generally the "extraNonce" is used, but timestamp and/or other transactions are also valid possibilities.

Who (or "what") is delivering the updated header, when theres no central authority?

If you are solo mining, then you are delivering the updated header.  You can either write your own program to do so, or you can do as many others do and accept the header that Bitcoin-Qt creates for you.  In that case you are relying on the "rules" that the developers of Bitcoin-Qt have chosen for building a header.

If you are mining in a pool then you are voluntarily accepting the centralization of the pool operator.  In that case you are relying on the pool operator to provide you with valid headers to hash.

Also: If THAT is the case, it seems like a computer only needs to be like 35 times faster than mine to be able to calculate a
block in One Second, and therefore ALWAYS finding the valid hash, for given timestamp and ALL nonces...

A given timestamp and all nonces will not typically result in a valid header, but if a computer was 35 times faster than yours then it would calculate 35 times more hashes than yours in any given timeframe making it 35 times more likely to solve the next block than you.

Can s.b. provide some additional details about the block chain, block hashing and the actuall hash operations that
need to be performed?

Sure.  What do you want to know?
Bronzetank
Newbie
*
Offline Offline

Activity: 19
Merit: 0



View Profile
April 05, 2013, 10:34:41 PM
 #3

To DannyHamilton:

I am another newbie trying to understand some similar things to the OP.  Could you explain a little bit more about the "extranonce" and how it operates?  After doing a few searches in the technical bitcoin Wiki I am still not getting very far.

 As a solo miner, is it possible to predetermine a set of changes to the block header in advance to allow a very fast processor to calculate more than the maximum nonce set (2^32 possibilities) before having to reconnect with the mining client?

Thanks for your help!
DannyHamilton
Legendary
*
Offline Offline

Activity: 3486
Merit: 4832



View Profile
April 06, 2013, 04:17:10 AM
 #4

https://en.bitcoin.it/wiki/Transactions#Generation

Quote
Generations have a single input, and this input has a "coinbase" parameter instead of a scriptSig. The data in "coinbase" can be anything; it isn't used. Bitcoin puts the current compact-format target and the arbitrary-precision "extraNonce" number there, which increments every time the Nonce field in the block header overflows. Outputs can be anything, but Bitcoin creates one exactly like an IP address transaction. The extranonce contributes to enlarge the domain for the proof of work function. Miners can easily modify nonce (4byte), timestamp and extranonce (2 to 100bytes).
Bronzetank
Newbie
*
Offline Offline

Activity: 19
Merit: 0



View Profile
April 06, 2013, 09:00:34 PM
 #5

Thanks! I wouldn't have thought to look in that section of the wiki.

Really appreciate the help!
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!