Guess a value for the empty nonce in the last block that results in a hash with sufficient number of leading zeros and you win 18000 dollars.

Why a block chain database?

  • A regular online bank account keeps you from spending digital money more than once.  That is possible because it is a centralized design that subtracts the amount spent from your account.  You can not change this because you do not have the ability to change the database.
  • What do you do if there is no central database because you do not want to rely upon a central authority? How can the balances in everyone's accounts be maintained in a trustworthy fashion? How do you keep a person from spending the same buck in his bank account 2 times when it is only an entry in a database that they have access to?  Access to a normal database would mean you could set any value you wanted.  The skies the limit!
  • Remember the database needs to be hard to fake up but easy to read.  Everyone needs be able to read it.  Everyone needs to be able to tell which version of it is valid.  Have you ever downloaded a file that had a hash value to compare with the hash value that you compute on the version you download to verify it is not corrupted?   This same methodology is used with the blocks in the database chain.  The hash appended to the end of the block has to have a special value and finding that special value requires lots of computation.  This makes it easy to read and verify the database block but hard to make the block in the first place.  

 

Purpose of BitCoin Mining

BitCoin mining is a way of insuring an unavoidable delay in the construction of the blocks of a database by a peer to peer distributed computing machine.  This delays the adding of a new block of data to a database called the blockchain by about 10 minutes.   Due to the fact that computational power varies this computational delay algorithm must be able to be throttled.  This delay serves the purpose of:

  • Make it difficult for an individual or group to make fake entries in the database.  Any minority of computational power can not make up a fictional block without falling behind the rest of the network as they still have to perform the same computational tasks as a valid miner.  Here "falling behind" is defined as not being the maximum length valid blockchain available.  Since it would have less computational power it can not keep up and the majority pulls out ahead and is recognized as the valid version of the block chain.
  • Allowing enough time for the world wide network of computers to have a decent probability of all having the same blocks in their blockchain database. Alternative solutions will arise often and at that point a race will occur.  At some point some number of blocks later one of the sets of solutions will pull ahead with high probability.  At that point the blockchain version that is the longest wins and  becomes the next valid version and shorter versions of the blockchain will be ignored by computers trying to mine the next block because you are only rewarded for being the first miner of a valid block.  

Implementation

This delay is implemented by requiring a guessing game on the block of data with appended single word which is then hashed. This guess number called a nonce.  A hash is an algorithm that takes a block of data and provides an output that is not correlated to the input. Nonces are repeatedly guessed and tacked onto a block of data to try achieve a hash value that is less than or equal to a specified number.  For purposes of argument assume the data is only 8 bit. If the specified value was <= 8 then you would need to keep trying nonces and hashing until you arrived at 0000 0100binary or less.  Since the hashing algorithm output is randomly related to the output your probability on any one guess would be 8/256=1/32.  In reality the numbers are much bigger and probilities of finding the correct nonce much lower.  You can see in this case you can adjust the probability of solution and expected time till solution by changing the specified value to a different value.  

That way the block chain can be a reasonable foot race and arranges that 51% of computing power of the network will be able to outrun any hacker that might try fabricating his own blocks and awarding himself coins.

If you do not know what a hash function is:

  • A hash function is any function that can be used to map data of arbitrary size to data of fixed size. The values returned by ahash function are called hash values, hash codes, digests, or simply hashes. One use is a data structure called a hashtable, widely used in computer software for rapid data lookup.  You probably have seen some hash functions used to verify downloads have not been corrupted. In order to be effective most applications require the Hash function provide values that are not easily computed in bulk. A single computed hash value given an input is easily confirmed given a block of data. This way it is very difficult for a hacker to engineer a desired result value.
  • Wikipedia: Hash Function
  • Online Sha-256 Calculator
Categories: BitCoinComputing

0 Comments

Leave a Reply

Avatar placeholder

Your email address will not be published. Required fields are marked *