Title: Question about finding a block Post by: irukandji on December 31, 2018, 04:45:27 AM Not sure i understand this but would be grateful if someone could help.
This is what I understand. 1.Finding a block means guessing a number. 2.That number involves showing that the transaction involves the right keys and then ..putting it through some meth equation? Is that right? What I wonder is ...is the miner constantly guessing numbers based on whatever transaction he intends to add to his block? And so the transaction variable of the guessing is constantly changing? So the miner is moment by moment is solving for a different pool of transactions? Title: Re: Question about finding a block Post by: achow101 on December 31, 2018, 05:35:35 AM Not sure i understand this but would be grateful if someone could help. Kind of.This is what I understand. 1.Finding a block means guessing a number. 2.That number involves showing that the transaction involves the right keys and then ..putting it through some meth equation? Is that right? No. Miners do not prove that transactions are correct, that's not their job. The process of mining has nothing to do with showing transactions are correct or have correct keys. However a miner will want to still verify transactions are valid (their proof of correctness is contained within the transaction and is produced by their creators, not the miner) so that the block they produce is also valid. A valid block has more than just a valid proof of work, it's contents must also be valid.What miners do is try to find a block which hashes to less than a target value (you can view this as the hash beginning with some number of 0's). The way that they do this is to increment a value called a nonce. It is just a number which is part of the data that is hashed. So miners are trying to guess a nonce which results in a block hash that has some number of zeroes in front of it. It's a bit more complicated than that, but that's a basic understanding of what miners do to "solve a math problem" (it's not really a math problem). Title: Re: Question about finding a block Post by: Heisenberg_Hunter on December 31, 2018, 05:52:37 AM 1.Finding a block means guessing a number. Yes, true. In order for a miner to find a block he needs to do a trial and error method by inputting various nounce values and the resulting hash should be less than the current target. If the hash is higher than the target, he need to change the nounce and try again until he reaches the desired hash. Once he has found the hash he found the block.2.That number involves showing that the transaction involves the right keys and then ..putting it through some meth equation? Is that right? No. The transactions are struck in the mempool. These transactions are already validated by a bitcoin node and added to the pool of unconfirmed transactions. Once the miner finds a block, he picks up these transactions from the mempool (probably the tx with fees) and adds them to the block he is gonna mine. Along with a list of transactions included in the block, he adds a block header he has computed and a coinbase transaction which is the first transaction of any block that pays the miner.What I wonder is ...is the miner constantly guessing numbers based on whatever transaction he intends to add to his block? I guess you have misread everything about how mining works and how transactions are validated! Miners constantly try to find a block by using up different nounce values. There is nothing to do with transactions and blocks. And so the transaction variable of the guessing is constantly changing? So the miner is moment by moment is solving for a different pool of transactions? Whoa, NO! Please read Mining and Consensus : Mastering Bitcoin (https://github.com/bitcoinbook/bitcoinbook/blob/develop/ch10.asciidoc) to get a complete insight of how Mining works.EDIT : Oops, achow already answered... Typing in mobile is one of the hardest jobs :P Title: Re: Question about finding a block Post by: bitmover on December 31, 2018, 09:44:17 AM Not sure i understand this but would be grateful if someone could help. This is what I understand. 1.Finding a block means guessing a number. Kind of, but not exactly. Miners do not find a block. To create a new block, they need to solve a cryptographic algorithm called Proof of Work. PoW can only be solved by finding a number that when combined with block data and hashed generates another number that is smaller to the target (determined by PoW). When a miner finds that number, a new block is created , not found. Title: Re: Question about finding a block Post by: DaCryptoRaccoon on December 31, 2018, 02:44:18 PM This might be of some use to you it's a Mining Simulation.
http://yogh.io/#mine:last https://github.com/yogh-io/bitcoin-transaction-explorer You have your basic Block headers Code: Block headers Raw headers in hex Code: 00000020702C9FD61864295E897E723E76E929D6E5099BED17432B000000000000000000AA5FB4AFB0154D2BDD3315E074F219351FDF13908F1C515E07BE12124A3D3760B4222A5CF41E371715000000 Coinbase transaction Code: 01000000010000000000000000000000000000000000000000000000000000000000000000FFFFFFFF0487654321FFFFFFFF0100F90295000000001976A914DC863734A218BFE83EF770EE9D41A27F824A6E5688AC00000000 Computed block hash Code: CB78229F85ABD927B71954CB65905F5AC9F12DBC512D2FE9CD6C7580AA814C62000000000000000000371EF4FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF Now lets say we move the Nonce to 22 The new computed value for Block Hash would become Code: 77F6BF7C376A4346BD28FFAB917E2B1327B8CFD77F70B986A6421FC06A21CF56 Now lets break down the Raw header in Hex Code:
Each time the hash changes until the block hash is equal to or below this number in order to be valid. 000000000000000000371EF4FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF Title: Re: Question about finding a block Post by: irukandji on January 02, 2019, 03:58:48 AM Thank you to all who replied. :)
|