Tutorials:Bitcoin Mining: Difference between revisions

From Seasonal Tokens
Jump to navigation Jump to search
BeginnersGuide>Marin
 
m (Move page script moved page Tutorials:D5e6 to Tutorials:Bitcoin Mining)
 
(One intermediate revision by one other user not shown)
(No difference)

Latest revision as of 01:41, 4 November 2025

Quest: Bitcoin Mining

In the abstract of the Bitcoin white paper, we read about Hash Functions and Proof of Work:

The network timestamps transactions by hashing them into an ongoing chain of hash-based proof-of-work, forming a record that cannot be changed without redoing the proof-of-work.

Now we will explore how these concepts apply to Bitcoin Mining.

Hash Functions

  • A hash function takes an input of any length and outputs a string of characters of finite length.
  • Bitcoin uses a hash function called SHA 256, which converts any input into a 64-character string.

Task

  1. Visit the following website: Hash Calculator
  2. Use the tool to compute the hash of the word "zero" (all lowercase)

Zealy Task: Reply with the resulting hash.

Exercise: SHA 256 in Bitcoin

SHA 256 is used in various aspects of Bitcoin:

1) To create Bitcoin public addresses from the Private Key.

  * Notice the similarity between the SHA 256 output and a Bitcoin address.  

2) To check the integrity of the blockchain.

3) In the proof of work required to create new blocks.

Proof of Work and Mining

  • All network nodes agree on the state of the blockchain up to the latest block of transactions.
  • All mining nodes work to create the next block.

Proof of Work Process:

1) Nodes receive new transactions and add them to a block under construction. 2) A random number called a nonce is added to the block. 3) The node computes the SHA 256 hash of the potential new block. 4) If the hash starts with a required number of zeroes, the block is complete. 5) The node broadcasts the new block to the network. 6) The network verifies the block's hash satisfies all conditions and adds it to the blockchain. 7) Nodes begin work on the next block, including any remaining transactions.

Key Concepts:

  • The process of creating new blocks is called Mining.
  • The number of zeroes required in the hash for the proof of work is called the difficulty.
 * Difficulty adjusts automatically to keep the time between new blocks close to ten minutes.  
  • The Hashrate of the network measures the computational power involved in mining. It represents the number of hashes performed to find a valid block.