Everything You Should Know About Bitcoin Mining PlatoBlockchain Data Intelligence. Vertical Search. Ai.

Everything You Should Know About Bitcoin Mining

Everything You Should Know About Bitcoin Mining PlatoBlockchain Data Intelligence. Vertical Search. Ai.

Each miner collects unverified transactions into a block (about 500 transactions), and then races to solve Bitcoin’s Proof of work.

What is Proof of Work?

Proof of Work is the system Bitcoin uses, forcing miners to do a lot of computation in order to find a correct value. While also making correct solutions easily verifiable to any party.

What is a hash function?

A hash function converts an arbitrary string of values (ie: a word, sentence, numbers…) into a fixed length string.

Input | Output
---------------------------------------------
'hello world' | hd72kf97x
'hello world 2' | l9ancg478
'123' | nfhyeiv00
'I like pasta on rainy days' | x913gzmaw

What are inputs to Bitcoin’s hash function?

The inputs for Bitcoin’s hash function are predetermined. You must follow the rules.

  1. Previous block header hash. This is the output hash associated with the previous block in the blockchain. This ensures the ledger is an unbroken chain with each block referencing the block before it. This will be the same for all miners at a given time.
    A recent example: 1b9affbba072ba2e923797d3b2050b9b9c8baacf696f84ac9940282b5568c547.
  2. Current block transactions hash. A hash based on transactions that the miner has included in the current block. This is different for each miner because each miner is likely working on a different block of transactions.
    A recent example: 11a510d7adcde1ad5c8b33c35f5902f08cdb1d9800161f8af3874258f935ecea
  3. Current time. A unix timestamp representing the time the miner started hashing inputs for the current block. The miner sets this time so it will be different between miners.
  4. Target nBits. An encoded version of the criteria that successful hash outputs must meet (aka. begin with at least 19 zeros). The threshold is revised every 2,016 blocks so that the blockchain continues growing at it’s planned rate of 1 block every 10 minutes.
  5. Nonce (aka. random positive integer). A random number that’s incremented every time inputs are hashed. A 1 integer change in this number completely changes the hash output.
Credit: en.bitcoin.it/wiki
#################
# Pseudo code #
#################
block_header = version + prevHash + curHash + time + diff + nonce

What hashing algorithm does Bitcoin use?

Bitcoin uses Double SHA-256.

#################
# Pseudo code #
#################
block_header = version + prevHash + curHash + time + diff + noncesha_function( sha_function( block_header ) )

Do all miners work on the same blocks of transactions?

We mentioned this before. But here is a little more explanation.

Source: https://medium.datadriveninvestor.com/everything-you-should-know-about-bitcoin-mining-d62c5a20d10a?source=rss——-8—————–cryptocurrency

Time Stamp:

More from Medium