Bitcoin Mining – How Do Miners Process Transactions Inside The Blockchain?
May 11, 2020, was a big event for Bitcoin miners. The third halving transitioned, cutting the supply of bitcoin in half, from 12.5 to 6.25 BTC every ten minutes for every mined block.
But what exactly is mining? It is a ubiquitous term associated with the Bitcoin network and many other cryptocurrencies. Yet many explanations go only as far as indicating the importance of processing transactions, securing the network, and making transactions near-instant.
This guide is for you if you want to understand more of what happens inside the blockchain network and what exactly the miners do. It’s the simplest explanation of what happens inside the Bitcoin network during a transaction when bitcoins are sent from point A to point B.
Sending Bitcoins – Wallet To Wallet
To pay for a transaction using bitcoins, you need to have a Bitcoin wallet and the public address of the person you’re sending it to, who also has a wallet. Some people attach transaction fees if they want their transactions to be processed faster (added to the next block), but they’re not mandatory.
Blocks are just hundreds to thousands of grouped transactions of 1mb each. They are generated by miners who use them to record and add transactions to the chain of other blocks containing earlier transactions.
The transaction being sent over the Bitcoin network goes to a local pool of other unconfirmed transactions, where miners pick them at random and add them to new blocks. First, they have to confirm their validity by looking at the wallet’s transaction history to make sure it has enough balance to make the current payment.
Miners prioritize transactions with higher transaction fees, and so your transaction may get picked by two or more miners working on different blocks. So if you’re in a hurry as a sender, you should use a higher transaction fee option as that will fasten the processing period of your transaction. Transaction fees are not mandatory, especially for smaller purchases like coffee or paying for a movie ticket, but it means your transaction might have to linger in the pool for longer.
Mining-Finding the Block Signature
Once a miner picks enough transactions for their block, they need to add the block to the network, but for this to happen, the miner has to find the block’s unique signature. This is where the computational power of their mining computer (mining rig) comes to play.
The signature, also known as a hash function, is a complex mathematical puzzle that each miner has to solve for each block. It is like finding the unique identifier that will identify the block from the chain of thousands of other blocks already in the network.
Finding the signature involves inputting a random combination of symbols, digits or numbers to get a 32 string digit that starts with a specific number of zeros, let’s say 17 zeros. Not all random inputs will generate such an output, and thus, the miner has to change the input until the output meets the set conditions. This means the computer needs to perform fast, repeatedly, and consume a lot of electricity.
Keep in mind that this happens simultaneously with thousands of miners working on different blocks, which might contain the same transaction. The first miner to work out the answer to their block’s puzzle transmits the block, its puzzle input, and answer to other miners on the network.
Verification and Addition to the Chain
In turn, the other nodes verify that the transmitting miner’s input for the block gives the exact unique output (signature). This is easy to do since the same random input will always give the same output. Once other nodes on the network verify that the block is valid, they add it to their nodes, and the block is said to be confirmed.
The miner who mined (solved the hash function) the block gets rewarded, and the next block is added based on the metadata of the last mined block. To further explain, it means that the hash output of the mined block will be included in the hash function of the next block.
Confirming a Transaction
Every transaction is said to have one confirmation. Once the block it’s in, it has been verified by other nodes and added to the network. Consequently, if the next block is confirmed, it is then added to the chain, and it becomes the second confirmation for the transaction, and so on.
Miners have to be fast since only one block is included and, therefore, the reward and transaction fees if there are any. This means that other miners have to abandon their blocks if they contain some of the confirmed transactions in an already mined block.
Besides, the next block has to have a signature of the previous block. Otherwise, other miners would see this and reject a block that doesn’t fit the history of the blockchain’s block.
After their block has been confirmed, miners repeat the same process by going back to the local pool in approximately ten minutes. They verify and group other transactions in a block that references the signature of the latest block on the chain.
How then, are Bitcoin Transactions Instant?
After getting a picture of how the Bitcoin network works, the next logical step is to wonder how bitcoin purchases or wallet transfers reflect instantly on the destination wallet.
On the Bitcoin network, the answer is pretty simple. Sending bitcoins is broadcasting the request for the transaction to the entire network. Therefore, the person receiving the bitcoin will get a message almost instantly that the transfer has taken place, but the transaction still has to go through the mining process.
The probability of your transaction getting confirmed is and being added in a block with no problem is always high, especially if there’s an attached transaction fee. So, many merchants or outlets do not necessarily have to wait until the blocks are validated when paying with bitcoins. You can use block explorers, which are useful tools in tracking the progress of a transaction in a blockchain network.
This simple explanation reveals the foundation of decentralized governance, where everything is done automatically without the involvement of a third party. Miners can be located anywhere in the world, and it’s not enough for any miner to solve the puzzle, but they have to broadcast for others to verify and reach a consensus on what the truth of the transaction is supposed to be.