Jump to content

How Does Cryptocurrency Mining Work?

Recommended Posts

Cryptocurrency mining is the process of validating transactions on the blockchain and creating new coins of cryptocurrency. Miners require a lot of computing resources, which also ensures the security of the blockchain network. Honest and successful miners can earn newly created cryptocurrency and transaction fee rewards.

After a new blockchain transaction is concluded, it will be sent to the mining pool, which we call the mempool. The job of the miners is to verify the validity of these pending transactions and integrate them into blocks. You can think of blocks as pages of a blockchain ledger, where transactions are recorded.

Specifically, mining nodes are responsible for collecting unconfirmed transactions from the mempool and integrating them into candidate blocks. Subsequently, miners attempt to convert this candidate block into a validly confirmed block. But they need to be able to solve complex Maths problems. This requires a lot of computing resources, but miners are issued a block reward for each successfully mined block, including the newly created cryptocurrency and transaction fees. Let's take a closer look at the mining process.

Step 1 - Hash transaction
To mine a block, the first step is to operate the pending transactions one by one from the mempool through the hash function and submit them. Every time we submit a piece of data through a hash function, we generate a fixed-length output called a hash. During the mining process, the hash of each transaction consists of a string of numbers and letters used as an identifier. The transaction hash value represents all the information contained in that transaction.

In addition to hashing and singling out each transaction, miners add custom transactions that send block rewards to themselves. This transaction, called a transaction, enables the creation of new coins. In most cases, transactions are the first to be recorded in a new block, followed by pending transactions that they want to verify.[/size]

Step 2 - Create Merkle tree
After each transaction is hashed, the hashes are combined into a structure called a Merkle tree. Merkle tree, also known as hash tree, works by combining transaction hashes into pairs and then hashing them. The new hash outputs are combined into pairs, hashed again, and the whole process is repeated until a single hash is created. The last hash also called the root hash (or Merkle root), basically represents all previous hashes used to generate the root hash.

Step 3 - Find a valid block header
The block header is used as the identifier of each independent block, representing that each block has its own hash value. When creating a new block, miners combine the hash of the previous block with the root hash of the candidate block to generate a new block hash. In addition to these two elements, they also need to add a random value called nonce.

Therefore, when miners try to validate their candidate block, they need to combine the root hash, previous block hash and nonce and submit it through the hash function. Its goal is to create a hash that is considered valid.

The root hash and the hash of the previous block cannot be changed, so miners need to make multiple changes to the nonce until a valid hash is found.

The output (block hash) must be less than some target value determined by the protocol to be considered valid. In Bitcoin mining, the first few digits of the block hash must be zeros. This is what we call mining difficulty.

Step 4 - Propagating mined blocks
As we can see, miners need to repeatedly hash the block header with different nonce values. They keep repeating this work until they find a valid block hash. The miner will propagate his block to the network. All other nodes will check if the block and its hash are valid, and if so, add the new block to the copy of the blockchain.

At this point, the candidate block becomes a confirmed block and all miners move on to the next block. Miners who cannot find a valid hash in time will discard their candidate blocks and continue mining.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • General Statistics

    • Total Topics
    • Total Posts
    • Total Members
    • Most Online
      10/06/21 10:53

    Newest Member
    Joined 25/03/23 10:02
  • Posts

    • Charting the Markets: 24 March The FTSE 100, DAX 40 and Nasdaq 100 slide on renewed banking woes while EUR/USD, EUR/GBP and GBP/USD drop as the US dollar, gold appreciate due to flight-to-quality flows. Crude oil and copper tumble on recession fears.  Axel Rudolph FSTA | Senior Financial Analyst, London | Publication date: Friday 24 March 2023         This is here for you to catch up but if you have any ideas on markets or events you want us to relay to the TV team we’re more than happy to.  
    • Market Breakdown | WTI Oil, EURUSD, GBPNZD, EURAUDHere are the updates & outlook for multiple instruments in my watchlist.1️⃣ WTI Oil daily time frame️The market is trading in a long term bearish trend .After the last sharp bearish movement, the market is steadily recovering.Ahead, I see a major horizontal supply area.Probabilities are high, that the next bearish wave will initiate from there.2️⃣ EURUSD daily time frameAfter a breakout of a solid daily resistance, the market is preparing for its retest.Watch carefully the underlined zone and look for buying opportunities from there.3️⃣ EURAUD weekly time frameThe pair is currently approaching a weekly horizontal resistance cluster.Taking into consideration, that the pair is quite overbought, probabilities will be high to see a pullback from that4️⃣ GBPNZD daily time frameThe pair is currently retesting a broken neckline of an ascending triangle . As we discussed earlier, the trend line of a triangle and its neckline compose a contracting buy zone now.Chances will be high that the next bullish wave will initiate quite soon.For Additional confirmation use: Divergence Indicators
    • #CHFJPY: Classic Bearish Setup 🇨🇭🇯🇵   🔻CHFJPY has nicely respected a confluence zone based on a horizontal 4H resistance and a 0.5 retracement of the last bearish impulse.   The price formed a double top pattern on that and broke its neckline.   Probabilities will be high that the pair will drop lower soon. Goals: 141.172 / 140.363  
  • Create New...