“In code we trust” - 2
First of all, thanks to everyone for reading, encouraging and supporting. In the previous chapter, we skimmed on the topics blockchain and cryptocurrency. But, how do I get cryptocurrency? Where is it available? Who is ‘issuing’ it? Here comes the concepts of ‘mining’ and cryptocurrency exchanges. Much like we mine gold or coal or any metal from earth, cryptocurrency is also ‘mined’ from the digital world.
Mining
As we saw earlier, to avoid an intermediary to validate transaction between 2 parties, and a common network of computers working on blockchain technology to ‘lock’ the transaction, it needs some infrastructure to be maintained and effort to be spent.
We talked about ‘validation’ of transactions. How is the the transaction actually ‘validated’? In a bank, if you issue a cheque to someone, the bank checks your account for the balance and then honours the cheque by transferring that value to the receiver's account. They also update accounts of both parties to reflect that movement of value.
In blockchain, the transaction validation is done by several computers (called ‘nodes’) interconnected in a network. These nodes are installed and maintained by people who are savvy about this technology or some entrepreneurs who see a big business opportunity. All nodes in the network hold an ‘entire’ copy of the ‘always updated’ open ledger (i.e. the whole blockchain). Whenever a transaction happens, say, to verify if the sender actually holds the money he wants to transfer, all nodes check the transaction against the ledger copy they hold. All the nodes almost simultaneously do this validation and if it is found to be true (by validating against their ledger copy) they all agree and a ‘consensus’ is arrived. Even if one of the node couldnt verify, the transaction is rejected.
This ‘consensus’ is an important aspect of the blockchain technology, as this is what is replacing the tradtional ‘trust’ we have with the bank or a central authority. This validation is also referred as ‘proof of work’ or ‘proof of stake’.
Once the consensus is arrived, next, the transaction needs to be updated into the ‘common ledger’. To do that, all these nodes compete to generate a new unique key with the alogrithm imposed by the network to ‘lock’ the transaction. This activity is more like soving a complex mathematics puzzle. To generate that unique key, which has not been used to lock any existing transactions, huge and faster computing power is needed. Whichever node first finds the unique key, locks the transaction. Immediately, the node updates its own copy of the ledger and also propagates to all nodes in the network and they all update themselves. All other nodes stop working on that transaction and wait for next transaction to come in. For doing this verification, locking, updation and propagation, the system ‘issues’ some cryptocoins to the node that did the job. This is what ‘mining’ is.
In short, a transaction comes in; various nodes in the network verify against the ledger copy they have and arrive at a consensus; with algorithms (like trying to solve a mathematical puzzle) solve a unique key, lock, update and propagate. Whoever finds the key first gets rewarded with crypto money.
One point here to note is, that ‘propagation’ and keeping all ledgers in the network is of paramount importance. Because this common update and shared ledger is the one that is backbone for the system so anybody can ‘trust’ the technology. And since it is quite difficult for us to move out of traditional governance systems to an autonomous governance that is run by the society as a whole. In a way, it can be viewed as ‘true’ democracy. Or technocracy?
By keeping a ‘common ledger’, apart from wider visibility, the other advantage of keeping a copy of the ledger in all nodes is a form of security too. Remember JPMorgan ledger got hacked!! Since it is not ‘shared’ and singly owned, it is difficult to verify and rebuild it.
Miners
The ‘nodes’ we talked above are owned by ‘miners’, who are part of this huge network. For every transaction they validate and update, the system ‘issues’ and they ‘earn’ some crypto money. This way, the work they do is incentivised and the network is up and running. The amount issued is not really fixed and it is at a varying rate. For example, it could be 0.00003 crypto per validation. As we read this line, some really good miners are earning about 25-30$ per day from a node. The earned crypto money is put into their ‘digital wallet’.
As more and more transactions keep happening, the network also enforces difficult algorithms to come up with the unique key (also referred to as ‘hash’) to create blocks and update the chain. In real world, generally, the currency issued by the banks are backed by a tangible reserve, like gold for instance. It controls the amount of notes issued and circulated so the value of money remains. Else, if the supply exceeds, inflation sets in. The buying power of money goes down. Similarly, the issue of cryptocurrency is also controlled by the network. It is expected that the total amount of cryptocurrency issued will be capped at 210 millions only. This way the value of the cryptocurrency will be maintained. So the network keeps tightening the algorithm.
Mining units
Mining is not an easy job. It is as tedious and laborious as we dig out coal from mines deeper than couple of miles below the earth. It is quite difficult. One, due to the high computing power it needs to solve a mathematical algorithm and generate that unique key. Second, with more and more miners getting into the business, it is more competitive. Whoever has greater and faster computing units, mines more. So what kind of computers do they use for mining?
Initially, the miners started using the regular PCs we all use. Then they started using graphic cards (GPU - Grpaphic Processing Unit) that had high end processors that were faster and could resolve difficult calculations, as they were typically used for redndering 3D grachics display. As the community grew and along with that the network also grew bigger, the need for even faster computation power also grew. ASIC got introduced. Application Specific Integrated Circuits. Processing units with chips ‘specifically’ made with ‘embedded code’ for resolving the algorithm and finding the unique key. There are customised mining units in the brand names Antminer, Bitmain etc which use the ASIC technology. These are many times faster, power hungry and generate lots of heat. So, innovative and quicker heatsinks (to remove the heat quickly and keep the chips cooler) are deployed.
These days, crypto currency mining has become a specialised and sophisticated business. Much like real world mining, there are mining farms, mining rigs... where multiple (in hundreds and thousands and more) mining units are installed which run 24x7. There are farms that consume electricity to the tune of 1MW a day!!
So much for mining. Where is ‘bitcoin’ here? Dont worry. Lets continue with bitcoin and other coins in next…..