What is blockchain exactly – conceptually and practically speaking?

109 views

Sorry I know this may be an outdated question to ask but would love to understand the tech and concept in a practical way. I’ve found “Decentralised ledger” is just a buzzword that is thrown about to this question, without any context or explanation…

In: 1

Anonymous 0 Comments

Decentralized ledger is actually a pretty good description, if you know what a ledger is and what decentralized means, in the context of currencies.

Starting from the top, a blockchain is a chain of blocks.

Each block is basically a short-ish list of transactions, each essentially saying “the owner of account AAA has authorized a transfer of XXX to account BBB”.

To ensure that this is actually true (i.e., the true owner of the account has actually authorized that transaction), each account is associated with a public/private pair of cryptographic keys and the transactions are signed with it.

If you are not familiar with asymmetric cryptography, it’s not really important, ELI5: each account has a special secret number that is used as the key of the account. Using that key, we can generate a new number for each transaction called a signature that is unique to the transaction. Using clever math with another special number (that is public and cannot be used to guess the secret one), we can prove the person who generated the signature actually knew that key.

Each block references the “name” of the previous block, so like links in a chain, the blocks are all linked together. Hence blockchain.

The “name” of a block is actually a cryptographic hash of the block: using more clever math, we can generate what is basically a summary of the previous block that would be different if we change even one bit in the block.

There are a few rules to generate new blocks, we’ll get to that later. However, once a block has been generated, for it to be valid, there are a few things that need to be respected:

– every transaction in it needs to be valid:
– both accounts need to have valid account number
– the account the money comes from must have sufficient funds
– the transaction needs to be signed by the owner of the account where the funds are taken from.
– the “previous block” of the new block cannot be already referenced as the previous block of another existing block.

All the blocks together form a list of all the transactions that ever occurred using that currency. This is what is called a ledger. You can determine the balance of any account simply by reading the blockchain and adding together all the transactions involving that account. (There might be a few more subtleties here, but they are quite beyond an ELI5).

So now we have a ledger. What about a decentralized one?

Well, banks and CC companies have ledgers of all their accounts as well. They don’t list all the transactions in a given currency (which is basically impossible as soon as the currency is available as physical cash), but they will list all the transactions involving their accounts.

These ledgers don’t necessarily have the format of a blockchain, because the cryptographic operations are quite costly and they don’t really need what it provides. See banks and CC companies are directly responsible for both authenticating new transactions and adding them to the ledger. So they have their own historical infrastructure to do that.

Since a single entity (the bank or the CC company) is responsible for the ledger, it is centralized.

Cryptocurrencies and blockchains do not have a single entity responsible for maintaining the ledger and authenticating transactions.

Each account owner is responsible for authenticating their transaction (using the bit of clever math we discussed earlier) and basically “anyone” can add a block to the chain.

So that’s a decentralized ledger.

Now, there is still one detail I’ve left out, how to create a new block while keeping the chain clean and easy to use.

See, if anyone can just add a block to the chain, it’s going to be chaos. So we need to slow things down a bit so new blocks have the time to be seen by everyone.

Also, not everyone will double check that transactions have the proper amount of funds available, this is a costly operation that requires quite a lot of resources. Most of the time, we expect this to have been checked when the block was added to the chain. Someone malicious could just churn out blocks of transactions without the proper funds and make the whole thing unusable.

There are two basic ways to create new blocks and ensure this is done in a way that will keep the system in good working order: Proof of Work and Proof of Stake.

Proof of Work is the most well known and the most common: to be able to create a new block, you need to solve a complicated math problem based on the content of the block. This ensures that a reasonable amount of time will occur between two blocks and only people who invested a significant amount of money and resources in the system will be creating new blocks.

Since people will have invested money in the system, they have interest in keeping it in working order. In order to offer a return on investment, typically creating a new block and solving the difficult math problem will also create a small amount of currency that the person who created the block can claim.

Proof of Stake is simply requiring that the person generating the new block proves they have an account with a significant positive balance. Since they have so much currency in the system, they have a pretty good incentive to keep it working.

This usually comes with some sort of slowing down mechanism (i.e., you have to wait 5 blocks approved by someone else before creating a new one or something).

So there you go: A blockchain is a decentralized ledger organized in blocks, linked together like a chain. The integrity of the whole thing is ensured by relying on cryptography (all the clever math bits).

Also, I’ve talked about accounts and currency, but ledgers can be used to keep track of basically anything (currency, stocks, copyright licences, software), so blockchains have the same versatility.