ACM JUIT BLOGS and
Get Daily Updates and Blogs of future technologies!!
Unless you’re hiding under the rock, I am sure you’d have heard of Bitcoins and Blockchain. After all, they are the trending and media’s favorite topics these days — the buzzwords of the year. Even the people who’ve never mined a cryptocurrency or understand how it works, are talking about it. Blockchain: why do we even need something this complex? Instead of first defining the Blockchain, we’ll understand the problem it solves. Imagine, Joe is your best friend. He is traveling overseas, and on the fifth day of his vacation, he calls you and says, “Dude, I need some money. I have run out of it.” You reply, “Sending some right away,” and hung up. You then call your account manager at your bank and tell him, “Please transfer $1000 from my account to Joe’s account.” What just happened? You and Joe both trusted the bank to manage your money. For years, we’ve depended on these middlemen to trust each other. You might ask, “what is the problem depending on them?” • What if that register in which the transaction was logged gets burnt in a fire? • What if, by mistake, your account manager had written $1500 instead of $1000? • What if he did that on purpose? Is there a way to maintain the register among ourselves instead of someone else doing it for us?? For our example, we will assume ten individuals want to give up on banks or any third-party. Upon mutual agreement, they have details of each other’s accounts all the time — without knowing the other’s identity. 1. An Empty Folder All these ten individuals will keep adding pages to their currently empty folders. And this collection of pages will form the register that tracks the transactions. 2. When A Transaction Happens Now, if #2 wants to send $10 to #9. To make the transaction, #2 shouts and tells everyone, “I want to transfer $10 to #9. So, everyone, please make a note of it on your pages.” 3. Transactions Continue Happening As the time passes, more people in the network feel the need to transfer money to others. This exercise continues until everyone runs out of space on the current page. 4. Putting Away The Page Before we put away the page in our folders, we need to seal it with a unique key. It is called ‘mining’ on the page to secure it. Interesting! How do we seal the page then? Imagine a machine surrounded by thick walls. If you send a box with something inside it from the left, it will spit out a box containing something else. This machine is called ‘Hash Function’. Suppose, you send the number 4 inside it from the left, we’d find that it spat out the following word on its right: ‘dcbea.’ How did it convert the number 4 to this word? No one knows. Moreover, it is an irreversible process. Given the word, ‘dcbea,’ it is impossible to tell what the machine was fed on the left. But every time you’d feed the number 4 to the machine, it will always spit out the same word, ‘dcbea.’ The most important property of such machines is that — “Given an output, it is extremely difficult to calculate the input, but given the input and the output, it is pretty easy to verify if the input leads to the output.” How to use these machines to seal a page? We just input the page and its content into this machine and Volla we have a random (very!!! Random) output. If anyone wants to verify whether the page was altered, all he would have to do is — add the contents of the page with the sealing number and feed to the magic machine. If the sealed number was the output then the contents were untouched. When a new paper is to be sealed calculations are done to find the seal number and is announced. Everyone verifies if it yields the content or not. If it does, everyone labels their pages with this number and put it away in their folders. But what if for someone, say #7, the sealing number that was announced doesn’t yield the required output? Such cases are not unusual. The possible reasons for this could be: • He might have misheard the transactions that were announced in the network • He might have miswritten the transactions that were announced in the network • He might have tried to cheat or be dishonest when writing transactions, either to favor himself or someone else in the network No matter what the reason is, #7 has only one choice — to discard his page and copy it from someone else so that he too can put it in the folder. Unless he doesn’t put his page in the folder, he cannot continue writing further transactions, thus, forbidding him to be part of the network. Then why does everyone spend resources doing the calculation when they know that someone else will calculate and announce it to them? Why not sit idle and wait for the announcement? Simply imagine, if #5 calculates the sealing number of a page, he gets rewarded with some free money. That’s how Bitcoin got into existence. It was the first currency to be transacted on a Blockchain (i.e. distributed registers). And in return, to keep the efforts going on in the network, people were awarded Bitcoins. When enough people possess Bitcoins, they grow in value, making other people wanting Bitcoins; making Bitcoins grow in value even further; making even more people wanting Bitcoins; making them grow in value even further; and so on. And once everyone tucks away the page in their folders, they bring out a new blank page and repeat the whole process all over again — doing it forever. [Jargon Box] Think of a single page as a Block of transactions and the folder as the Chain of pages (Blocks), therefore, turning it into a Blockchain. And that, my friends, is how Blockchain works. And Now The Con’s Obviously 1.Adulterations to Block Imagine there are five pages in the folder already — all sealed with a sealing number. What if I go back to the second page and modify a transaction to favor myself? The sealing number will let anyone detect the inconsistency in the transactions, right? What if I go ahead and calculate a new sealing number too for the modified transactions and label the page with that instead? To prevent this problem of someone going back and modifying a page (Block) as well as the sealing number, there’s a little twist to how a sealing number is calculated. In reality, to calculate the sealing number in a Blockchain, instead of two boxes, there are three — two pre-filled and one to be calculated. And when the contents of all those three boxes are added and fed to the machine, the answer that comes out from the right side must satisfy the required conditions. With this neat little trick, We just saved the system. Therefore, if someone has to modify a historical page, he would also have to change the contents and the sealing number of all the pages after that, to keep the chain consistent. (In this example a consistent bank statement) What will happen is, from the page the dishonest guy tries to cheat, he would be creating another chain in the network, but that chain would never be able to catch up with the honest chain — simply because one guy’s efforts and speed cannot beat cumulative efforts and speed of nine. Hence, guaranteeing that the longest chain in a network is the honest chain. Longest chain is the honest chain. 2.What if, instead of one, six guys turn dishonest? In that case, the protocol will fall flat on its face. And it is known as “51% Attack” , it is built on the assumption that the majority of a crowd is always honest.