Classification of Blockchain Types and Introduction to Layer 1 Blockchain

Ljh
Metadium
Published in
10 min readOct 12, 2022

In the last post, we looked at how EVM and Solidity worked. In this post introduction, various blockchains are classified according to their characteristics.

1. Blockchain model

Blockchain can be classified into a UTXO (Unspent Transaction Output) model. Such as Bitcoin and an account-based model that supports smart contract functions such as Ethereum, depending on how it works. Briefly, the UTXO model calculates the user’s assets by tracking the transaction records of the blockchain. In contrast, the Account-based model has a form in which all users’ status values (such as balances) are updated every block.

UTXO model

Fig 1. UTXO model example

The UTXO model refers to an unspent transaction to generate a new transaction. For example, for Alice to send 5 BTC to Bob, Alice has a 1 BTC transaction and 4 BTC transaction for which she is set as the recipient. She creates a 1 BTC transaction and 4 BTC transaction for which Bob is the recipient. Suppose Bob sends 3 BTC to Charlie. At this time, Bob creates a 4 BTC transaction that he receives from Alice, sends 3 BTC to Charlie, and sends the remaining 1 BTC to himself. The transaction is recorded in the block to complete the remittance transaction. Referring to Fig 1., Bob creates a transaction to send 3 BTC to Charlie. The difference between 1 BTC and 3 BTC received from Alice is not used in the transaction so it can be used later.

The UTXO model is a working method used in Bitcoin and Cardano. It is advantageous in terms of storage capacity because it does not manage the status values of all users in the blockchain but needs to be calculated in previous transactions. The disadvantage is that it is complicated to implement functions other than remittance. In a remittance transaction, the current status value is fixed to the recipient, the output value of the transaction, and the remittance amount, so you can track and calculate the previous transaction. It is not easy to implement within the UTXO model.

Account Based Model

The account-based model is a model that updates and manages the state values of all subjects registered in the blockchain every block. The UTXO model calculated the current state by referring to the previous transaction. In the account-based model, an address is given to a smart contract, a program executed by the user. The program’s state value and the blockchain participants are updated whenever a program is called. For example, suppose that Bob, who has 100 ETH, donates 10 ETH to a donation platform registered in the blockchain.

Fig 2. Account-based model example (a)

The latest block without Bob’s donation stores and manages the state shown in Fig 2. in the blockchain. After that, when Bob donates to the Donation contract, the program is executed by immediately loading Bob’s state from the latest block.

Fig 3. Account-based model example (b)

When the donate function of the Donation contract that contributes 10 ETH is performed, the function performance is stored in the blockchain, as shown in Figure 3 as the latest state value.

Therefore, to support general-purpose smart contracts, most blockchains, except for very few, operate under an account-based model. These blockchains can provide services such as loans, exchanges, deposits, and simple remittance functions. Metadium also follows the Account-based model, especially DID Contract for using DID (Decentralized Identifier) authentication services in Government.

However, since the status values of all External Owned Accounts (EOA) and Contract Accounts (CA) must be stored in blocks, the larger the number of Accounts and Contracts, the larger the overall blockchain size and the slower the transaction processing speed.

2. Layer of Blockchain

What is Blockchain layer?

Recently, as the size of the blockchain increases, having a fast transaction processing speed is emerging as a task for blockchain. Slow transaction processing speed and large capacity size are undesirable in terms of scalability in which many users participate in the blockchain. Two main solutions are currently proposed to solve this problem. First, there is a solution to have a fast transaction processing speed of the existing blockchain or a fast consensus speed while abandoning some decentralization. Second, it can be seen as dividing the blockchain into layers according to its function and transferring the load generated by the existing blockchain to other blockchains. As the number of attempts at the second approach has increased recently, the main blockchain, such as Ethereum, is named Layer 1 Blockchain. On the contrary, the blockchain operates as a module to reduce the transaction load of the main blockchain called Layer 2 Blockchain.

Layer 1 Blockchain

Layer 1 blockchain refers to a base network that can verify and finalize transactions without the intervention of other networks. Examples of Layer 1 blockchains include Bitcoin, Ethereum, BNB, Solana network, and Avalanche.

As described above, the Layer 1 blockchain has a problem of scalability degradation due to slow transaction processing speed and large size. Various methods are currently being proposed to solve this problem. Among them, ways to solve the scalability problem of Layer 1 without the intervention of Layer 2 have been proposed. However, the most efficient method is still being discussed. Layer 1-based scalability problems can be broadly classified into three types.

1. Modify consensus mechanism

2. Increase block size

3. Database Sharding

Factors hindering the scalability of Layer 1 include slow consensus speed, slow transaction processing speed, and large blockchain size, which can be resolved through the above solutions.

Until now, Bitcoin and Ethereum blocks were created based on Proof of Work, which uses the computing power of miners as a resource necessary for block consensus. There have been attempts to modify the consensus mechanism to solve this problem, and Ethereum 2.0 is a representative example. Ethereum 2.0 modified the consensus mechanism from Proof of Work to Proof of Stake, which partially solved the scalability problem. As another example, in the case of the Solana network, the consensus algorithm is equipped with a fast consensus algorithm by using a Byzantine Fault Tolerance-based consensus algorithm. Metadium uses Proof of Authority to solve the problem of slow consensus speed caused by Proof of Work.

Even if the block generation speed is fast through the fast consensus algorithm, the number of transactions that can be processed in one block is small and can cause slow transaction processing speed. An approach to increase the block size and process many transactions in one block is also proposed to solve this problem. A representative example is a blockchain such as Bitcoinsv, which increases Bitcoin’s block size.

Finally, various blockchains have also proposed a method using database sharding. Database sharding is a method to improve transaction throughput. The blockchain is divided and managed individually to support fast transaction processing speed and low-capacity blockchain size. Rather than storing the entire blockchain record, each node can store the sharding database and create blocks from it. As Layer 1 blockchains to which database sharding is applied, there are blockchains such as Elond and Harmony.

Future works

In addition to solving the scalability problem in Layer 1, the method of using Layer 2 is also being actively discussed. As for the scalability solution using Layer 2, side chain, Optimistic Rollup, and zk-Rollup are predominantly suggested, which will be discussed in future posts.

References

지난 포스트에서는 EVM과 Solidity가 동작하는 원리에 대해 살펴보았다. 본 포스트에서는 블록체인을 특성에 따라 분류하고 다양한 블록체인을 소개한다.

1. Blockchain model

블록체인은 작동방식에 따라 비트코인과 같은 UTXO(Unspent Transaction Output) 모델과 이더리움과 같이 스마트 컨트랙트 기능을 지원하는 Account based 모델로 분류 할 수 있다. 간략하게 설명하면, UTXO모델은 사용자가 가진 자산을 블록체인의 거래기록을 추적하여 산정하는 반면 Account based 모델은 모든 사용자의 상태값(잔액 등)이 매 블록마다 갱신되는 형태를 지닌다.

UTXO model

Fig 1. UTXO model example

UTXO 모델은 새로운 트랜잭션을 발생시키기 위해 사용되지 않은 트랜잭션을 참조한다. 예를 들어, Alice가 Bob에게 5 BTC를 송금하기 위해 Alice는 자신이 수신자로 설정되어있는 1 BTC 트랜잭션, 4 BTC 트랜잭션을 가지고 Bob이 수신자인 1 BTC 트랜잭션과 4 BTC 트랜잭션을 생성한다. Bob이 Charlie에게 3 BTC를 송금한다고 가정해보자. 이때 Bob은 Alice에게서 받은 4 BTC 트랜잭션으로 3 BTC는 Charlie에게 보내고 나머지 1 BTC는 자신에게 보내는 트랜잭션을 생성하고 트랜잭션이 블록에 기록됨으로 송금거래가 완료 된다. Fig 1.을 보면 Bob은 Chalie에게 3 BTC를 보내는 트랜잭션을 발생시키고, Alice에게서 받은 1 BTC와 3 BTC를 보내는 과정에서 발생한 1 BTC 차액은 거래에 사용된적 없기 때문에 추후 사용될 수 있다.

UTXO 모델은 비트코인, 카르다노 등에서 사용되고 있는 작동방식으로 블록체인에서 사용자의 상태값을 전부 관리하는 것이 아니기 때문에 저장용량 측면에서 장점이 있지만 사용자 상태를 즉각적으로 불러오는 것이 아니라 이전 거래로부터 산출해야 하기 때문에 송금 이외의 기능을 구현하는 것이 매우 어려운 단점이 있다. 송금 거래에서는 트랜잭션의 출력값수신자, 송신금액으로 고정되어 있기 때문에 이전 트랜잭션을 추적하며 현재 상태값을 산출 할 수 있지만, 트랜잭션 입출력이 고정되어 있지 않은 스마트 컨트랙트의 경우 참조해야 할 거래기록 자체를 찾는것이 어려워 UTXO 모델 내에서 구현되는 것이 매우 어렵다.

Account Based 모델

Account based 모델은 블록체인에 등록된 모든 주체의 상태(state)값을 매 블록마다 갱신하여 관리하는 모델이다. UTXO 모델에서는 이전 트랜잭션을 참조하여 현재 상태를 산출했던 반면 Account based 모델에서는 사용자가 실행하는 일종의 프로그램인 스마트 컨트랙트에게도 주소를 부여해 블록체인 참여자 뿐만 아니라 프로그램의 상태값 또한 프로그램 호출이 있을때마다 갱신된다. 예를 들어, 100 ETH를 보유한 Bob이 블록체인에 등록된 기부플랫폼에 10 ETH를 기부하는 상황을 가정해보자.

Fig 2. Account based model example (a)

Bob이 기부를 하지 않은 상태의 최신 블록은 Fig 2.와 같은 State를 블록체인에 저장하고 관리한다. 이후 Bob이 Donation contract에 기부할 때, 즉각적으로 Bob의 state를 최신 블록에서 로드 하여 프로그램을 수행한다.

Fig 3. Account based model example (b)

10 ETH를 기부하는 Donation contract의 donate 함수를 수행하면 함수 수행의 결과가 최신 상태값으로서 블록체인에 Fig 3.과 같이 저장된다.

따라서 범용 스마트 컨트랙트를 지원하기 위해 극소수의 블록체인을 제외한 대부분의 블록체인들은 Account based 모델 하에 동작하고 있으며, 이러한 블록체인에서는 단순 송금 기능 뿐 아니라 대출, 환전, 예치 등의 서비스를 제공할 수 있다. Metadium역시 Account based model을 따르고 있는데, 특히 Governance에서 DID(Decentralized ID)를 사용한 신원증명 서비스를 사용할 수 있도록 DID Contract를 제공하고 있다.

다만 모든 EOA(External Owned Accounts) 및 CA(Contract Accounts)의 상태값을 블록에 저장해야하기 때문에, Account 및 Contract의 수가 많아지면 많아질 수록 그만큼 전체 블록체인 크기가 증가하고 그에따라 트랜잭션 처리 속도 역시 느려지는 단점이 존재한다.

2. Layer of Blockchain

What is Blockchain layer?

최근 블록체인 크기가 커짐에 따라 빠른 트랜잭션 처리속도를 갖추는 것이 블록체인들의 과제로서 대두되고 있다. 느린 트랜잭션 처리속도 및 대용량의 크기는 많은 사용자가 블록체인에 참여하는 확장성(Scalability) 측면에서 바람직하지 않다. 이러한 문제를 해결하기 위해 크게 두 가지의 해결방안이 현재 제안되고 있다. 첫번째로 기존 블록체인 자체를 빠른 트랜잭션 처리속도를 갖도록 하거나 일부 탈중앙성을 포기하면서 빠른 합의속도를 갖추는 해결방안이 있다. 두번째로는 블록체인을 그 기능에 따라 Layer로 나누고 기존 블록체인에 발생하는 부하를 다른 블록체인에 전가하는 방법이라고 볼 수 있다. 최근 두번째 접근법에 대한 시도가 많아짐에 따라 이더리움 등의 메인 블록체인을 Layer 1 Blockchain 으로 명명하며, 반대로 메인 블록체인의 트랜잭션 부하를 줄이기 위해 모듈로서 동작하는 블록체인을 Layer 2 블록체인이라고 한다.

Layer 1 Blockchain

Layer 1 블록체인은 다른 네트워크의 개입 없이 트랜잭션을 검증하고 완결지을 수 있는(Finalize) 베이스 네트워크를 뜻한다. Layer 1 블록체인의 예로 Bitcoin, Ethereum, BNB, Solana network, Avalanche 등의 블록체인이 있다.

상술한 바와 같이 Layer 1 블록체인은 느린 트랜잭션 처리속도 및 대용량 크기로 인해 확장성 저하 문제가 발생하고 있는데, 이를 해결하기 위해 현재 다양한 방법이 제안되고 있다. 그 중 Layer 2의 개입 없이 Layer 1 자체적으로 확장성 문제를 해결하는 방법들도 제안되고 있는데, 아직까지도 가장 효율적인 방법에 대해서는 논의되고 있는 상황이다. Layer 1 기반의 확장성 문제 해결방안은 크게 3가지로 분류 할 수 있다.

합의 알고리즘 수정(Modify consensus mechanism)

블록 크기 증대(Increase block size)

데이터베이스 샤딩(Database Sharding)

Layer 1의 확장성을 저해하는 요인으로 느린 합의 속도, 느린 트랜잭션 처리속도, 대용량의 블록체인 크기 등이 있는데, 위의 해결방안을 통해 각각 해결될 수 있다.

그간 Bitcoin, Ethereum에서는 채굴자(Miner)의 연산력(Computing power)을 블록합의에 필요한 자원으로 사용하는 작업증명(Proof of Work)을 기반으로 블록이 생성되는데, 이는 필수불가결하게 느린 합의속도를 도출할 수 밖에 없다. 이러한 문제를 해결하고자 합의 메커니즘을 수정하고자 하는 시도들이 있었는데 대표적으로 Ethereum 2.0이 있다. Ethereum 2.0은 합의 메커니즘을 작업증명에서 지분증명(Proof of Stake)로 수정하였으며 이를 통해 확장성문제를 일부 해결하였다. 또 다른 예로 Solana network의 경우 합의 알고리즘을 비잔틴 장애허용(Byzantine Fault Tolerance)기반의 합의 알고리즘을 사용함으로써 빠른 합의속도를 갖추었다. Metadium의 경우 권위 증명(Proof of Authority)을 사용하여 작업증명에서 발생하는 느린 합의 속도문제를 해결하였다.

빠른 합의 알고리즘을 통해 블록생성속도가 빠르더라도 하나의 블록에서 처리 할 수 있는 트랜잭션의 수가 적다면 느린 트랜잭션 처리속도를 야기할 수 있다. 이러한 문제를 해결하고자 블록 크기를 증대 시키고 하나의 블록안에 대용량의 트랜잭션을 처리할 수 있도록 하는 접근법 또한 제안되고 있다. 대표적으로 비트코인의 블록 크기를 증대시킨 Bitcoinsv 와 같은 블록체인이 있다.

마지막으로 데이터 베이스 샤딩(Database Sharding)을 사용한 방법 또한 다양한 블록체인에서 제안되고 있다. 데이터베이스 샤딩은 트랜잭션 대역폭(Transaction throughput)을 향상시키기 위한 방안으로, 블록체인이 분할되어 각각 관리되어 빠른 트랜잭션 처리속도 및 저용량의 블록체인 크기를 지원한다. 각 노드는 블록체인의 전체 기록을 저장하는 것이 아니라 분할된 데이터베이스를 저장하고 그로부터 블록을 생성 할 수 있다. 데이터베이스 샤딩이 적용된 Layer 1 블록체인으로는 Elond, Harmony 등의 블록체인이 있다.

Future works

Layer 1에서 자체적으로 확장성 문제를 해결하는 것 뿐만아니라, Layer 2를 사용하는 방법 또한 활발하게 논의 되고 있다. Layer 2를 활용한 확장성 해결방안은 크게 Side chain, Optimistic Rollup, zk-Rollup 등의 방안이 제시되고 있는데 이는 추후 포스팅에서 다루고자 한다.

참고문헌

https://bitcoinsv.com/feature/onchain-scaling/

https://academy.binance.com/en/articles/what-is-layer-1-in-blockchain

Writer: Ljh

--

--