This article is the followup to “Beginner’s Guide to Blockchain: Explaining it to a 5 year old”.
In this article, we will continue with the example of parking garages presented in the part I to explain the concepts of Cryptocurrencies, Mining and Smart Contracts.
Everyone of you must have heard at least once about any type of X-coin whether its Bitcoin, Litecoin, Ether or any other coin. What are these? These are cryptocurrencies, getting their names from cryptography - the concept that powers the underlying technology of your favorite coin. But, why we need these digital coins? Apart from sending money to your friends or receiving some from them, these coins are used to incentivize the computers on a Blockchain network. Woah! To much of technical jargon!! Let’s move back and bring in our parking garage example in to the picture. :)
If you remember from previous article, we mentioned that garage owners will rent their parking spaces to those in need. Now, you might be thinking, how would a lessee pay the lessor? Simple! through the bank transfer. But why would someone share their bank details with a stranger in case they are renting their garage? That’s a valid question.
Let’s solve this problem by using a Paypal (or any other digital Wallet). The garage owner uses their Paypal email address to receive payments. This way they don’t have to share their bank details to strangers. Did you notice something in this situation except privacy? Yes! anonymity. By using an email address to receive payments, the garage owner can stay completely anonymous to the tenant and same goes for the tenants as they will also be paying from their Paypal accounts.
Now, let’s compare this with cryptocurrency. In crypto world, it’s almost the same except with a small difference that instead of using an email address you use a Bitcoin or Ethereum or any other coin’s wallet address, which is unique to you. You send the coins from your X-coin wallet to the receiver’s X-coin wallet. Since, the network is full of strangers so revealing bank details for money transfer would be a big problem. Therefore, using wallet addresses facilitate the users to send and receive payment by staying anonymous to everyone on the network and this is also one of the reasons why some countries have banned crypto or why it is very popular in the illegal world.
If you are with me till this point, I am sure you must be thinking that you can transfer money from bank to Paypal but how does that happen in crypto world? Let’s look in to this!
Now, let’s modify the current scenario. Imagine that there are 200 houses in your city and all 200 houses have two garages each. However, to simplify our explanation, let’s assume each house just has one car (all cars filling up all the slots of big parking space described above). So, each house has one empty garage out of the two garages available. Now, let’s say people of the city decide to rent out the extra garage to anyone who needs a parking. This model of providing parking space will solve the problem of parking 200 cars or more cars (in case people move in and out of the city) without the need of building any central bigger parking space for the entire city. Similar to the previous scenario, let’s analyze this scenario -
Just like transferring money from your bank to Paypal, you can transfer money from your bank to you X-coin wallet by buying coins from some registered Exchange. But, the question here is, how the first X-coin came into existence or how new coins are added to the system? But before we answer this question, let’s take a look at another familiar term “mining”.
If you remember, in the previous article, we talked about computation (process to calculate lock-key pair) and validation (process to check if a lock-key pair is correct or not). Let’s assume that all the garage owners participate in the process of calculation of a new lock-key pair, which requires lots of computing power (brain power) and time (Just like those tricky calculus questions you got stuck at during your high school). So, the rule of this game of computation is whosoever calculates the correct value first, wins! (Just like a quiz round in your high school you can say!). This entire process of computing the correct lock-key pair is termed as “mining”.
But why would a garage owner spend time to work on computing a lock-key pair? We need to incentivize them! Let’s assume that the winner gets a cash prize, similar to the cash prize you got after winning the quiz at your high school.
Did you notice one thing here? The prize money is the money that wasn’t with the garage owners before (or you can say it wasn’t a part of the parking system before). It is the fresh or the new money that was introduced to the garage parking system after mining in the form of prize money. Now, let’s use this analogy to understand the mining in crypto world.
As you know from the previous article that all the blocks in blockchain are safeguarded by hashes, which are calculated based on previous block’s hash and current block’s data. Thus, binding all the blocks in a chain. This hash computation is resource intensive because it requires you to hit and trial every possible value to get a correct hash (just like what garage owners did). So, the more values you can try per second, the faster you will be able to compute the correct hash (This is why you might have seen your friends buying big machines to mine Bitcoin or any other X-coin).
But the same question arises again, why would someone lend their computer to the X-coin network to perform these resource intensive computations? Correct! the same answer - incentives. Any computer that is able to calculate the correct hash first is awarded with a new X-coin. This new coin wasn’t a part of the system before. This is how the new coins come into the system.
Well, all the cryptocurrencies are considered to be digital assets or commodities just like the Gold or the Silver or any other metal or mineral. Since, the process of extracting these metals from their mines is known as mining, the cryptocurrencies computations also got the name “mining” because mining brings a new coin to the system.
Now, let’s move out of the cryptocurrency world and dive in to application development on Blockchain!
If you remember, I mentioned in the part I of this article about researchers realizing the benefits of the underlying technology of Bitcoin (which is Blockchain) for different applications apart from just cryptocurrencies. This is where smart contracts can be useful. Before we dig in the technical side. Let’s continue with our parking example. For a moment let’s assume that there is no prize money included for mining winners (Why? we will discuss in the next section).
Consider that, you have to pay for moving your vehicle into the garage. So, to simplify that, every garage has a fee collecting machine outside it which allows you to read a barcode using your phone and send in the payment from your Paypal. This machine collects the money and as soon as the garage is closed all the garage owners start computing the lock-key pair (mining) and once that garage’s lock-key pair is generated, the machine sends that money to the garage owner who won the mining contest.
The fee collecting machine in the above scenario is a smart machine because it figured out on its own, whom to send the collected money once lock-key pair was generated. And in case anything buggy happens like, a technical error, the machine refunds you the money and either you can pay again or can take your car out.
Similarly, on Blockchain this smart machine is called smart contract - a piece of code that does everything for you on blockchain. As all garages have smart machine, all the computers on the Blockchain have a copy of the smart contract. So, when you send money, it makes sure that you have enough money to send and the receiver gets the money and in case of any error, it just reverts the transaction.
However, smart contracts are not just for money transactions, you can use them to store or modify data on the Blockchain which can be Youtube like model for videos (such as Viuly), or a dropbox type model for storing files (such as Storj.io or SiaTech) or even games like Cryptokitties. The list of use cases is endless!
Do you remember that in the previous section, we assumed that there is no prize money to the winners for computing correct hash value. This gives birth to a new question - Why would someone rent out their computers in case they will not be rewarded with any new coins? Yes, you know the answer. Just like, the fee collecting machine outside the garage collected money and gave it to the winning garage owner, every transaction on the Blockchain costs a very small fraction of money. This small fraction is deducted from all the transactions. When a block on the Blockchain is mined ( its hash is computed by all the computers on the network), the computer winning the mining contest, gets the money deducted from all the transactions mined in that particular block (each block contains a fixed number of transactions) as a reward or incentive. This keeps the crypto model sustainable even after no new coins are issued. Now you know why your friends are buying big machines!
Bravo! You finally acquired the basic knowledge about the Blockchain and its components. I hope this series of articles helped you strengthen your foundations in this emerging technology. From here on, if you are a tech person, you can start learning about developing applications on Blockchain or even setting up your own Blockchain.
However, if you are a non-tech person, you can start looking out for problems that can be solved using Blockchain. This will help you deepen your knowledge about the application part of this amazing technology