The concept of scalability is very critical for blockchains and is bottleneck in blockchains. The main goal of many projects is to ensure scalability, and when this is achieved one of the best versions of the network is expected to appear. Scalability is a non-trivial issue. So it's more accurate to look at it in three sub-concepts. These concepts: Throughput (Efficiency), Finality (Precision), and Confirmation Time.
Throughput is a measure of how many units of information a system can process over a given period of time. Finality is the case where a transaction is considered to be complete and impossible to change. Confirmation Time is the time between when a blockchain operation is sent to the network and the time it is approved and saved to the blog.
Here we can say TPS (Number of Operations per Second) as a unit for throughput. However, increasing the number of transactions per second alone is not enough to scale. Because even if a protocol has the capacity to do 100,000 calculations per second, the number of transactions will not mean anything unless approved. So it's just as important to have approval time as tps. In a blockchain with 100,000 transactions per second, approving these operations in 3 days (a hypothetical number) makes no sense. It also provides a poor experience for everyday use.
Scaling Trilogy -:
When it's called scalability, everybody has a kind of uncertain triangle on their head. This triangle represents the scaling trilogy. Corners of the triangle, respectively: scalability means lack of centrality and security.
Decentralization, lack of any authority in blockchain, and the inability to manage the whole network from a single hand, decision-making based on a majority, etc. means. At the same time, the lack of agents in blockchain and peer-to-peer processing of all transactions can be examined under the headline decentralization.
The ability of the block chain to resist attacks from outside sources and the ability of the block to end up in the chain to always have the password of the preceding block (hash) and be unchangeable. Within a block, details of the process during the block creation period are kept. If the smallest character of these details is changed, all subsequent operations and block details must also be changed. And that's a very unlikely scenario, although it's possible in theory. Some of the attacks Blockchain might have suffered; double spending is sybil (the disruption of the service's reputational system by creating a large number of identities), DDoS (a cyber attack that temporarily or indefinitely disrupts the services of an internet-connected host, aiming to ensure that a machine or network resource is not accessible to primary users) and 51% attacks.
Scalability; the number of nodes on a network, the number of transactions a network can process, how fast a network can record those operations, etc., determine the network's capability. The most common comparison when called speed is***blockchains (primarily Bitcoin) and Visa. Most sources mention that Visa can process 24,000 transactions per second and even have a capacity of 54,000 transactions, although some sources say that Visa can actually perform only 1,700 operations per second, not 24,000. Mastercard is also claimed to have 5000 operations per second. On the other hand, it's debatable how fair a comparison is, that Visa and Mastercard have a centralized structure and are compared to Bitcoin, although not a blockchain. But if you're developing a new payment system, it's as necessary to compare it with an existing one.
We've said that blockchain networks are not fully scalable, and that significant studies have been done. As you can see in Figure 2, a blockchain that provides two of the properties in Figure 1 has difficulty providing the third feature. A system that is reliable and scalable has to sacrifice incentrality. In bitcoin or Ethereum, incentrality and security were provided to a high extent, but unfortunately scalability was not. The average number of transactions between 5 and 7 seconds may also be used as evidence.
Now, the problem of scalability was developed for Bitcoin, "How does Bitcoin reach the speed of Visa?" Let's look at a scenario of his thinking:
The zeroth scenario is the default state of Bitcoin. Block size is 1 mb, block building time is 600 sec, average transaction size is 380 bytes, average number of transactions per block is 2759, and number of operations performed per second is 4.6. In the first scenario, the block size is increased to 377.5 megabytes and the number of operations per second (TPS); 1736 divided by the total number of transactions within the block (1,041,600) into the block building time (600). In the second scenario, the block generation time is reduced from 10 minutes (600 seconds) to 1.5 seconds, and the TPS becomes 1736. According to a study by the Karlsruhe Institute of Technology in January 2019, it took about 14 seconds for a 1-megabyte block to reach 99% of the nodes in a Bitcoin network with 10,198 nodes. Failure to reduce block generation time to 14 seconds is mandatory for double spending (double spending) prevention. Because creating a new one without a block is going to create an environment open to many mistakes and attacks. In this case, the third scenario assumes that block generation time (TB) equals block span time (TR). So, you have about 197 operations per second. The final scenario was to increase block size to 2 megabytes and block building time to 28 seconds, with the correct rate. As a result, the number of transactions per block (B/Tx) has increased to 5400 and the number of operations per second has not changed. It is important to note, however, that increased number of transactions per second does not indicate that individual scaling has occurred.
Blockchain is a complex issue to scale, so many solutions alternatives are being developed to solve the Scalability Trilogy in the crypto ecosystem and academia. Some of these solutions are layers and new alternative consensus mechanisms. These layers are known as blockchained layer-1 and layer-2.
Layer-1's are the main blockchain networks. Examples include Bitcoin, Ethereum, Avalanche, Solana, Elrond. The reason these networks are called tier-1 is because they are the main chain in their ecosystems, allowing the development of new projects on the main chain. In this paper we will cover two Layer-1 scalability solutions.
1- Segregated Witness: Segwit is a protocol upgrade for Bitcoin that changes the way and structure of storing data. A digital signature verifies the ownership and availability of sender funds takes a lot of room in a transaction. Therefore, removing it ensures that more transactions are included in a block. Although it is a useful solution to Bitcoin, it is not a general solution and is weak in sustainability. It also allows more transactions to be processed in Bitcoin, but does not reduce the length of time approved.
One of the networks where fragmentation is used is Ethereum. Ethereum, formerly known as Ethereum 2.0, will transition to The Merge system, due to the high costs of operations and low processing speed (max 15 tps) on the network with The Merge update. In this transition, the consensus mechanism will be converted from Proof of of Work to Proof of of Stake, and the fragmentation (Sharding) will be done to ensure scaling. Sharding is the division of nodes (databases) within the blockchain into small pieces to disseminate workload and increase processing speed. With Sharding, each node does not need to hold a complete copy of the entire blockchain. Instead, each node reports the work done to share the status of local data, including the balance of addresses and other important metrics. This greatly reduces the cost of data storage on Tier-1 by reducing hardware requirements. According to Ethereum, Sharding will eventually allow us to run Ethereum on a personal laptop or phone. Therefore, more people should be able to participate or run clients in the split Ethereum network. This increases security because the more central the network is, the smaller the surface area of the attack.
Layer 2 refers to a secondary structure or protocol built on top of an existing blockchain system. The main purpose of these protocols is to address the processing speed and scalability challenges faced by major cryptocurrency networks. In this paper we will cover three Layer-2 scalability solutions.
1- Sidechain (Side chain):
The side chain is a chain of operations adjacent to the blockchain used for large batch operations. Side chains use a consensus mechanism that can be optimized for speed and scalability, independent of the original chain. Example of Sidechains: Polygon, Liquid Network, Loom Network.
The Lightning Network is a network that runs on a blockchain to enable fast peer-to-peer operations. It is not bitcoin-specific, but has been integrated by other cryptocurrencies such as Litecoin. The Lightning Network is a solution called Non-Chain or Second Tier. Allows users to perform operations without having to log all operations in blockchain. It is separate from the Bitcoin network. It has its own nodes and software, but it communicates with the main chain. Example: Bitcoin Lightning Network.
A Rollup is an out-of-chain total of transactions on an Ethereum smart contract, reducing fees and congestion by increasing the blockchain's throughput from 15 TPS to over 1000 TPS. Under the Smart Contract, users are able to take action with security guarantees that their operations will not be misused and will, at some point in the future, be placed on the main chain. Any observer must publish a sufficient amount of data on the chain in order to reconfigure the situation (i.e., account balances) and detect the failure. The Rollups are divided into two parts. Optimistic Rollups and Zero Knowledge Rolls
Zero Knowledge Roles:
It works by zero proof of information. Uses evidence of validity that processes are calculated non-chain and then provided to Ethereum Mainnet as proof of the validity of compressed data. The ZK Rollups are composed of methods that are far more complex and entirely mathematical than Optimistic Rollups in the technological sense. Complex operations are scaled back with various mathematical formulas and shared with the main chain. Thus, the ZK Rollups have a much more advanced technology than Optimistic Rollups.
Optimistic rollups are a Layer-2 structure that improves efficiency and latency in the fundamental layer of Ethereum by moving calculation and data storage out of the chain. Optimistic collection; processes outside of Ethereum Mainnet reduce congestion and increase scalability on the base layer. Optimistic rollups are ‘optimistic’ since operations are assumed to be valid. But it can be questioned if necessary. If an invalid operation is suspected, an error proof is run to see if it has occurred.