Last week, I discussed 2 out of 3 key ideas of blockchain technology — how it uses cryptography to protect transaction data and how it uses distributed networks to maintain data integrity — that is, complete copies of its transaction ledgers can be freely downloaded and maintained by “miners,” thus securing the blockchain network.
The third key idea explains why anyone would bother downloading and running “mining” software. Why would you spend resources such as computer hardware and electricity to run this piece of software? The answer is that you are rewarded for doing so. That is the third key idea — incentivized computing.
To understand this, let’s go back to the idea of a blockchain as a ledger of transactions. In a physical ledger like a notebook, transactions are recorded sequentially in different pages. You start at page 1, then 2, and so on. On the blockchain, transactions are recorded in “blocks” which are produced sequentially over time, thus they are “chained” together. The first block (usually called the genesis block, block 1, or block 0) is produced before the second block, the second before the third and so on. Each block contains a certain number of transactions.
Now, each miner in the network has the opportunity to produce a block. The miner that produces the block is rewarded by being given a certain amount of tokens or coins, as well as the fees for the transactions in that block. (As mentioned before, making transactions on a blockchain network usually involves paying some kind of fee — like the fee one pays to send money via wire transfer. So for example, to send 10 bitcoins to another account, one would pay 0.0001 bitcoin as a transfer fee.)
So how is the miner of a particular block determined?
At the beginning of every cycle, the miners are tasked to solve a mathematical problem. This problem is automatically produced by the blockchain program itself and is given to all the miners. When a miner solves the problem, it broadcasts the solution, which is verified by the other miners and once verified, that miner is then rewarded with the authority to produce the block.
I’ll try to make it clearer. Imagine that there are five accountants seated in a circle. Let’s call them A, B, C, D and E. Each accountant has a phone, pen, paper and a loose-leaf ledger (e.g. a ring binder where you manually add pages instead of a notebook that already has the pages bound together). In the middle of the circle is a mysterious printer which produces mathematical problems for each accountant to solve.
Now, all of these accountants are ambidextrous and are capable of writing with their right and left hands at the same time. Their left hand is always working on a mathematical problem and their right hand is always ready to write transaction details. Each time someone wants to make a transaction on the network, one or more of the accountants gets a text message with the details of that transaction, which they write with their right hand.
That transaction may contain something as simple as “transfer x amount of coins from account abc to account xyz” and then contain a verification key to validate that transaction (this is handled by the private-public keypair discussed in part 3).
The accountant who receives that message then broadcasts it to the other accountants who also write the details on their own papers. So with their left hand they trying to solve a problem while with their right hand they are recording a list of transactions. Now, let’s say accountant B solves the problem. He then announces the solution to the other accountants who then check and verify that it is indeed correct. Once verified, B then gets the privilege of making a final copy of the transactions, and then add that page to his ledger. The others will then make an exact copy of that page and add it to their own ledgers. In addition, B gets bonus pay for solving the problem.
Then the mysterious printer in the middle produces another problem, and the cycle begins again.
The accountants in that example are the equivalent of the mining computers that run the blockchain. Everything that I’ve described is done automatically by the program and requires no human intervention except for initiating a transaction, of course.
I should note that I have given a simplified narrative of the mining process and did not bother going into more details such as what if one of the accountants has malicious intent (simulating a hacked miner), or is it possible for a transaction to be excluded from the final list of transactions for a block, and so on. These issues would just confuse the novice. I guess it should suffice to say that many exceptions have been considered and addressed, and the more a coin matures, the more updated and upgraded its core code becomes.
I have also only discussed one type of mining — this one is called proof-of-work. There are other types of mining — proof of stake, delegated proof of stake, etc. Again this is to avoid confusion, and you may read more about these other methods once you have gained the basic idea.
Originally published in Sunstar Davao.
Email me at firstname.lastname@example.org. View previous articles at www.freethinking.me.