Posts

Blockchains Explained Like You Are Five

avatar of @jerrythefarmer
25
@jerrythefarmer
·
·
0 views
·
5 min read

Alright class, I know that we started with a tough subject like DeFi lending platforms but I figured that we can't go any further before we understand the technology that is powering that mess we call DeFi. Blockchains...

What Is A Blockchain?

If you know what a ledger is you should be able to understand blockchains fairly easily. It used to look something like this...

It is also something that your local bank uses to keep track of how much money their clients have. When you make a purchase, the bank edits a digital ledger and lowers your balance for the corresponding amount.

When Bitcoin came along things stayed practically the same but the ledger became a bit more complex. Since we want a secure payment system that is also transparent, the ledger can't be controlled by one bank or one single entity. It had to be distributed to every network validator and it had to be updated only when we have network approval to do so, not when a payment is made.

But how do you get that approval?

The "No Cheating" Rule

Cryptocurrencies like Bitcoin and Ethereum have been created to try and solve trust issues in the online and offline economy. At their core, they prevent participants from cheating each other and cheating the system at the same time. This is done by distributing the ledger and implementing a consensus rule which implies that no change can be made on the public ledger unless at least 51% of the validators or miners agree to do so.

For Proof of Work chains, it would look something like this:

Imagine a classroom with 10 students that all have one simple assignment - to keep track of the money flow within the classroom. To do so they need a starting point so they will check everyone's pockets before they begin. Once we know how much money every student has we can write the first page of the ledger and mint the genesis block.

Now every student has the same data in front of them which is equivalent to a blockchain mining it's first block. All we need to do now is keep the tracking going by telling the students that they have 10 minutes to make transactions before the next ledger update starts or the next block is mined.

This is where fees come in.

Blockchains Are Pay To Play

Since we can't expect our students to keep track of transactions indefinitely for free, we need to provide an incentive for our ledger keepers. To do so we have block times and gas fees.

Block times determine the waiting time between ledger updates and gas fees make sure that these updates are worth your while, if you are one of the students.

To understand fees, imagine a few transactions taking place in the classroom. Someone sells a pen for one coin, someone buys a pencil for 3 coins and someone trades three coins for two coins for no specific reason... Stuff like that.

Depending on how many transactions the students can write down in 10 minutes, that will be our TPS (transactions per second) capacity. If our TPS limit is 10 and 11 transactions took place someone will need to pay more than what they offered to submit their transaction and data entry to the ledger.

Gas fees are essentially bidding wars between the people that want to submit their transaction in a specific block. In our example, 11 students want to submit 1 transaction per student into a block that can only carry 10 entries. To solve this problem we implemented a bidding mechanism and the 10th lowest bidder will win the last entry spot while the student that made the lowest bid will have to wait for the next block.

I always think of blocks as passing trains that have a limited capacity and a fluctuating ticket price that has no upper or lower limits. It is purely determined by supply and demand.

Mining Our Second Block

Now that we have decided who gets to submit transactions and who gets to wait for the next block, we can write down the transactions we all witnessed take place, compare our notes to the rest of the classroom and then have a vote if we agree that the data is indeed correct. If the majority says YES the ledger will be updated and life will move on.

But what if we run into corrupted data?

The consensus mechanism was put in place to easily deal with sporadical errors that may occur on the network. In our example, one student could have written down the wrong numbers and another could have missed a transaction completely. This is easily solved simply by checking what the majority of the students have written and using that as the absolute truth.

Those that made mistakes will need to update their ledger if they want to participate in the creation of the next block while the majority that got it right will simply move on.

How Can We Know If a Transaction Took Place?

From the examples so far it is easy to conclude that eyewitness testimony is not enough when it comes to finance. Bad actors will always try to trick the system and spend some coins they don't have in their wallets but this is also prevented by keeping your public ledger in check.

In the case of our classroom setting, we would collect all of the data regarding the transactions but before writing it down in our ledgers we would check the pockets of the students one more time.

Blockchains don't trust, they verify.

If we want to make sure Timmy and Billy didn't make a deal to try and trick us somehow, we will take their word first, but check their pockets immediately after. Since we have their starting balances written in the genesis block, we can easily know how much money they actually spent by physically checking their pockets and wallets.

If Timmy says he spent 2 coins on a pen and they both had a starting balance of 5 coins, Timmy should now have 3 and Billy should have 7. If that is not correct something is wrong and the children are lying, thus their transaction submission will be deemed invalid by the bookkeepers and only the real balances will be written down.

Blockchain Wallets Aren't Real

To wrap this up I will share one more fun fact before we part ways.

Blockchain wallets are mostly seen as a piece of software that holds your coins but in reality, they don't hold anything, they just translate blockchain language to human language.

Every Bitcoin that you own is still sitting on the Bitcoin blockchain. No matter how far you send it or on what exchange you deposit it, it will still be sitting on the same blockchain. The only thing between me and your Bitcoins is the recovery phrase that you have written down. Whoever controls the keys controls the bitcoins.

So, when you install a wallet and enter the recovery phrase, it doesn't magically transfer the BTC from your old wallet to the new one, it just displays what the blockchain says that your balance is. And by providing it with your keys you give it permission to move these coins from one address to another, when you tell it to do so.

Have any questions regarding the article or need a different concept explained like this?

Leave a comment below to share your curiosity and thoughts!

Posted Using LeoFinance Beta