Price: $0
Pools:
Epoch:
Slot: 137,088,072
Date: 11-10-2024

Articles

Must Blockchain be a slow and expensive Database? Cardano is going to rewrite History.

There are many myths in crypto-world. These myths are often kept alive by people who have an economic interest in supporting them. Let's take a look at one of them..

Cardanians.io 08-03-2020, 23:00 · 20 mins read
Share this

Paper will be used less and less to leave information for future generations. Databases can serve us well. The asset information will be in the blockchain.

For a long time, it has been said that blockchain is a slow, expensive, and ineffective database and that it cannot be used for anything other than cryptocurrency. In the article, we will explain why a database cannot be a blockchain and that blockchain cannot be necessarily slow or expensive unless it is intended to be. PoS network consensus can change it and Cardano builds one.

The database is not a blockchain

Let’s start by refuting one myth. The database will never be blockchain. To keep it simple, a database is a space for storing things. Your employer probably has a database and stores digital information about you. Every e-shop has a database keeping information about all goods, orders, customers, etc. Blockchain is a ledger. You can imagine the ledger as a balance sheet or an account book. It is a collection of things of the same kind and there is information about ownership. Digital ledger is able to keep a track of history and it is possible to get the latest valid state. As a user of a cryptocurrency wallet, the ledger can provide information on how many coins Alice or Bob owns.

Database. There is no network consensus and the admin has absolute control over it. Data is not owned by the user.

It is possible to create, read, update, and delete (CRUD operations) data from a database and all operations are fast and highly scalable. This is possible since there is only one node or server with the database and no network consensus is required. Thus every operation happens immediately. Blockchain is immutable so it is only possible to append new data without the possibility to rewrite history. Thus the history is always fully auditable. Blockchain is able to keep all transactions. Thus it is possible to go through all historical transactions stored in the very first block of the blockchain up to the end of the blockchain. Once the lastly added block is read you can see the current state of the ledger.

Once you are allowed to change data in the database and the data fulfill conditions the record is changed right away. There is usually only one copy of the database but a backup can be regularly done to avoid unexpected data loss. An administrator has full control over the database so data can be whenever changed by everybody with required privileges. A database, as a single point of failure, can even be hacked and data can be changed by an attacker.

To add new data into a blockchain, usually appending a new block, requires a distributed network consensus. Nodes validate a newly proposed block together with transactions and it will be permanently added into the blockchain only if the majority of nodes agree. After the agreement, all honest nodes will have the same copy of the ledger. So there is no central authority with the right to change the ledger. There is a bunch of independents operators, owners of validating nodes that actively participate in the consensus, and the decision power is distributed among all of them.

Database vs. blockchain.

The main differences between the database and a blockchain are that there are specific rules about how to validate transactions and append a new block into the blockchain. Moreover, the validation is executed on all full nodes in a distributed network. Honest nodes keep the valid state of the ledger. Data are only appended and history is immutable.

Data itself, for example, possession of ADA coins, is kind of locked to an owner. In other words, data are ownable and only the owner of a private key is able to change the ownership. To spend ADA coins from an address, only the owner of the corresponding private key is able to sign a transaction. The transaction is validated by all validating nodes and if it is correct (and the whole block is correct as well) then the ownership of coins is changed.

Blockchain is powerful when it is needed to immutably store information that for a user X a state Y is valid at time Z. It is very suitable for keeping ownership information about valuable things. For example, ADA coins, as we have shown above. The beauty of blockchain is that the owner really owns assets and even the network is not able to change that without the private key. Only the owner might initialize the change of the ownership via a transaction and the network only validates the request and can accept it by adding the transaction into a new block that is appended to the blockchain. The change of ownership happens fully in a decentralized way. It is something that is not achievable by a database. Within the database, there is always a central authority that you have to trust.

User X signed a transaction to change state Y at time Z. Blockchain validates the transaction and must come to a network consensus to accept the proposed change. User X really owns an asset and can change the state Y. Nobody else can do it.

Blockchain just immutably keeps the information about data and it can be public and auditable. It is easy for the network to guard a maximum number of coins or tokens since all data are stored in the ledger. Every full node is aware of the current state and can easily validate the correctness of proposed changes. As we said, nobody is able to change data in the ledger, for example, ADA coins ownership, except the owner. Thus, the distributed network is the trustless party between Alice and Bob when they want to interact with each other. The distributed network is trustless basically for two reasons: The network itself cannot change any data since the involved distributed consensus and owner’s signature are always required. In other words, if you own ADA coins only you are responsible for keeping private keys that allow you to spend the coins and nobody else is able to do it. The network just validates your wishes and act.

State Y, that user X can change, can be more than just ownership ADA coins. It can be any other issued fungible token or non-fungible token. Thus, blockchain is able to keep information about stocks, bonds, property ownership, game items, etc. State Y can even be a condition defined in a smart contract saying that if Alice sends a token Q to Bob then Alice becomes the owner of a token R.

 

Blockchain is very useful for holding nearly any kind of ownership information if it is possible to digitalize it. However, this feature alone is not enough and we need to work on other useful features as only a combination of multiple features will make modern distributed networks like Cardano even more powerful. In order to make even more use of distributed networks, we need them to scale. This means that many users can use them at the same time. So far it has been a problem and therefore the narrative appeared saying that blockchain is a slow and expensive database. If we are to talk about cryptocurrencies, something that people want to use on a daily basis, networks must necessarily scale. If transactions are to be slow and expensive, we cannot even talk about globally usable cryptocurrencies. Scalability, but also the programmability of money and tokens, closer links with the physical world and work with digital identity will open doors that we do not even know about today.

Let’s look at the reasons now blockchain is said to be slow and expensive.

Why blockchain tends to be slow and expensive

The reason why blockchain tends to be slow is very simple and straightforward. Distributed network consensus will always need more time than a database. The database just quickly validates a request and make the required changes right away. Scalability is not a problem. A distributed network needs more time since a node usually puts together a few transactions to create a new block. The block is afterward validated by other nodes. Every single consensus works a little differently. Some may be dependent on rich internal communication, another may be able to grant block creation rights to a particular node and then verify that everything is OK.

Proof-of-Work (PoW) is the first successful network consensus used in the cryptocurrency world with a block time set to ~10 minutes. PoW is very simple. All nodes interested in receiving a block reward try to win in a specific competition. All nodes try to resolve a difficult task that takes approximately 10 minutes. The task is very demanding on computing power and it is difficult to predict whether the task takes 2, 10, or 60 minutes. Only one node will win the competition. Once a node has resolved the task it just propagates the block to other nodes for validation. A part of the block validation process is also verification that the task has actually been solved so the block can be appended to the blockchain.

PoW is also very expensive and ineffective. The computing power needed for resolving the task requires a lot of electric power. To keep good competition fairness of PoW consensus the block has to have a limited size and into the limited size, only a limited amount of transactions can be inserted.

If we consider that a typical transaction could have ~250B, then 1MB block could hold 4000 transactions. 4000 transactions per 10 minutes give us 6,7 transactions per second. Bitcoin PoW is currently able to process not more than 10 transactions per second (TPS) and the reason is mainly the long block time (the time needed to produce a block).

Blockchain. Network consensus is required to change data. There is no central authority.

PoW originally was anti-spam or DoS protection that was introduced in 1993. A requester of service had to provide PoW, a piece of difficult and expensive work before the service was provided. Thus, an attacker could not spam the network since a generation of a higher amount of message would require a big amount of PoW so it would be expensive. PoW was not invented to be a network consensus. Satoshi Nakamoto used it since at that time it was hard to come up with some other reliable distributed consensus suitable for a global network. PoW is slow, ineffective, and expensive. Besides all the disadvantages, it works and it is very secure. PoW is simple and robust and it is very expensive to produce a fraud block. A potential attacker on the PoW network would have to have a very high hash-rate to pay off the attack. Security is considered the biggest advantage of PoW. However, PoW tends to be centralized.

We could consider 2 ways how to increase throughput, meaning to process more transactions per second. We could increase the block size to be able to insert more transactions into it or we could decrease the block time to produce blocks more often. Network latency makes it nearly impossible to increase the block size. If the block was too big then the propagation to all continents would take a long time. See below time needed for delivering 2Mb block from London to other parts of the world via TCP/IP:

  • Paris — 0.1s
  • US East coast — 1.1s
  • US West coast — 2.5s
  • Brazil — 3.0s
  • Korea — 3.4s
  • Australia — 5.3s

Increasing the block size will not be on the table for some time but in the future, it will be probably possible to increase it. So we have to reduce the block time. However, this is only possible if we use another network consensus and do not compromise security and decentralization.

PoS can be a fast and cheap consensus

It is expected that the Cardano Ouroboros PoS protocol consensus could manage to process 200–250 transactions per second. Other parameters of the consensus could be the block time around 20 seconds, more than 50% of staked coins required to commit the 51% attack, and approximately 1000 pools in the network.

Cardano Ouroboros PoS will fundamentally raise the quality of decentralization in public networks. The current situation is not very good when you consider that there are only ~10 significant pools in the Bitcoin network. Other major projects use DPoS, which has a fixed number of entities with the right to create a block. For example, EOS has 21 such entities and Tron only 26. Ethereum 1.0 uses PoW and regarding the number of big players, it is very similar to Bitcoin. Ethereum 2.0 will migrate to PoS to achieve better decentralization and scalability as well.

The quality of decentralization is the most important feature of distributed networks. Sometimes we can hear that it is not the quality of decentralization, but security. Well, we have a well-secured and centralized network today. The truth is that we need both decentralization and security. One without the other cannot work well in the long term. However, if we were to prefer one feature, it would have to be the decentralization. Cardano will set the bar for the quality of decentralization high. It will only be time to prove the quality of security. The IOHK team has long researched PoW and worked out how to deliver an equally secure PoS. This has been achieved thanks to long and detailed research. Now it is necessary to prove it to the whole world.

Processing 250 transactions per second are not still sufficient for a global protocol that has ambitions to be used for payment and even for more things. Cardano has one ace up his sleeve and it is sharding. Sharding is a way how to parallel transaction processing across multiple networks but still maintains a single consistent state.

Sharding is based on the assumption that all nodes in the network do not necessarily need to validate all transactions. Nodes can be divided into multiple subnets, units, or shards. Each shard will then validate only a portion of all transactions. If the network had 1000 nodes actively participating in the network consensus and they will be divided into 10 shards, the network could validate approximately 10 times more transactions. It is also probably possible to increase the number of nodes in shards. Thanks to sharding we can multiply the TPS of one blockchain by several tens, maybe hundreds. It might be possible to get to the necessary tens of thousands of transactions per second. For example, if Cardano has 10 shards, then the throughput would be 2 500 TPS.

Sharding: 4 shards, one state

Keeping the network consistent and uniform across all shards is demanding for synchronization among shards and the network latency is still a big enemy. Achieving parallelism in a distributed network environment is one of the biggest challenges for the IOHK team.

With sharding, Cardano can be decentralized, secure, and scalable on the first layer. It is very important from the point of user experience and overall reliability. Let’s have a look at some other alternatives on how to achieve higher scalability.

Update: Charles Hoskinson, CEO of IOHK, said in one of his AMA, that the team knows and is able to introduce sharding on the ledger level. However, the second layer solution Hydra was announced and it will be sufficient for 5–10 years.

Layered architecture

Basically, each project has two basic options to improve the current most pressing blockchain problem, scalability. The team can improve the network consensus on the first layer, or use another layer with different properties. An example of the first option is working on PoS and sharding. An example of the latter is to build a second layer such as the Lightning Network (LN). This approach is called layered architecture.

Bitcoin, as the representative of the first generation blockchain, chose the second option. The coins are passed from the first layer to the second layer, where lightning-fast and cheap transactions with much higher network throughput can be used. Lightning Network is a completely different, separate network with its own nodes, addresses, wallets, etc. Transferring coins to and from the second layer require on-chain transactions on the first layer.

However, this solution also has a few disadvantages. Once the coin appears on the second layer, the security of your coins is fully dependent on that layer. LN has no network consensus where nodes would try to agree on one version of the truth. Instead of this, there is an effort to ensure that the transfer of coins between layers is sufficiently secure and that the coins cannot be created from a thin air or lost within the established payment channel, for example between Alice and Bob. Security will be supervised by centralized entities called Watchers (as far as I know there is no incentive mechanism).

Now imagine the situation when Alice has opened the payment channel A with Bob to be able to send coins fastly in Lightning Network and Bob has opened another payment channel B with Carol. See the picture below.

Yellow beads represent coins. Any participant can send 3 coins to the counterpart via the channel. Notice that there is no direct channel created between Alice and Carol. If Alice wanted to send 3 coins to Carol then a new channel could be created via a slow and expensive on-chain transaction on the first layer. The second option is to use both already opened payment channels A and B. In this case, Bob coins have to be used to transfers value from Alice and Carol. In the end, Alice will have 0 coins, Bob will have 6 coins on channel A that is opened between. Carol will have 6 coins. Bob will have 0 coins on channel B that is opened between Bob and Carol. Bob has 6 coins before and after the transaction between Alice and Carol. However, his liquidity on channel B is now 0.

It basically means that Bob is no longer able to send coins to Carol and Alice is not able to send any coins to Bob. So if Alice wanted to send coins to Bob, channel A has to be closed and re-open again via the first layer transactions. The same is needed if Bob wants to send coins to Carol. Let’s add that all wallets must be online for the transaction between Alice and Carol to take place.

In order to send coins across multiple channels, there must be an entity in the network that is able to constantly monitor the current status of all channels and look for a route that can be used for the payment. With the increasing number of users and the number of channels, this can become an increasingly computationally challenging task and the process will probably lead to centralization. In order to send coins across multiple channels, the channels must have sufficient liquidity. Once the liquidity is exhausted, the channels need to be closed and reopened. LN is intended for microtransactions only. It can always be difficult to send larger amounts and some payment failures are probably unavoidable.

PoS vs. Second Layers

The second layers are definitely important and will be needed. On the other hand, LN is not necessarily a complete and sufficient solution to the scalability problem. Imagine that there will be multiple second layers, and those second layers will also exchange coins with each other. In this situation, it will be very difficult to trust how many coins or tokens can exist. The more second layer networks exist the more difficult it will be to synchronize data about the number of coins in circulation.

Having scalability resolved within the first layer via Ouroboros PoS is probably a more reliable and secure solution. Second and additional layers are also needed in a system where PoS will be used. However, the question always is how to ensure good security of the upper layers and how often and for how much it will be possible to perform settlement on the first layer. We urgently need to scale on the first layer, as this layer will always be the most secure. Keeping coins in the upper layers for a long time will not be reliable and if many settlements on the first layer are done frequently, the first layer may still clog and fees may be high.

Many people argue that PoS will never be as secure as PoW. IOHK mathematically proved that it is possible using modern cryptography. Maybe we need PoW and maybe also PoS. The adoption of open distributed networks is still very low and one of the often debated obstacles is the scalability problem. We have a solution. They are second layer and PoS with sharding. Now we just need time to try both solutions and make people choose.

The second layer like Lightning Network will probably always require the opening and closing of the channels and care for them in a sense of liquidity. The user has to consider with whom he or she opens which channel and how much funds are needed to put to them. If transactions on the first layer are expensive, it will be expensive to maintain the channels on the second layer. You don’t have to deal with this within the PoS. You’ll have all your assets in one wallet and you can send a direct transaction to anyone at any time. Everything happens right on the blockchain. There is no dependency on online wallets, liquidity, nodes searching for routes, and users do not need to rely on networks without blockchain, and network consensus. At least form a UI point of view, PoS can offer a much nicer solution.

Summary

Blockchain can ensure your ownership of assets. It is a great feature that the database cannot offer. For this feature to be universally adopted, it needs to be available technically. We can’t do it right now, but we’ll be able to do it soon. If people decide to make more use of blockchain and its possibilities, then the sky is the limit.

PoW advocates argue that PoS will not work. It is necessary to realize that PoW works well despite the fact that it was probably implemented by a single person during the year. A large team of professionals has been working on the Cardano protocol for over 5 years. There is no logical reason to think that they cannot succeed. It makes no sense to say that when we have PoW, we don’t need PoS. The market is still very young and people have not yet chosen what they want to use. It is always better to choose from more alternatives than to be forced to use one solution.

Source: Must Blockchain be a slow and expensive Database? Cardano is going to rewrite History.

Author Cardanians.io
We are cryptocurrency enthusiasts, especially believing in Cardano. We are official ambassadors operating staking pool. We write articles, translate them and develop tools for the community.
Support the Author 🙏
Author´s StakePool
Pool ID
Read next

Cardano grows in important stats

It can be difficult for people to make a good estimate of a project's potential. There are a lot of false narratives floating around in the cryptocurrency space. In this article, we'll look at the sta...

Cardanians.io 22-04-2022, 10:35 · 34 min read

Interview: Peter Gaži | Was the development of Cardano affected by the COVID-19 pandemic?

For our recent interview, we choose a developer from the IOHK team, which works on blockchain project Cardano. Peter Gaži is one of the academics in the team who works hard on Cardano to become the u...
20-07-2020, 12:51 · 8 min read · ritxi

How to use WingRiders on Cardano Main-net

WingRiders is an Automated Market Maker (AMM) decentralized exchange (DEX). The exchange has been launched on the Cardano main-net on 12 April 2022. In this article, we will show you all the important...
14-04-2022, 12:14 · 19 min read · Cardanians.io

How the WingRiders team is building DEX on Cardano

Decentralized exchanges are the foundation of any DeFi ecosystem. In collaboration with the WingRiders team, we talked about how such an exchange can be created on the Cardano platform. In this articl...
24-02-2022, 09:31 · 26 min read · Cardanians.io

From Simplicity to Complexity through Cardano

The adoption of new technologies is well described and we can observe certain patterns. There are similarities in the adoption of TCP/IP and blockchain. Let's have a look at what blockchain technology...
22-04-2020, 12:39 · 13 min read · Cardanians.io