Now that you know that blockchain is a peer to peer, decentralized and distributed ledger, it's time to understand how these transactions are added to the chain. (Here is a link to my other post if you didn't know that about Blockchain https://read.cash/@d23711/newbies-come-learn-about-blockchain-centralization-and-decentralization-c7d6d417). Since blockchain is decentralized, the network relies on it's community of miners to review and process transactions.
What is Mining?
Mining refers to the method transactions are added to the ledger. As I mentioned in my previous article, any device that downloads the mining software becomes a node; but to become a miner, specialized computer hardware is necessary. This is because blockchain utilizes the processing power of this hardware to solve a complicated equation to add any transactions to the ledger.
How does Mining Work?
Let's say someone wants to send some Bitcoin (BTC) to a friend. When the transaction is initiated, it will take the below information and create a unique digital signature:
The sender's Public Key
The receiver's Public Key
The sender's Private Key
The amount of the transaction
This information is sent across the network of nodes to ascertain that the funds are available and the digital signature is valid. Once the nodes across the network verify the validity of the transaction that's being attempted, it will be ready to be grouped with other transactions that have been verified by the nodes.
How do Nodes Verify a Transaction?
Nodes verify transactions through the use of cryptographic hash functions. A hash function takes data of any size (in this case, the transaction data) and runs it through a complicated mathematical equation that produces a fixed length output of numbers and letters. Hashing is deterministic, meaning the same input will always produce the same hash output. However, if two different inputs were to generate the same hash output, it can cause chaos. This could happen, but the coding attempts to prevent this through use of an avalanche effect. Basically, any changes to the data input, regardless of how minor, will drastically change the equation’s solution.
The only way to solve this equation, though, is through trial and error. This is why specialized computer hardware is needed as the computers must guess the answer until it's correct. This process requires a lot of energy to complete, which can be costly. Once the solution is found, however, all subsequent nodes are easily able to verify the answer. Once transactions are verified, they are ready to be confirmed and added to the blockchain.
What's Next?
In my next post, I will explain how verified transactions are confirmed and added to the ledger. Have a question? I want to help! Make sure to leave it in the comments! If this information helped you, please drop me a like and follow. Thank you for reading!
Come join me on Torum and follow me on Twitter!
Thank you very much Jaxson!!