Title: what is to be hashed in the bolck and where does they come from? Post by: PRCman on June 01, 2011, 03:15:51 AM With in a block, there are following:
what is to be hashed in the bolck and where does they come from? 4 version uint32_t Block version information, based upon the software version creating this block ~~~~~~~~~~~~~~~~~~~~~~~I think it's self generated of come from a hardcode value. 32 prev_block char[32] The hash value of the previous block this particular block references ~~~~~~~~~~~~~~~~~~~~~~~I think it's come from the Bitcoin network 32 merkle_root char[32] The reference to a Merkle tree collection which is a hash of all transactions related to this block ~~~~~~~~~~~~~~~~~~~~~~~What's this? where does it come from? 4 timestamp uint32_t A timestamp recording when this block was created (Limited to 2106!) ~~~~~~~~~~~~~~~~~~~~~~~Is there a NTP server or come from local CMOS clock ? 4 bits uint32_t The calculated difficulty target being used for this block ~~~~~~~~~~~~~~~~~~~~~~~I think it's come from the Bitcoin network 4 nonce uint32_t The nonce used to generate this block… to allow variations of the header and compute different hashes ~~~~~~~~~~~~~~~~~~~~~~~What is this? where does it come from? 1 txn_count uint8_t Number of transaction entries, this value is always 0 ~~~~~~~~~~~~~~~~~~~~~~~0 What else to be hashed when mining? and where are they come from? How do we identify the block creator ? Thanks Title: Re: what is to be hashed in the bolck and where does they come from? Post by: xenon481 on June 01, 2011, 03:20:22 AM How do we identify the block creator ? The following: Quote 32 merkle_root char[32] The reference to a Merkle tree collection which is a hash of all transactions related to this block That Merkle tree is a hash of the transactions which includes the 50BTC generation to the creator's address. Title: Re: what is to be hashed in the bolck and where does they come from? Post by: Quantumplation on June 01, 2011, 03:23:31 AM With in a block, there are following: It's so that, if the code changes down the line, we don't automatically reject this one because it's slightly different and thus don't recognize it. The code can look back and say "Oh yes, for version 1, this is how blocks were done, so it's valid."what is to be hashed in the bolck and where does they come from? 4 version uint32_t Block version information, based upon the software version creating this block ~~~~~~~~~~~~~~~~~~~~~~~I think it's self generated of come from a hardcode value. Quote 32 prev_block char[32] The hash value of the previous block this particular block references This comes from your local copy of the block chain, which you in turn got from someone else on the network solving the block.~~~~~~~~~~~~~~~~~~~~~~~I think it's come from the Bitcoin network Quote 32 merkle_root char[32] The reference to a Merkle tree collection which is a hash of all transactions related to this block That ones a bit confusing and has to do with verifying all the transactions in the block more efficiently. google "merkle tree".~~~~~~~~~~~~~~~~~~~~~~~What's this? where does it come from? Quote 4 timestamp uint32_t A timestamp recording when this block was created (Limited to 2106!) It's a weird hybrid "agreed upon" time that is calculated based on what other nodes on the network are saying the time is, so everyone~~~~~~~~~~~~~~~~~~~~~~~Is there a NTP server or come from local CMOS clock ? arrives at kind of an "average" time. Quote 4 bits uint32_t The calculated difficulty target being used for this block This comes from everyone agreeing (essentially) on what the difficulty should be because of the rate that blocks are being solved at.~~~~~~~~~~~~~~~~~~~~~~~I think it's come from the Bitcoin network Quote 4 nonce uint32_t The nonce used to generate this block… to allow variations of the header and compute different hashes This is the magic number that you change in order to try and make the hash of the whole thing less than the difficulty. Essentially, you start at 0, change it to 1, 2, 3, 4, etc. until you find a valid block.~~~~~~~~~~~~~~~~~~~~~~~What is this? where does it come from? Quote 1 txn_count uint8_t Number of transaction entries, this value is always 0 ~~~~~~~~~~~~~~~~~~~~~~~0 What else to be hashed when mining? and where are they come from? How do we identify the block creator ? Thanks You identify the block "creator" by whoever was awarded the 50 bitcoins in the first "generation" transaction. Title: Re: what is to be hashed in the bolck and where does they come from? Post by: PRCman on June 01, 2011, 03:29:58 AM Are there any fields not mentioned above to be hashed when mining?
Title: Re: what is to be hashed in the bolck and where does they come from? Post by: xenon481 on June 01, 2011, 03:33:20 AM Are there any fields not mentioned above to be hashed when mining? No. Title: Re: what is to be hashed in the bolck and where does they come from? Post by: PRCman on June 01, 2011, 03:38:48 AM Quote Quote 32 merkle_root char[32] The reference to a Merkle tree collection which is a hash of all transactions related to this block ~~~~~~~~~~~~~~~~~~~~~~~What's this? where does it come from? That ones a bit confusing and has to do with verifying all the transactions in the block more efficiently. google "merkle tree". When mining, how to fill this field? Title: Re: what is to be hashed in the bolck and where does they come from? Post by: Quantumplation on June 01, 2011, 03:50:47 AM Quote Quote 32 merkle_root char[32] The reference to a Merkle tree collection which is a hash of all transactions related to this block ~~~~~~~~~~~~~~~~~~~~~~~What's this? where does it come from? That ones a bit confusing and has to do with verifying all the transactions in the block more efficiently. google "merkle tree". When mining, how to fill this field? http://en.wikipedia.org/wiki/Hash_tree Title: Re: what is to be hashed in the bolck and where does they come from? Post by: PRCman on June 01, 2011, 04:09:46 AM Quote Quote 32 merkle_root char[32] The reference to a Merkle tree collection which is a hash of all transactions related to this block ~~~~~~~~~~~~~~~~~~~~~~~What's this? where does it come from? That ones a bit confusing and has to do with verifying all the transactions in the block more efficiently. google "merkle tree". When mining, how to fill this field? http://en.wikipedia.org/wiki/Hash_tree Okay, how do we fill the tree leaves? Title: Re: what is to be hashed in the bolck and where does they come from? Post by: Quantumplation on June 01, 2011, 06:36:54 AM Quote Quote 32 merkle_root char[32] The reference to a Merkle tree collection which is a hash of all transactions related to this block ~~~~~~~~~~~~~~~~~~~~~~~What's this? where does it come from? That ones a bit confusing and has to do with verifying all the transactions in the block more efficiently. google "merkle tree". When mining, how to fill this field? http://en.wikipedia.org/wiki/Hash_tree Okay, how do we fill the tree leaves? Transactions. Title: Re: what is to be hashed in the bolck and where does they come from? Post by: PRCman on June 01, 2011, 06:42:46 AM Quote Quote 32 merkle_root char[32] The reference to a Merkle tree collection which is a hash of all transactions related to this block ~~~~~~~~~~~~~~~~~~~~~~~What's this? where does it come from? That ones a bit confusing and has to do with verifying all the transactions in the block more efficiently. google "merkle tree". When mining, how to fill this field? http://en.wikipedia.org/wiki/Hash_tree Okay, how do we fill the tree leaves? Transactions. I don't understand the concept, we will have transactions after the block is found, right? block is used for transactions. What transaction do we have before the block found (while mining)? Title: Re: what is to be hashed in the bolck and where does they come from? Post by: Quantumplation on June 01, 2011, 07:39:32 AM Quote Quote 32 merkle_root char[32] The reference to a Merkle tree collection which is a hash of all transactions related to this block ~~~~~~~~~~~~~~~~~~~~~~~What's this? where does it come from? That ones a bit confusing and has to do with verifying all the transactions in the block more efficiently. google "merkle tree". When mining, how to fill this field? http://en.wikipedia.org/wiki/Hash_tree Okay, how do we fill the tree leaves? Transactions. I don't understand the concept, we will have transactions after the block is found, right? block is used for transactions. What transaction do we have before the block found (while mining)? Blocks contain transactions. The fact that a block contains them "verifies" them. A transaction is generated by someone saying "I want to send coins." Have a look at http://blockexplorer.com/, gives some pretty useful block data. Title: Re: what is to be hashed in the bolck and where does they come from? Post by: PRCman on June 01, 2011, 07:49:49 AM Quote Quote 32 merkle_root char[32] The reference to a Merkle tree collection which is a hash of all transactions related to this block ~~~~~~~~~~~~~~~~~~~~~~~What's this? where does it come from? That ones a bit confusing and has to do with verifying all the transactions in the block more efficiently. google "merkle tree". When mining, how to fill this field? http://en.wikipedia.org/wiki/Hash_tree Okay, how do we fill the tree leaves? Transactions. I don't understand the concept, we will have transactions after the block is found, right? block is used for transactions. What transaction do we have before the block found (while mining)? Blocks contain transactions. The fact that a block contains them "verifies" them. A transaction is generated by someone saying "I want to send coins." Have a look at http://blockexplorer.com/, gives some pretty useful block data. Thank you. From following page, such as my understanding, when mining, the miner/client fills the Merkle with a algorithm result (like a several hash) of the creator's receiving address. Is that true? https://en.bitcoin.it/wiki/Block_hashing_algorithm |