I was at ITB recently (travel conference) and after a session on blockchain one of the audience members said she still did not understand blockchain.
The presenter tried to explain it but left the audience more confused.
…I’m going to have a go at what the presenter failed at. There’s 21 questions worth answering about it…
1. What is blockchain in simple terms?
A lot of information is stored in databases. Typically (not always) you have one master copy of this database and databases are not too difficult to hack.
For blockchain the transactions are stored in blocks. You can have many transactions in a block. A block is part of many blocks that are linked to together…hence…the name blockchain!
When you use blockchain a copy of all transactions (stored in blocks) is created in many different places and the way it is setup means it’s very difficult (not impossible) to hack it and create fraudulent transactions.
Think of blockchain like a spreadsheet with a list of all transactions and there’s many identical copies of this spreadsheet in many locations. To add a transaction to a sheet it’s not just one authority (i.e. a bank) that decides if a transaction is valid it is validated by hundreds or thousands of computers and they all keep an exact copy of the transactions. The way blockchain is set up is very hard to create fraudulent transactions.
Some words you’ll often hear when talking about blockchain:
Mining – These are the computers that get rewarded for validating transactions and get paid for doing it.
Public Ledger – The ledger is the transactions and public means that no one central authority controls everything.
Distributed – When transactions are verified it could be using computers all over the world and not in a central hub.
Ye there’s more to it than that but read on…..
2. What’s the basic sequence for a blockchain transaction?
- Someone raises a transaction requested.
- This is represented in a block
- Nodes on a network (i.e. computers) are watching for new blocks.
- All nodes try to solve a mathematical puzzle (which I’ll explain later)
- The first to solve the puzzle gets rewarded and the rest of the nodes validate the transaction. Now it’s part of the blockchain
- The transaction is completed
3. What type of transactions can you process on blockchain?
A transaction refers to a contract, agreement, transfer, or exchange of assets between two or more parties.
You transfer some bitcoin from one person to another…or….
The ownership of a car is transferred based on certain conditions met according to the ‘contract’. So what’s stored in blockchain is proof of ownership.
4. Why is it called ‘Blockchain’ ?
The Block’ is where you store the transaction information and when the block is full another block is created that is linked to the other block… and voila we have a chain… a Blockchain!!!
5. What is the structure of a block?
Here is the structure of a block which also shows the connection with previous blocks.
This contains the following:
- Hash of previous block – This is basically a reference number for the previous block. When a previous block becomes full of transactions the next set of related transactions are added to a new block and the previous one is referenced (i.e. Blockchain….get it!!!)
- Time stamp – This is the exact time at when the block was created
- Nonce – This is an abbreviation for number used once. In blockchain this is a random number which can only be guessed and can’t be calculated. When a transaction needs to be verified the nonce is created and to verify the transaction the computers in the same network need to guess what the nonce is.
- Merkle root – Every transaction occurring on the blockchain network has a hash associated with it. However, these hashes are not stored in a sequential order on the block, rather in the form of a tree-like structure such that each hash is linked to its parent following a parent-child tree-like relation.
This is where all the transactions are stored.
6.What is a blockchain validator?
A validator is how transactions are verified. There’s a couple of different methods of validating transactions, here are 2 popular ones:
- Proof of work
- Proof of stake
7. What is proof of work?
When transactions are initiated they are queued on the network to get validated. The validators are keeping an eye out for transactions and batch some into a block.
In a blockchain network you could have thousands of validators and they are all trying to validate transactions. However, what you want is one to validate and then the others to verify.
So how do you validate….
A nonce is a number only used once.
Within the block there is a nonce and all validators have to try to guess this nonce. They are solving a mathematical puzzle.
This takes up a lot computational power (and electricity) as all the nodes are competing.
When one node figures out the nonce they get rewarded and can add the block to the blockchain.
But the majority of the other nodes on the network need to confirm they are happy with this new block. This is called consensus.
This diagram shows this process. Later on I’ll explain the encryption.
8. Why is there a mathematical puzzle for validator to add a block to the blockchain?
The main reason for this is to stop spammers, spoofers etc setting up and validating transactions.
To validate a transaction it takes time and it costs money (hardware, electricity etc). If a spammer want to get transactions onto the block chain they’d have to own enough computers on the blockchain to achieve consensus (e.g. at least 51%). This would be extremely expensive.
They could set up one machine and may solve the puzzle but every other nodes needs to agree that it’s confirmed as part of the blockchain.
This method of validating was initially created to slow down the sending of email so spammers couldn’t send massive amounts of spam very quickly.
9. Is proof of work scalable?
No absolutely not!
The proof of work system does not make sense because if transactions on public blockchain grew massively we’d be taking a noticeable percentage of the world wide electricity available!
Bitcoin is by far the biggest cryptocurrency that still uses proof of work and will probably stay that way.
But Bitcoin will never have a huge amount of transactions. It’s not a currency that is typically used for buying and selling stuff, storing title deeds, digital art etc. It’s typically just people gambling on bitcoin buying and selling it.
Proof of of work is totally unscaleable and it’s a pretty dumb system when you want something long term that will grow as more transactions occur on blockchain.
Etheruem are the second biggest cryptocurrency and they just moved from proof of work to proof of stake. They will save 99.95% electricity!!
10. How many transactions per second can be processed on bitcoin using proof of work?
The average number of transactions that can be processed for bitcoin on a blockchain network is 5 per second.
The average number of transactions that can be processed for Visa (not blockchain) – Between 1,500 and 2,000.
Euthereum processed around 30 transactions per second using proof of work but their recent move to Euthereum 2.0 means they can process 100k transactions per second. This massive increase is mainly because of proof of stake and sharding. I bet you now want to know what both of these are….
11. What is proof of stake?
Proof of stake is a more sensible approach to validating and storing transactions on block chain.
To participate as a validator you need to put up some cryptocurrency which is locked and you can’t touch it. This stops all the fraudsters.
When there’s a transaction on the blockchain a node is selected based on multiple factors one of which is how much they have staked (i.e. put up as collateral). If it ends up that they are fraudsters they can lose all the money they staked.
So instead of having thousands of nodes trying to compete to process a transaction proof of stake selects one.
Proof of work is so dumb for delivering a scalable solution…
12. What is sharding?
Most cryptocurrencies now use proof of stake to process transactions. But Euthereum also introduced sharding which enables to them process even more transactions per second.
Sharding is breaking up blockchain into smaller chunks which improves performance. Each chunk is called ‘Shard’.
SHARD is an old database term which means system for highly available replicated data.
13. What are the 3 types of blockchain?
Aha…that’s a good question!!!
Not all blockchain is public. So there’s the 3 types:
Public blockchain – Anyone can participate in a public blockchain.
Private blockchain – You can only participate if you have permission to join. For example, a company could run a private blockchain for their own business
Consortium (or federated) blockchain – This is where the consensus process (i.e. who validates the transactions) is controlled by a preselected group of nodes
14. What is a mining pool?
Under proof of work the validators are called miners. A mining pool is where a group of miners put their computational resources together (i.e. all their computers are part of one group) so that they have a better chance of being the first validator of a block and hence make more money.
15. What encryption is used for sending blockchain transactions?
Hashing is taken any input of any size (e.g. a block with lots of transactions) and producing an alpha numeric string that’s always the same length.
So there’s a unique hash that uniquely identifies the block.
Within a block it contains the hash of the previous block so if there’s any tampering of any block that is part of the blockchain then it’s spotted by one of the validators. This is because if there’s any change to any block in the block chain the hash for that block will change.
This is a type of electronic signature that is used to authenticate the sender of a message. When a user wants to make a transaction on blockchain they must sign it with their private key. The public key is then available for nodes to decrypt this message to verify the originator of the message.
Think of a bank account. It’s ok to share your bank account details with someone so they could transfer money to you (public key) but you won’t share your login details to that same bank account! (private key).
16. Is blockchain so secure that it can never get hacked?
Ah ye…that’s a good one!!
There is a strong emphasis on security but that doesn’t meant to say it can’t get hacked. Here’s some examples:
Phishing attacks – Users get spam emails looking for their credentials and then they hand them over not knowing is a phishing attack
51% attacks – If a group of miners get together and have over 51% of the blockchain mining power they can take over the blockchain.
Routing attacks – This is where real time data transfers are intercepted.
17. What is immutable?
Immutable means the data has not been manipulated, replaced or falsified. It’s a permanent record of a transactions that cannot be altered.
18. What’s a smart contract?
These are digital contracts stored on blockchain that automatically get executed when predetermined terms and conditions are met.
If x money is transferred from A to B to buy a car then the ownership document of the car gets updated with the new owner.
19. What’s a genesis block?
This is the first block in a blockchain and hence it won’t have a reference to a previous block…because…there isn’t one!
As it’s the first block it does have some additional information such as configurations and rules for the smooth running of the blockchain.
20. What’s a transaction pool?
This is a list of pending transactions waiting to be validated on the blockchain network.
Once a transaction is taken from the pool and verified it’s important that every node is made aware so they can validate and this will keep all nodes in sync.
21. Is there a future for blockchain?
I think most crypto currencies will fail because most offer not value at all.
I think blockchain has made some improvements to validating that will significantly increase it’s chances of success (e.g. proof of stake and sharding).
But I think more improvements are required and there’s a big issue with people not being able to understand the technology.
So yes there’s a future but make sure to seperate blockchain and cryptocurrencies. Digital currencies provided by the Government will replace most cryptocurrencies and these digital currencies will be exchanged over blockchain.
I’d love to hear your thoughts over on LinkedIn. Please share and tag me.