News

Back

Blockchain explained like it’s your birthday

Everyone loves a good old celebration so let’s forget about the blockchain for a second and wander into birthday-land. Picture this; it’s your birthday and your best-friend hands you a shiny new gold wristwatch. Technically, from the moment the gift is handed over, you gain a watch and bestie loses one.

That’s an easy transaction to validate right?

You know the watch is now yours because, from time to time, you can feel it weighing down your wrist. Bestie on the other hand knows she has given up a watch because the credit card statement says so. If bestie secretly had another BFF she wants to gift an identical watch, there will be no way to avoid the purchase of another piece; except of course she knows some juju priest that could magically duplicate the one in your possession.

Now let’s assume that bestie decides to send you an e-card instead. This will be very convenient to distribute since that same digital card can be resent at no extra cost. In order words, unlike the physical gift, the e-card can be easily duplicated and sent to multiple friends. So the question is, do you really own the e-card? Most likely not; you probably only have a copy in your possession.

Hold that thought for a second while we make things a bit more complicated. This time, let’s say the e-card was being received from a stranger, and it would sent only in a few days’ time. You can’t even trust bestie not to “double-send” not to talk of Dr. Strange. Since nothing hurts more than being on the receiving end of mass produced e-cards [sic] we are going to make sure Dr. Strange signs a contract stating that you will receive a unique e-card and that card would be permanently deleted immediately after it has been sent to you. Case closed!

But wait a min; not just yet. Dr. Strange didn’t hold on to a copy of the contract so you can easily help yourself with a more favorable gift. A few Tipp-Ex strokes later, from being owed an “e-card”, you are now entitled to an “e-car ”. Imagine the horror on Dr. Strange’s face when he’s served a lawsuit for failing to deliver a Tesla vehicle as a birthday gift. Only if he was careful enough to demand a copy of the contract.

Alright. Time to snap out and critically examine this rather hectic birthday tale. The solution to receiving a unique digital gift, and avoiding any funny games in the process, is to permanently delete other records of gift’s existence the moment it is forwarded to you, and agreeing on this term in a contract. Copies of the contract will have to bee held by multiple parties. Well, the automation of this process is basically the core functionality of the blockchain.

The blockchain was originally developed as a solution to the “double spend” problem faced by digital contents, and more particularly encrypted digital money — commonly known as cryptocurrency. The solution is basically to ensure that once a unit of the currency is sent out to a particular address, all other records of its existence are destroyed according to the terms of a predefined contract. This contract is in form of a code that is simultaneously executed on millions of computers connected to the network. After every transaction, the location of all available units of the currency is also simultaneously updated across the network. In essence, the copies of the contract are held in all computers within the network, hence the “distributed ledger technology” tagline. And since the system is technically powered by millions of computer, it is virtually impenetrable.

The first blockchain ever developed was used as a proof-of-concept for distributing digital money in the form of Bitcoin. However, the blockchain can be used to automate the distribution of any digital content. For instance, in the case of your e-card, the solution will resemble: the card would be broken down into a million pieces and each piece is stored in a separate computer. Then a code is written to instruct all computers to send their piece to your email address, when date = “your birthday”, and permanently delete the piece from their end. After the transaction, the next update of the records will confirm that you are now the unique owner of the ee-card. Cool right?

In the simplest form (SQL and HTML so everyone can read along), the code that will be executed on you birthday, in all of the million computers connected to the network, will look like this:

1. If ( date == “2018- 05-10”)

2. { post (“birthdaygirl@skannet.com”, “e-card”)}

3. DELETE FROM database

4. WHERE gift_name= “e-card”

In plain words:

1. If the date is 2018-05-10 go to line 2, else, do nothing

2. Send the e-card to the email address “birthdaygirl@skannet.com

3. & 4. Delete the e-card from data based

Once you and Dr. Strange agree on this “smart contract”, you guys just have to wait till it executes. No fishy business, no disputes, no lawyers required.

The same concept could have be adapted if Dr. Strange was selling that unique e-card to you. Basically, all we would need to do is to include another line of code to incorporate a condition that the e-Card would only be sent after Dr. Strange received payment. Technically, that line of code replaces the requirement of a bank. Plus, unlike the bank, this code is smart enough to validate the complete transaction i.e. it also ensures that you receive an e-card once the terms are satisfied.

Note: this blog was inspired by the “Explain blockchain like I’m 5” article published by Nik Custodio on freecodecamp.com