Optimism 기술 문서

Analysis and Comparison between Optimism and StarkNet

بقلم Optimism Collective · 2021

لا تمتلك Optimism ورقةً بيضاءَ تقليديةً. بوصفها rollup تفاؤلياً من الطبقة الثانية لـ Ethereum، يُوثَّق تصميمها ومواصفاتها من خلال الوثائق التقنية ومواصفات OP Stack ومنشورات البحث، بدلاً من ورقة أكاديمية رسمية واحدة.

Abstract

Abstract

The paper addresses the problem of scalability in decentralized blockchains by analyzing the trade-off between transaction throughput and hardware requirements to run a node. Rollups, i.e. technologies for on-chain verification of blocks executed off-chain, are presented in the form of fault or validity proofs. We compare Optimistic Rollups and Validity Rollups with respect to withdrawal time, transaction costs, optimization techniques, and compatibility with the Ethereum ecosystem. Our analysis reveals that Optimism Bedrock currently has a gas compression rate of approximately 20:1, while StarkNet achieves a storage write cost compression rate of around 24:1. We also discuss techniques to further optimize these rates, such as the use of cache contracts and Bloom filters. Ultimately, our conclusions highlight the trade-offs between complexity and agility in the choice between Optimistic and Validity Rollups. Keywords Blockchain, Scalability, Rollup 1. Introduction Blockchain technology has gained significant attention due to its potential to revolutionize various industries. However, scalability remains a major challenge, as most blockchains face a trade-off between scalability, decentralization, and security, commonly referred to as the Scalability Trilemma [1, 2]. To increase the throughput of a blockchain, a trivial solution is to increase its block size. In the context of Ethereum, this means increasing the maximum amount of gas a block can hold. As each full node must validate every transaction of every block, as the throughput increases, the hardware requirements also increase, leading to a greater centralization of the network. Some blockchains, such as Bitcoin and Ethereum, optimize their design to maximize their architectural decentralization, while others, such as the Binance Smart Chain and Solana, are designed to be as fast and cheap as possible. Decentralized networks artificially limit the throughput of the blockchain to lower the hardware requirements to participate in the network. Over the years, attempts have been made to find a solution to the Trilemma, such as state channels [3] and Plasma [4, 5]. These solutions have the characteristic of moving some activity off-chain, linking on-chain activity to off-chain activity using smart contracts, and verifying DLT 2023: 5th Distributed Ledger Technology Workshop, May 25-26, 2023, Bologna, Italy $ [email protected] (L. Donno) € https://lucadonnoh.github.io/ (L. Donno)  0000-0001-9221-3529 (L. Donno) © 2023 Copyright for this paper by its authors. Use permitted under Creative Commons License Attribution 4.0 International (CC BY 4.0). CEUR Workshop Proceedings http://ceur-ws.org ISSN 1613-0073 CEUR Workshop Proceedings (CEUR-WS.org) on-chain what is happening off-chain. However, both Plasma and state channels are limited in their support of general smart contracts. Rollups are blockchains (called Layer 2 or L2) that publish their blocks on another blockchain (Layer 1 or L1) and therefore inherit its consensus, data availability and security properties. They, unlike other solutions, support arbitrary computation. Rollups have three main components: • Sequencers: nodes that receive Rollup transactions from users and combine them into a block that is sent to Layer 1. The block consists of at least the state root (e.g. a Merkle root) and the data needed to reconstruct and validate the state. The Layer 1 defines the...

초록

이 백서는 트랜잭션 처리량과 노드를 실행하기 위한 하드웨어 요구 사항 간의 균형을 분석하여 분산형 blockchain의 확장성 문제를 해결합니다. 롤업, 즉 오프체인에서 실행되는 블록의 온체인 검증 기술은 오류 또는 유효성 증명의 형태로 제공됩니다. 출금 시간, 거래 비용, 최적화 기술 및 Ethereum 생태계와의 호환성과 관련하여 낙관적 롤업과 유효성 롤업을 비교합니다. 우리의 분석에 따르면 Optimism Bedrock의 가스 압축률은 현재 약 20:1인 반면 StarkNet의 스토리지 쓰기 비용 압축률은 약 24:1입니다. 또한 캐시 계약 및 Bloom 필터 사용과 같이 이러한 속도를 더욱 최적화하는 기술에 대해서도 논의합니다. 궁극적으로 우리의 결론은 낙관적 롤업과 유효성 롤업 간의 선택에서 복잡성과 민첩성 간의 균형을 강조합니다. 키워드 블록체인, 확장성, 롤업 1. 서론 블록체인 기술은 다양한 산업에 혁명을 일으킬 수 있는 잠재력으로 인해 큰 주목을 받고 있습니다. 그러나 대부분의 blockchain은 일반적으로 확장성 트릴레마[1, 2]라고 불리는 확장성, 분산화 및 보안 간의 균형에 직면하기 때문에 확장성은 여전히 ​​주요 과제로 남아 있습니다. blockchain의 처리량을 늘리기 위한 간단한 해결책은 블록 크기를 늘리는 것입니다. Ethereum의 맥락에서 이는 블록이 보유할 수 있는 최대 가스 양을 늘리는 것을 의미합니다. 각 풀 노드는 모든 블록의 모든 트랜잭션을 검증해야 하므로 처리량이 증가함에 따라 하드웨어 요구 사항도 증가하여 네트워크의 중앙 집중화가 더욱 강화됩니다. Bitcoin 및 Ethereum와 같은 일부 blockchain은 아키텍처 분산을 극대화하기 위해 설계를 최적화하는 반면, 바이낸스 스마트 체인 및 솔라나와 같은 다른 blockchain은 최대한 빠르고 저렴하도록 설계되었습니다. 분산형 네트워크는 네트워크에 참여하기 위한 하드웨어 요구 사항을 낮추기 위해 blockchain의 처리량을 인위적으로 제한합니다. 수년에 걸쳐 상태 채널 [3] 및 플라즈마[4, 5]와 같은 Trilemma에 대한 솔루션을 찾으려는 시도가 있었습니다. 이러한 솔루션은 일부 활동을 오프체인으로 이동하고, smart contracts를 사용하여 온체인 활동을 오프체인 활동에 연결하고, DLT 2023을 검증하는 특징을 가지고 있습니다: 제5차 분산 원장 기술 워크숍, 2023년 5월 25~26일, 이탈리아 볼로냐 $ [email protected] (L. Donno) https://lucadonnoh.github.io/ (L. Donno) 0000-0001-9221-3529 (L. Donno) © 2023 이 논문의 저작권은 저자에게 있습니다. Creative Commons License Attribution 4.0 International(CC BY 4.0)에 따라 사용이 허용됩니다. CEUR Workshop Proceedings http://ceur-ws.org ISSN 1613-0073 CEUR Workshop Proceedings (CEUR-WS.org) 온체인에서 일어나는 일 오프체인에서 일어나는 일입니다. 그러나 플라즈마 및 상태 채널 모두 일반 smart contract 지원이 제한됩니다. 롤업은 자신의 블록을 다른 blockchain(Layer 1 또는 L1)에 게시하여 합의, 데이터 가용성 및 보안 속성을 상속하는 blockchain(Layer 2 또는 L2라고 함)입니다. 다른 솔루션과 달리 임의 계산을 지원합니다. 롤업에는 세 가지 주요 구성 요소가 있습니다. • 시퀀서: 사용자로부터 롤업 트랜잭션을 수신하고 이를 Layer 1로 전송되는 블록으로 결합하는 노드입니다. 블록은 최소한 상태 루트(예: Merkle 루트)와 상태를 재구성하고 검증하는 데 필요한 데이터로 구성됩니다. Layer 1은 다음을 정의합니다...

Introduction

Introduction

  1. Introduction Blockchain technology has gained significant attention due to its potential to revolutionize various industries. However, scalability remains a major challenge, as most blockchains face a trade-off between scalability, decentralization, and security, commonly referred to as the Scalability Trilemma [1, 2]. To increase the throughput of a blockchain, a trivial solution is to increase its block size. In the context of Ethereum, this means increasing the maximum amount of gas a block can hold. As each full node must validate every transaction of every block, as the throughput increases, the hardware requirements also increase, leading to a greater centralization of the network. Some blockchains, such as Bitcoin and Ethereum, optimize their design to maximize their architectural decentralization, while others, such as the Binance Smart Chain and Solana, are designed to be as fast and cheap as possible. Decentralized networks artificially limit the throughput of the blockchain to lower the hardware requirements to participate in the network. Over the years, attempts have been made to find a solution to the Trilemma, such as state channels [3] and Plasma [4, 5]. These solutions have the characteristic of moving some activity off-chain, linking on-chain activity to off-chain activity using smart contracts, and verifying DLT 2023: 5th Distributed Ledger Technology Workshop, May 25-26, 2023, Bologna, Italy $ [email protected] (L. Donno) € https://lucadonnoh.github.io/ (L. Donno)  0000-0001-9221-3529 (L. Donno) © 2023 Copyright for this paper by its authors. Use permitted under Creative Commons License Attribution 4.0 International (CC BY 4.0). CEUR Workshop Proceedings http://ceur-ws.org ISSN 1613-0073 CEUR Workshop Proceedings (CEUR-WS.org)

on-chain what is happening off-chain. However, both Plasma and state channels are limited in their support of general smart contracts. Rollups are blockchains (called Layer 2 or L2) that publish their blocks on another blockchain (Layer 1 or L1) and therefore inherit its consensus, data availability and security properties. They, unlike other solutions, support arbitrary computation. Rollups have three main components: • Sequencers: nodes that receive Rollup transactions from users and combine them into a block that is sent to Layer 1. The block consists of at least the state root (e.g. a Merkle root) and the data needed to reconstruct and validate the state. The Layer 1 defines the canonical blockchain of the L2 by establishing the ordering of the published data. • Rollup full nodes: nodes that obtain, process and validate Rollup blocks from Layer 1 by verifying that the root is correct. If a block contains invalid transactions it is then discarded, which prevents Sequencers from creating valid blocks that include invalid transactions. • Rollup light nodes: nodes that obtain Rollup blocks from Layer 1 but do not compute the new state themselves. They verify that the new state root is valid using techniques such as fault or validity proofs. Rollups achieve scalability by decreasing the amortized cost of transactions as the number of users increases. This is because the cost of ensuring blockchain validity grows sub-linearly with respect to the cost of verifying transactions individually. Rollups differ according to the mechanism by which they ensure the validity of transaction execution at light nodes: in Optimistic Rollups it is ensured by an economic model and by fault proofs, while in Validity Rollups it is cryptographically ensured using validity proofs. Light nodes can be implemented as smart contracts on Layer 1. They accept the root of the new state and verify validity or fault proofs: these Rollup are therefore called Smart Contract Rollups. If light nodes are independent, they are called Sovereign Rollups [6]. The advantage of using a Smart Contract Rollup is to be able to build a trust-minimized bridge between the two blockchains: since the validity of the L2 state is proven to L1, a system of transactions from L2 to L1 can be implemented, allowing withdrawals. The disadvantage is that the cost of the transactions depends on the cost of verifying the state on L1: if the base layer is saturated by other activities, the cost of transactions on the Rollup also increases. The data and consensus layers are the ones that determine the security of the system as they define the ordering of transactions, prevent attacks and make data available to prove state validity. Paper contribution In this paper, we study Optimistic and Validity Rollups, two innovative solutions to the Scalability Trilemma, with a focus on notable implementations, such as Optimism Bedrock and StarkNet. Our contributions include a comprehensive comparison of these solutions, an analysis of withdrawal times, and a discussion of a possible attack on Optimism Bedrock. Additionally, we calculate their gas compression ratios, provide application-specific optimizations, and present the advantages and disadvantages of moving away from the Ethereum Virtual Machine (EVM).

Paper structure The paper is organized as follows. In section 2 Optimistic Rollups are introduced by analyzing Optimism Bedrock. In section 3 Validity Rollups are introduced by analyzing StarkNet. In section 4 we compare the two solutions. Finally, in section 5 we draw some conclusions.

소개

  1. 소개 블록체인 기술은 혁명을 일으킬 수 있는 잠재력으로 인해 큰 주목을 받고 있습니다. 다양한 산업. 그러나 대부분의 blockchain이 직면한 것처럼 확장성은 여전히 주요 과제로 남아 있습니다. 일반적으로 확장성, 분산화, 보안 간의 균형을 유지합니다. 확장성 트릴레마 [1, 2]. blockchain의 처리량을 늘리기 위한 간단한 해결책은 다음과 같습니다. 블록 크기를 늘리려면 Ethereum의 맥락에서 이는 최대값을 늘리는 것을 의미합니다. 블록이 담을 수 있는 가스의 양. 각 전체 노드는 모든 거래의 유효성을 검사해야 하므로 블록, 처리량이 증가하면 하드웨어 요구 사항도 증가하므로 더 큰 문제가 발생합니다. 네트워크의 중앙화. Bitcoin 및 Ethereum과 같은 일부 blockchain는 Binance Smart와 같은 다른 사람들은 아키텍처 분산화를 극대화하도록 설계합니다. 체인과 솔라나는 최대한 빠르고 저렴하게 설계되었습니다. 분산형 네트워크 하드웨어 요구 사항을 낮추기 위해 blockchain의 처리량을 인위적으로 제한합니다. 네트워크에 참여합니다. 수년에 걸쳐 국가와 같은 트릴레마에 대한 해결책을 찾으려는 시도가 있었습니다. 채널 [3] 및 플라즈마 [4, 5]. 이러한 솔루션은 일부 활동을 이동시키는 특성을 가지고 있습니다. 오프체인, smart contracts를 사용하여 온체인 활동을 오프체인 활동에 연결하고 확인 DLT 2023: 제5회 분산 원장 기술 워크숍, 2023년 5월 25~26일, 이탈리아 볼로냐 $ [email protected] (L. Donno) https://lucadonnoh.github.io/ (L. 도노) 0000-0001-9221-3529 (L. 돈노) © 2023 본 논문의 저작권은 해당 저자에게 있습니다. Creative Commons License Attribution 4.0 International(CC BY 4.0)에 따라 사용이 허용됩니다. CEUR 워크숍 절차 http://ceur-ws.org ISSN 1613-0073 CEUR 워크숍 진행(CEUR-WS.org)온체인에서 오프체인에서 무슨 일이 일어나고 있는지. 그러나 플라즈마와 상태 채널은 모두 제한되어 있습니다. 일반적인 smart contract에 대한 지원. 롤업은 다른 blockchain에 블록을 게시하는 blockchain(Layer 2 또는 L2라고 함)입니다. (Layer 1 또는 L1)이므로 합의, 데이터 가용성 및 보안 속성을 상속합니다. 그들은, 다른 솔루션과 달리 임의 계산을 지원합니다. 롤업에는 세 가지 주요 구성요소가 있습니다. • 시퀀서: 사용자로부터 롤업 트랜잭션을 수신하고 이를 하나의 노드로 결합하는 노드입니다. Layer 1로 전송되는 블록입니다. 블록은 최소한 상태 루트(예: Merkle 루트) 및 상태를 재구성하고 검증하는 데 필요한 데이터입니다. Layer 1은 게시된 데이터의 순서를 설정하여 L2의 표준 blockchain입니다. • 롤업 전체 노드: 레이어에서 롤업 블록을 획득, 처리 및 검증하는 노드
  2. 루트가 올바른지 확인합니다. 블록에 유효하지 않은 거래가 포함된 경우 이는 시퀀서가 유효하지 않은 블록을 포함하는 유효한 블록을 생성하는 것을 방지합니다. 거래. • 롤업 라이트 노드: Layer 1에서 롤업 블록을 얻지만 계산하지 않는 노드 새로운 국가 그 자체. 기술을 사용하여 새로운 상태 루트가 유효한지 확인합니다. 결함이나 타당성 증명과 같은 것입니다. 롤업은 거래의 상각 비용을 숫자만큼 줄여 확장성을 달성합니다. 사용자가 증가합니다. 이는 blockchain 유효성을 보장하는 비용이 준선형적으로 증가하기 때문입니다. 거래를 개별적으로 확인하는 데 드는 비용과 관련하여. 롤업은 다음에 따라 다릅니다. 라이트 노드에서 트랜잭션 실행의 유효성을 보장하는 메커니즘: 낙관적 롤업은 경제 모델과 결함 증명을 통해 보장되지만 유효성은 유지됩니다. 롤업은 유효성 증명을 사용하여 암호화 방식으로 보장됩니다. 라이트 노드는 Layer 1에서 smart contracts로 구현될 수 있습니다. 그들은 근본 원인을 받아들인다. 새로운 상태 및 유효성 또는 결함 증명 확인: 따라서 이러한 롤업을 스마트 계약이라고 합니다. 롤업. 라이트 노드가 독립적인 경우 소버린 롤업(Sovereign Rollup) [6]이라고 합니다. 장점 스마트 계약 롤업을 사용하면 둘 사이에 신뢰가 최소화된 브리지를 구축할 수 있습니다. blockchains: L2 상태의 유효성이 L1에 입증되었으므로 트랜잭션 시스템은 L2~L1을 구현하여 출금이 가능합니다. 단점은 제작비용이 트랜잭션은 L1의 상태를 확인하는 비용에 따라 달라집니다. 기본 레이어가 다음으로 포화된 경우 다른 활동으로 인해 롤업 거래 비용도 증가합니다. 데이터 및 합의 계층은 다음과 같이 시스템의 보안을 결정하는 계층입니다. 트랜잭션 순서를 정의하고, 공격을 방지하며, 상태를 증명할 수 있는 데이터를 제공합니다. 유효성. 논문 투고 본 논문에서는 혁신적인 두 가지 롤업인 낙관적 롤업과 유효성 롤업을 연구합니다. Optimism Bedrock 및 StarkNet와 같은 주목할만한 구현에 중점을 둔 확장성 트릴레마에 대한 솔루션입니다. 우리의 기여에는 다음 사항에 대한 포괄적인 비교가 포함됩니다. 솔루션, 철수 시간 분석 및 Optimism에 대한 가능한 공격에 대한 논의 기반암. 또한 가스 압축 비율을 계산하고, 애플리케이션별 최적화를 제공하며, Ethereum에서 벗어날 때의 장점과 단점을 제시합니다. 가상 머신(EVM).

종이 구조 논문은 다음과 같이 구성되어 있습니다. 섹션 2 낙관적 롤업은 다음과 같습니다. Optimism Bedrock을 분석하여 소개되었습니다. 섹션 3에서 유효성 롤업은 다음과 같이 소개됩니다. StarkNet을 분석 중입니다. 섹션 4에서는 두 솔루션을 비교합니다. 마지막으로 5장에서 그림을 그립니다. 몇 가지 결론.

Optimistic Rollups

Optimistic Rollups

  1. Optimistic Rollups The idea of accepting optimistically the output of blocks without verifying their execution is already present in the Bitcoin whitepaper [7], discussing light nodes. These nodes only follow the header chain by verifying the consensus rule, making them vulnerable to accept blocks containing invalid transactions in the event of a 51% attack. Nakamoto proposes to solve this problem by using an “alert" system to warn light nodes that a block contains invalid transactions. This mechanism is first implemented by Al-Bassam, Sonnino and Buterin [8] in which a fault proof system based on error correction codes [9] is used. In order to enable the creation of fault proofs, it is necessary that the data from all blocks, including invalid blocks, is available to the network: this is the Data Availability Problem, which is solved using a probabilistic data sampling mechanism. The first Optimistic Rollup design was presented by John Adler and Mikerah Quintyne-Collins in 2019 [10], in which blocks are published on another blockchain that defines their consensus on ordering. 2.1. Optimism Bedrock Bedrock [11] is the latest version of Optimism, a Smart Contract Rollup. The previous version, the Optimistic Virtual Machine (OVM) required an ad hoc compiler to compile Solidity into its own bytecode: in contrast, Bedrock is fully equivalent to the EVM in that the execution engine follows the Ethereum Yellow Paper specification [12]. 2.1.1. Deposits Users can deposit transactions through a contract on Ethereum, the Optimism Portal, by calling the depositTransaction function. When a transaction is executed, a TransactionDeposited event is emitted, which each node in the Rollup listens for to process deposits. A deposited transaction is a L2 transaction that is derived from L1. If the caller of the function is a contract, the address is transformed by adding a constant value to it: this prevents attacks in which a contract on L1 has the same address as a contract on L2 but a different code. The inclusion on L2 of a deposited transaction is ensured by specification within a sequencing window. Deposited transactions are a new EIP-2718 compatible transaction type [13] with prefix 0x7E, where the rlp-encoded fields are: • bytes32 sourceHash: hash that uniquely identifies the source of the transaction. • address from: the address of the sender. • address to: the receiver address, or the zero address if the deposited transaction is a contract creation.

• uint256 mint: the value to be created on L2. • uint256 value: the value to be sent to the recipient. • bytes data: the input data. • bytes gasLimit: the gas limit of the transaction. The sourceHash is computed as the keccak256 hash of the L1 block hash and the L1 log index, uniquely identifying an event in a block. Since deposited transactions are initiated on L1 but executed on L2, the system needs a mechanism to pay on L1 for the gas spent on L2. One solution is to send ETH through the Portal, but this implies that every caller (even indirect callers) must be marked as payable, and this is not possible for many existing projects. The alternative is to burn the corresponding gas on L1. The gas 𝑔allocated to deposited transaction is called guaranteed gas. The L2 gas price on L1 is not automatically synchronized but is estimated using a mechanism similar to EIP-1559 [14]. The maximum amount of gas guaranteed per Ethereum block is 8 million, with a target of 2 million. The quantity 𝑐of ETH required to pay for gas on L2 is 𝑐= 𝑔𝑏L2 where 𝑏L2 is the basefee on L2. The contract on L1 burns an amount of gas equal to 𝑐/𝑏L2. The gas spent to call depositTransaction is reimbursed on L2: if this amount is greater than the guaranteed gas, no gas is burned. The first transaction of a rollup block is a L1 attributes deposited transaction, used to register on a L2 predeploy the attributes of Ethereum blocks. The attributes that the predeploy gives access to are the block number, the timestamp, the basefee, the block hash and the sequence number, which is the block number of L2 relative to the associated L1 block (also called epoch); this number is reset when a new epoch starts. 2.1.2. Sequencing The Rollup nodes derive the Optimism chain entirely from Ethereum. This chain is extended each time new transactions are published on L1, and its blocks are reorganized each time Ethereum blocks are reorganized. The Rollup blockchain is divided into epochs. For each 𝑛 block number of Ethereum, there is a corresponding 𝑛epoch. Each epoch contains at least one block, and each block in an epoch contains a L1 attributes deposited transaction. The first block in an epoch contains all transactions deposited through the Portal. Layer 2 blocks may also contained sequenced transactions, i.e. transactions sent directly to the Sequencer. The Sequencer accepts transactions from users and builds blocks. For each block, it constructs a batch to be published on Ethereum. Several batches can be published in a compressed manner, taking the name channel. A channel can be divided into several frames, in case it is too large for a single transaction. A channel is defined as the compression with ZLIB [15] of rlp-encoded batches. The fields of a batch are the epoch number, the epoch hash, the parent hash, the timestamp and the transaction list. A sequencing window, identified by an epoch, contains a fixed number 𝑤of consecutive L1 blocks that a derivation step takes as input to construct a variable number of L2 blocks. For epoch 𝑛, the sequencing window 𝑛includes the blocks [𝑛, 𝑛+𝑤). This implies that the ordering of L2 transactions and blocks within a sequencing window is not fixed until the window ends. A rollup transaction is called safe if the batch containing it has been confirmed on L1. Frames

are read from L1 blocks to reconstruct batches. The current implementation does not allow the decompression of a channel to begin until all corresponding frames have been received. Invalid batches are ignored. Individual block transactions are obtained from the batches, which are used by the execution engine to apply state transitions and obtain the Rollup state. 2.1.3. Withdrawals In order to process withdrawals, an L2-to-L1 messaging system is implemented. Ethereum needs to know the state of L2 in order to accept withdrawals, and this is done by publishing on the L2 Output Oracle smart contract on L1 the state root of each L2 block. These roots are optimistically accepted as valid (or finalized) if no fault proof is performed during the dispute period. Only addresses designated as Proposers can publish output roots. The validity of output roots is incentivized by having Proposers deposit a stake that is slashed if they are shown to have proposed an invalid root. Transactions are initiated by calling the function initiateWithdrawal on a predeploy on L2 and then finalized on L1 by calling the function finalizeWithdrawalTransaction on the previously mentioned Optimism Portal. The output root corresponding to the L2 block is obtained from the L2 Output Oracle; it is verified that it is finalized, i.e. that the dispute period has passed; it is verified that the Output Root Proof matches the Oracle Proof; it is verified that the hash of the withdrawal is included in it using a Withdrawal Proof; that the withdrawal has not already been finalized; and then the call to the target address is executed, with the specified gas limit, amount of Ether and data. 2.1.4. Cannon: the fault proof system If a Rollup Full Node, by locally executing batches and deposited transactions, discovers that the Layer 2 state does not match the state root published on-chain by a Proposer, it can execute a fault proof on L1 to prove that the result of the block transition is incorrect. Because of the overhead, processing an entire Rollup block on L1 is too expensive. The solution implemented by Bedrock is to execute on-chain only the first instruction of disagreement of minigeth, compiling it into a MIPS architecture that is executed on an on-chain interpreter and published on L1. minigeth is a simplified version of geth 1 in which the consensus, RPC and database have been removed. To find the first instruction of disagreement, an interactive binary search is conducted between the one who initiated the fault proof and the one who published the output root. When the proof starts, both parties publish the root of the MIPS memory state halfway through the execution of the block on the Challenge contract: if the hash matches it means that both parties agree on the first half of the execution thus publishing the root of half of the second half, otherwise the half of the first half is published and so on. Doing so achieves the first instruction of disagreement in a logarithmic number of steps compared to the original execution. If one of the two stops interacting, at the end of the dispute period the other participant automatically wins. To process the instruction, the MIPS interpreter needs access to its memory: since the root is available, the necessary memory cells can be published by proving their inclusion. To access the state of the EVM, use is made of the Preimage Oracle: given the hash of a block it returns 1https://geth.ethereum.org/docs

the block header, from which one can get the hash of the previous block and go back in the chain, or get the hash of the state and logs from which one can get the preimage. The oracle is implemented by minigeth and replaces the database. Queries are made to other nodes to obtain the preimages.

낙관적 롤업

  1. 낙관적 롤업 실행을 검증하지 않고 블록의 출력을 낙관적으로 받아들이는 아이디어는 다음과 같습니다. 라이트 노드에 대해 논의하는 Bitcoin 백서 [7]에 이미 나와 있습니다. 이 노드는 다음과 같습니다. 합의 규칙을 검증하여 헤더 체인을 블록 수용에 취약하게 만듭니다. 51% 공격이 발생한 경우 유효하지 않은 거래가 포함됩니다. 나카모토는 이 문제를 해결할 것을 제안합니다. 문제는 블록에 유효하지 않은 트랜잭션이 포함되어 있음을 라이트 노드에 경고하는 "경고" 시스템을 사용하는 것입니다. 이 메커니즘은 Al-Bassam, Sonnino 및 Buterin [8]에 의해 처음 구현되었습니다. 오류 수정 코드 [9]을 기반으로 한 증명 시스템이 사용됩니다. 생성이 가능하도록 하기 위해 결함 방지를 위해서는 유효하지 않은 블록을 포함한 모든 블록의 데이터를 사용할 수 있어야 합니다. 네트워크: 이것은 확률적 데이터를 사용하여 해결되는 데이터 가용성 문제입니다. 샘플링 메커니즘. 최초의 낙관적 롤업 디자인은 John Adler가 발표했으며 2019년 Mikerah Quintyne-Collins [10], 블록이 다른 blockchain에 게시됨 이는 주문에 대한 합의를 정의합니다. 2.1. Optimism 기반암 Bedrock [11]은 스마트 계약 롤업인 Optimism의 최신 버전입니다. 이전 버전, OVM(Optimistic Virtual Machine)은 Solidity를 자체 버전으로 컴파일하기 위해 임시 컴파일러가 필요했습니다. 자체 바이트 코드: 대조적으로 Bedrock은 실행 엔진이 EVM과 완전히 동일합니다. Ethereum Yellow Paper 사양 [12]을 따릅니다. 2.1.1. 예금 사용자는 Ethereum, Optimism 포탈의 컨트랙트를 통해 예금거래 기능을 호출하여 거래를 입금할 수 있습니다. 트랜잭션이 실행되면, Rollup의 각 노드가 처리를 위해 수신 대기하는 TransactionDeposited 이벤트가 발생합니다. 예금. 입금된 트랜잭션은 L1에서 파생된 L2 트랜잭션입니다. 전화를 건 사람이 함수는 계약이므로 주소는 상수 값을 추가하여 변환됩니다. L1 계약의 주소는 L2 계약과 동일하지만 코드가 다른 공격입니다. 예치된 트랜잭션의 L2 포함은 시퀀스 내의 사양에 의해 보장됩니다. 창. 예치된 거래는 접두사가 0x7E인 새로운 EIP-2718 호환 거래 유형 [13]입니다. 여기서 rlp로 인코딩된 필드는 다음과 같습니다. • bytes32 sourceHash: hash 트랜잭션 소스를 고유하게 식별합니다. • 주소 보낸 사람: 보낸 사람의 주소입니다. • 주소: 수신자 주소 또는 입금된 거래가 다음인 경우 0 주소입니다. 계약 생성.• uint256 mint: L2에 생성될 값입니다. • uint256 value: 수신자에게 전송될 값입니다. • 바이트 데이터: 입력 데이터입니다. • bytes gasLimit: 트랜잭션의 가스 한도입니다. sourceHash는 L1 블록 hash의 keccak256 hash과 L1 로그로 계산됩니다. 블록의 이벤트를 고유하게 식별하는 인덱스입니다. 입금된 트랜잭션은 L1에서 시작되지만 L2에서 실행되므로 시스템에는 L2에 소비된 가스에 대해 L1에 지불하는 메커니즘입니다. 한 가지 해결책은 포털을 통해 ETH를 보내는 것입니다. 그러나 이는 모든 발신자(간접 발신자 포함)가 지불 대상으로 표시되어야 함을 의미하며 이는 많은 기존 프로젝트에서는 불가능합니다. 대안은 L1에서 해당 가스를 연소하는 것입니다. 입금된 거래에 할당된 가스𝑔를 보장가스라고 합니다. L2 가스 가격은 L1은 자동으로 동기화되지 않지만 EIP-1559와 유사한 메커니즘을 사용하여 추정됩니다. [14]. Ethereum 블록당 보장되는 최대 가스량은 800만 개이며, 목표는 다음과 같습니다. 200만. L2의 가스 비용을 지불하는 데 필요한 ETH의 수량 𝑐은 𝑐= 𝑔𝑏L2입니다. 여기서 𝑏L2는 L2의 기본 수수료. L1 계약은 𝑐/𝑏L2에 해당하는 양의 가스를 소모합니다. 통화에 소비된 가스 예금 거래는 L2에서 상환됩니다. 이 금액이 보장된 가스보다 큰 경우, 가스가 연소되지 않습니다. rollup 블록의 첫 번째 트랜잭션은 등록하는 데 사용되는 L1 속성 예치 트랜잭션입니다. L2에서는 Ethereum 블록의 속성을 사전 배포합니다. 사전 배포가 제공하는 속성 액세스 권한은 블록 번호, 타임스탬프, 기본 수수료, 블록 hash 및 시퀀스입니다. number는 연관된 L1 블록에 대한 L2의 블록 번호입니다(epoch라고도 함). 이 숫자는 새로운 시대가 시작되면 재설정됩니다. 2.1.2. 시퀀싱 롤업 노드는 Ethereum에서 완전히 Optimism 체인을 파생합니다. 이 체인은 확장되었습니다 L1에 새로운 트랜잭션이 게시될 때마다 해당 블록이 재구성됩니다. Ethereum 블록이 재구성되었습니다. 롤업 blockchain은 여러 시대로 구분됩니다. 각 𝑛에 대해 Ethereum의 블록 번호에 해당하는 𝑛epoch가 있습니다. 각 시대에는 최소한 하나의 시대가 포함됩니다. 블록이며, 한 시대의 각 블록에는 L1 속성 예치 트랜잭션이 포함됩니다. 첫 번째 블록 한 시대에는 포털을 통해 입금된 모든 거래가 포함됩니다. Layer 2 블록은 또한 순차 트랜잭션이 포함되어 있습니다. 즉, 시퀀서로 직접 전송되는 트랜잭션입니다. Sequencer는 사용자의 트랜잭션을 수락하고 블록을 구축합니다. 각 블록마다 구성됩니다. Ethereum에 게시될 배치입니다. 여러 배치를 압축된 방식으로 게시할 수 있습니다. 이름 채널을 복용. 채널이 너무 큰 경우 여러 프레임으로 나눌 수 있습니다. 단일 거래. 채널은 rlp로 인코딩된 ZLIB [15]을 사용한 압축으로 정의됩니다. 배치. 배치의 필드는 에포크 번호, 에포크 hash, 상위 hash, 타임스탬프와 거래 목록. 에포크로 식별되는 시퀀싱 윈도우에는 고정된 수의 연속 L1 𝑤이 포함됩니다. 파생 단계에서 가변 개수의 L2 블록을 구성하기 위해 입력으로 사용하는 블록입니다. 에 대한 epoch 𝑛, 시퀀싱 창 𝑛에는 블록 [𝑛, 𝑛+𝑤)이 포함됩니다. 이는 주문을 의미합니다. 시퀀싱 윈도우 내의 L2 트랜잭션 및 블록 수는 해당 윈도우가 끝날 때까지 수정되지 않습니다. rollup 트랜잭션이 포함된 배치가 L1에서 확인된 경우 안전하다고 합니다. 프레임L1 블록에서 읽어 배치를 재구성합니다. 현재 구현에서는 다음을 허용하지 않습니다. 모든 해당 프레임이 수신될 때까지 채널의 압축 해제가 시작됩니다. 유효하지 않음 배치는 무시됩니다. 개별 블록 트랜잭션은 배치에서 획득됩니다. 상태 전환을 적용하고 롤업 상태를 얻기 위해 실행 엔진에서 사용됩니다. 2.1.3. 인출 인출을 처리하기 위해 L2-to-L1 메시징 시스템이 구현됩니다. Ethereum 인출을 수락하려면 L2의 상태를 알아야 하며 이는 게시를 통해 수행됩니다. L2 출력 Oracle smart contract on L1 각 L2 블록의 상태 루트. 이들 뿌리 오류 증명이 수행되는 동안 오류가 수행되지 않으면 낙관적으로 유효(또는 최종)된 것으로 받아들여집니다. 분쟁기간. 제안자로 지정된 주소만 출력 루트를 게시할 수 있습니다. 타당성 제안자가 삭감된 지분을 예치하도록 함으로써 생산량 루트에 대한 인센티브가 부여됩니다. 잘못된 루트를 제안한 것으로 나타났습니다. 트랜잭션은 함수를 호출하여 시작됩니다. L2의 사전 배포에서 Withdrawal을 시작한 다음 함수를 호출하여 L1에서 마무리했습니다. 앞에서 언급한 Optimism 포털의 finalizeWithdrawalTransaction입니다. L2 블록에 해당하는 출력 루트는 L2 출력 Oracle에서 가져옵니다. 그것은이다 확정되었음을 확인합니다. 즉, 분쟁 기간이 경과했음을 확인합니다. 출력되는 것이 확인됩니다. 루트 증명은 Oracle 증명과 일치합니다. 출금의 hash이 포함된 것으로 확인됩니다 인출 증명을 사용하여; 철회가 아직 완료되지 않았습니다. 그리고 나서 지정된 가스 한도, Ether 양 및 데이터를 사용하여 대상 주소에 대한 호출이 실행됩니다. 2.1.4. 대포: 결함 방지 시스템 롤업 전체 노드가 로컬에서 일괄 처리 및 입금된 트랜잭션을 실행하여 다음을 발견한 경우 Layer 2 상태가 제안자가 체인에 게시한 상태 루트와 일치하지 않으면 실행할 수 있습니다. 블록 전환 결과가 잘못되었음을 증명하기 위해 L1에 대한 결함 증명. 때문에 오버헤드로 인해 L1에서 전체 Rollup 블록을 처리하는 데 비용이 너무 많이 듭니다. 구현된 솔루션 Bedrock은 minigeth의 불일치에 대한 첫 번째 지시만 온체인에서 실행합니다. 온체인 인터프리터에서 실행되고 게시되는 MIPS 아키텍처로 컴파일 L1에. minigeth는 합의, RPC 및 데이터베이스가 포함된 geth 1의 단순화된 버전입니다. 제거되었습니다. 불일치하는 첫 번째 명령을 찾기 위해 대화형 이진 검색이 다음 사이에서 수행됩니다. 결함 증명을 시작한 사람과 출력 루트를 게시한 사람입니다. 증명할 때 시작하면 양 당사자는 실행 중간에 MIPS 메모리 상태의 루트를 게시합니다. 챌린지 계약의 차단: hash이 일치하면 양 당사자가 다음에 동의한다는 의미입니다. 실행의 전반부는 후반부의 절반의 루트를 게시하고, 그렇지 않으면 절반을 게시합니다. 상반기 등이 게재됩니다. 그렇게 하면 첫 번째 불일치 지시가 달성됩니다. 원래 실행과 비교하여 로그 단계 수로 표시됩니다. 둘 중 하나가 멈추면 분쟁 기간이 끝나면 다른 참가자가 자동으로 승리합니다. 명령어를 처리하려면 MIPS 인터프리터가 메모리에 액세스해야 합니다. 루트는 다음과 같습니다. 필요한 메모리 셀이 포함되어 있음을 증명함으로써 공개될 수 있습니다. 접근하려면 EVM의 상태, Preimage Oracle이 사용됩니다. 반환되는 블록의 hash이 제공됩니다. 1https://geth.ethereum.org/docs

블록 헤더에서 이전 블록의 hash을 얻고 이전 블록으로 돌아갈 수 있습니다. 체인을 연결하거나 사전 이미지를 얻을 수 있는 상태 및 로그의 hash을 가져옵니다. oracle minigeth에 의해 구현되며 데이터베이스를 대체합니다. 쿼리는 다른 노드에 수행됩니다. 사전 이미지를 얻습니다.

Validity Rollups

Validity Rollups

  1. Validity Rollups The goal of a Validity Rollup is to cryptographically prove the validity of the state transition given the sequence of transactions with a short proof that can be verified sub-linearly compared to the time of the original computations. These kind of certificates are called computational integrity proofs and are practically implemented with SNARKs (Succint Non-interactive ARgument of Knowledge), which use arithmetic circuits as their computational model. Different SNARK implementations differ in proving time, verification time, the need of a trusted setup and quantum resistance [16, 17]. STARKs (Scalable Transparent ARgument of Knowledge) [18] are a type of SNARKs that does not require a trusted setup and are quantum resistant, while giving up some efficiency on proving and verification compared to other solutions. 3.1. StarkNet StarkNet is a Smart Contract Validity Rollup developed by StarkWare that uses the STARK proof system to validate its state to Ethereum. To facilitate the construction of validity proofs, a virtual machine different than the EVM is used, whose high-level language is Cairo. 3.1.1. Deposits Users can deposit transactions via a contract on Ethereum by calling the sendMessageToL2 function. The message is recorded by computing its hash and increasing a counter. Sequencers listen for the LogMessageToL2 event and encode the information in a StarkNet transaction that calls a function of a contract that has the l1_handler decorator. At the end of execution, when the proof of state transition is produced, the consumption of the message is attached to it and it is deleted by decreasing its counter. The inclusion of deposited transactions is not required by the StarkNet specification, so a gas market is needed to incentivize Sequencers to publish them on L2. In the current version, because the Sequencer is centralized and managed by StarkWare, the cost of deposited transactions is only determined by the cost of executing the deposit. This cost is paid by sending ETH to sendMessageToL2. These Ethers remain locked on L1 and are transferred to the Sequencer on L1, when the deposited transaction is included in a state transition. The amount of ETH sent, if the deposited transaction is included, is fully spent, regardless of the amount of gas consumed on L2. StarkNet does not have a system that makes L1 block attributes available automatically. Alternatively, Fossil is a protocol developed by Oiler Network 2 that allows, given a hash of a block, any information to be obtained from Ethereum by publishing preimages. 2https://www.oiler.network/

3.1.2. Sequencing The current state of StarkNet can be derived entirely from Ethereum. Any state difference between transitions is published on L1 as calldata. Differences are published for each contract and are saved as uint256[] with the following encoding: • Number of field concerning contract deployments. • For each published contract: – The address of the published contract. – The hash of the published contract. – The number of arguments of the contract constructor. – The list of constructor arguments • Number of contract whose storage has been modified. • For each contract that has been modified: – The address of the modified contract. – The number of storage updates. – The key-value pairs of the storage addresses with the new values. The state differences are published in order, so it is sufficient to read them sequentially to reconstruct the state. 3.1.3. Withdrawals To send a message from L2 to L1, the syscall send_message_to_L1 is used. The message is published to L1 by increasing its hash counter along with the proof and finalized by calling the function consumeMessageFromL2 on the StarkGate smart contract on L1, which decrements the counter. Anyone can finalize any withdrawal. 3.1.4. Validity proofs The Cairo Virtual Machine [19] is designed to facilitate the construction of STARK proofs. The Cairo language allows the computation to be described with a high-level programming language, and not directly as a circuit. This is accomplished by a system of polynomial equations 3 representing a single computation: the FDE cycle of a von Neumann architecture. The number of constraints is thus fixed and independent of the type of computation, allowing for only one Verifier program for every program whose computation needs to be proved. StarkNet aggregates multiple transactions into a single STARK proof using a shared prover named SHARP. The proofs are sent to a smart contract on Ethereum, which verifies their validity and updates the Merkle root corresponding to the new state. The sub-linear cost of verifying a validity proof allows its cost to be amortized over multiple transactions. 3called Algebraic Intermediate Representation (AIR)

유효성 롤업

  1. 유효성 롤업 유효성 롤업의 목표는 상태 전환의 유효성을 암호화로 증명하는 것입니다. 준선형적으로 비교하여 검증할 수 있는 짧은 증거가 있는 일련의 거래를 고려했을 때 원래 계산 시점까지. 이러한 종류의 인증서를 계산 무결성 증명이라고 하며 실제로 산술 연산을 사용하는 SNARK(Succint Non-interactive ARgument of Knowledge)로 구현됩니다. 회로를 계산 모델로 사용합니다. 다양한 SNARK 구현은 증명 시간이 다릅니다. 검증 시간, 신뢰할 수 있는 설정 및 양자 저항의 필요성 [16, 17]. STARK(확장 가능 투명한 지식 인수) [18]은 신뢰할 수 있는 정보가 필요하지 않은 SNARK 유형입니다. 증명 및 검증의 효율성을 일부 포기하면서 설정 및 양자 저항성을 갖습니다. 다른 솔루션에 비해. 3.1. StarkNet StarkNet은 STARK를 사용하는 StarkWare에서 개발한 스마트 계약 유효성 롤업입니다. Ethereum에 대한 상태를 검증하는 증명 시스템입니다. 타당성 증명의 구축을 용이하게 하기 위해, EVM과 다른 가상 머신이 사용되며, 고급 언어는 Cairo입니다. 3.1.1. 예금 사용자는 sendMessageToL2를 호출하여 Ethereum의 계약을 통해 거래를 입금할 수 있습니다. 기능. 메시지는 hash을 계산하고 카운터를 증가시켜 기록됩니다. 시퀀서 LogMessageToL2 이벤트를 수신하고 StarkNet 트랜잭션의 정보를 인코딩합니다. l1_handler 데코레이터가 있는 계약의 함수를 호출합니다. 실행이 끝나면, 상태 전환 증명이 생성되면 메시지 소비가 여기에 첨부됩니다. 카운터를 줄임으로써 삭제됩니다. StarkNet 사양에서는 예치된 거래를 포함할 것을 요구하지 않으므로 가스 시퀀서가 L2에 게시하도록 장려하려면 시장이 필요합니다. 현재 버전에서는 시퀀서는 예치된 거래 비용인 StarkWare에 의해 중앙 집중화되고 관리됩니다. 예금 실행 비용에 의해서만 결정됩니다. 이 비용은 ETH를 전송하여 지불됩니다. sendMessageToL2. 이 Ether는 L1에 고정된 상태로 유지되며 L1의 Sequencer로 전송됩니다. L1, 예치된 트랜잭션이 상태 전환에 포함될 때. 다음과 같은 경우 전송된 ETH 금액 예치된 거래가 포함되어 소비된 가스량에 관계없이 완전히 소비됩니다. L2에. StarkNet에는 L1 블록 속성을 자동으로 사용할 수 있게 만드는 시스템이 없습니다. 또는 Fossil은 Oiler Network 2에서 개발한 프로토콜로, 주어진 hash을 허용합니다. 블록, 사전 이미지 게시를 통해 Ethereum에서 얻을 수 있는 모든 정보. 2https://www.oiler.network/3.1.2. 시퀀싱 StarkNet의 현재 상태는 Ethereum에서 완전히 파생될 수 있습니다. 모든 상태 차이 전환 간은 L1에 호출 데이터로 게시됩니다. 각 계약에 대한 차이점이 게시됩니다. 다음 인코딩을 사용하여 uint256[]으로 저장됩니다. • 계약 배포와 관련된 분야의 수. • 게시된 각 계약에 대해 다음을 수행합니다. – 게시된 계약의 주소입니다. – 게시된 계약의 hash. – 계약 생성자의 인수 수. – 생성자 인수 목록 • 저장공간이 수정된 계약의 수. • 수정된 각 계약에 대해: – 수정된 계약서의 주소. – 스토리지 업데이트 횟수. – 새 값이 포함된 저장소 주소의 키-값 쌍입니다. 상태 차이는 순서대로 공개되므로 순차적으로 읽어도 충분합니다. 상태를 재구성합니다. 3.1.3. 인출 L2에서 L1으로 메시지를 보내려면 시스템 호출 send_message_to_L1이 사용됩니다. 메시지는 증명과 함께 hash 카운터를 늘려 L1에 게시하고 L1의 StarkGate smart contract에 있는 ConsumerMessageFromL2 함수는 감소합니다. 카운터. 누구나 출금을 완료할 수 있습니다. 3.1.4. 유효성 증명 Cairo Virtual Machine [19]은 STARK 증명 구축을 용이하게 하도록 설계되었습니다. Cairo 언어를 사용하면 계산을 고급 프로그래밍으로 설명할 수 있습니다. 언어가 아닌 회로로 직접적으로 사용됩니다. 이는 다항 방정식 시스템에 의해 수행됩니다. 단일 계산을 나타내는 그림 3: 폰 노이만 아키텍처의 FDE 사이클. 번호 따라서 제약 조건은 고정되어 있고 계산 유형에 독립적이므로 하나만 허용됩니다. 계산을 증명해야 하는 모든 프로그램에 대한 검증 프로그램입니다. StarkNet은 공유 증명자를 사용하여 여러 거래를 단일 STARK 증명으로 집계합니다. SHARP라는 이름이 붙었습니다. 증명은 Ethereum의 smart contract로 전송되어 유효성을 확인합니다. 새로운 상태에 해당하는 Merkle 루트를 업데이트합니다. 검증의 하위 선형 비용 유효성 증명을 통해 여러 거래를 통해 비용을 분할 상환할 수 있습니다. 3대수 중간 표현(AIR)이라고 함

Comparison

Comparison

  1. Comparison 4.1. Withdrawal time The most important aspect that distinguishes Optimistic Rollups from Validity Rollups is the time that elapses between the initialization of a withdrawal and its finalization. In both cases, withdrawals are initialized on L2 and finalized on L1. On StarkNet, finalization is possible as soon as the validity proof of the new state root is accepted on Ethereum: theoretically, it is possible to withdraw funds in the first block of L1 following initialization. In practice, the frequency of sending validity proofs on Ethereum is a trade-off between the speed of block finalization and proof aggregation. Currently StarkNet provides validity proofs for verification every 10 hours 4, but it is intended to be decreased as transaction activity increases. On Optimism Bedrock it is possible to finalize a withdrawal only at the end of the dispute period (currently 7 days), after which a root is automatically considered valid. The length of this period is mainly determined by the fact that fault proofs can be censored on Ethereum until its end. The success probability of this type of attack decreases exponentially as time increases: E[subtracted value] = 𝑉𝑝𝑛 where 𝑛is the number of blocks in an interval, 𝑉is the amount of funds that can be subtracted by publishing an invalid root, and 𝑝is the probability of successfully performing a censorship attack in a single block. Suppose that this probability is 99%, that the value locked in the Rollup is one million Ether, and that the blocks in an interval are 1800 (6 hours of blocks with a 12 seconds interval): the expected value is about 0.01391 Ether. The system is made secure by asking Proposers to stake a much larger amount of Ether than the expected value. Winzer et al. showed how to carry out a censorship attack using a simple smart contract that ensures that certain areas of memory in the state do not change [20]. Modeling the attack as a Markov game, the paper shows that censoring is the dominant strategy for a rational block producer if they receive more compensation than including the transaction that changes the memory. The 𝑝value discussed above can be viewed as the percentage of rational block producers in the network, where “rational” does not take into account possibly penalizing externalities, such as less trust in the blockchain that decreases its cryptocurrency value. The following code presents a smart contract that can be used to perform a censorship attack on Bedrock. The attack exploits the incentives of block producers by offering them a bribe to censor the transactions that would modify specific parts of the state. The contract’s main function, claimBribe, allows block producers to claim the bribe if they successfully censor the targeted transaction by checking that the invalid output root is not touched. function claimBribe(bytes memory storageProof) external { require(!claimed[block.number], "bribe already claimed"); OutputProposal memory current = storageOracle.getStorage(L2_ORACLE, block.number, SLOT, storageProof); require(invalidOutputRoot == current.outputRoot, "attack failed"); claimed[block.number] = true; (bool sent, ) = block.coinbase.call{value: bribeAmount}(""); 4https://etherscan.io/address/0xc662c410c0ecf747543f5ba90660f6abebd9c8c4

require(sent, "failed to send ether"); } Listing 1: Example of a contract that incentivizes a censorship attack on Bedrock. The length of the dispute period must also take into account the fact that the fault proof is an interactive proof and therefore enough time must be provided for participants to interact and that any interaction could be censored. If the last move occurs at a time very close to the end of the dispute period, the cost of censoring is significantly less. Although censoring is the dominant strategy, the likelihood of success is lower because censoring nodes are vulnerable to Denial of Service attacks: an attacker can generate very complex transactions that end with the publication of a fault proof at no cost, as no fees would be paid. In extreme cases, a long dispute period allows coordination in the event of a successful censorship attack to organize a fork and exclude the attacking block producers. Another possible attack consists in publishing more state root proposals than disputants can verify, which can be avoided using a frequency limit. 4.1.1. Fast optimistic withdrawals Since the validity of an Optimistic Rollup can be verified at any time by any Full Node, a trusted oracle can be used to know on L1 whether the withdrawal can be finalized safely. This mechanism was first proposed by Maker [21]: an oracle verifies the withdrawal, publishes the result on L1 on which an interest-bearing loan is assigned to the user, which is automatically closed at the end of 7 days, i.e. when the withdrawal can actually be finalized. This solution introduces a trust assumption, but in the case of Maker it is minimized since the oracle operator is managed by the same organization that assumes the risk by providing the loan. 4.2. Transaction costs The cost of L2 transactions is mostly determined by the interaction with the L1. In both solutions the computational cost of transactions is very cheap as it is executed entirely off-chain. Optimism publishes L2 transactions calldata as calldata and rarely (or never) executes fault proofs, therefore calldata is the most expensive resource. On January 12, 2022 a Bedrock network has been launched on the Ethereum’s Goerli testnet. A gas compression rate can be calculated by tracking the amount of gas used on Bedrock in a certain period and by comparing it to the amount of gas spent on L1 for the corresponding blocks. Using this method a gas compression rate of ∼20 : 1 is found, but this figure may differ with real activity on mainnet. StarkNet publishes on Ethereum every change in L2 state as calldata, therefore storage is the most expensive resource. Since the network does not use the EVM, the transaction cost compression cannot be trivially estimated. By assuming the cost of execution and calldata to be negligible, it is possible to calculate the compression ratio of storage writes compared to L1. Assuming no contract is deployed and 10 cells not previously accessed on StarkNet are modified, a storage write cost compression rate of ∼24 : 1 is found. If a cell is overwritten 𝑛times between data publications, the cost of each write will be 1/𝑛compared to the cost of a single write, since only the last one is published. The cost can be further minimized by

compressing frequently used values. The cost of validity proof verification is divided among the transactions it refers to: for example, StarkNet block 4779 contains 200 transactions and its validity proof consumes 267830 units of gas, or 1339.15 gas for each transaction. 4.2.1. Optimizing calldata: cache contract Presented below is a smart contract that implements an address cache for frequently used addresses by taking advantage of the fact that storage and execution are much less expensive resources, along with a Friends contract that demonstrates its use. The latter keeps track of the “friends” of an address that can be registered by calling the addFriend function. If an address has already been used at least once, it can be added by calling the addFriendWithCache function: the cache indices are 4-byte integers while the addresses are represented by 20 bytes, so there is a 5:1 saving on the function argument. The same logic can be used for other data types such as integers or more generally bytes. contract AddressCache { mapping(address => uint32) public address2key; address[] public key2address; function cacheWrite(address _address) internal returns (uint32) { require(key2address.length < type(uint32).max, "AddressCache: cache is full"); require(address2key[_address] == 0, "AddressCache: address already cached"); // keys must start from 1 because 0 means "not found" uint32 key = uint32(key2address.length + 1); address2key[_address] = key; key2address.push(_address); return key; } function cacheRead(uint32 _key) public view returns (address) { require(_key <= key2address.length && _key > 0, "AddressCache: key not found"); return key2address[_key - 1]; } } Listing 2: Address cache contract. contract Friends is AddressCache { mapping(address => address[]) public friends; function addFriend(address _friend) public { friends[msg.sender].push(_friend); cacheWrite(_friend); } function addFriendWithCache(uint32 _friendKey) public { friends[msg.sender].push(cacheRead(_friendKey)); } function getFriends() public view returns (address[] memory) { return friends[msg.sender];

} } Listing 3: Example of a contract that inherits the address cache. The contract supports in cache about 4 billion (232) addresses, and adding one byte gives about 1 trillion (240). 4.2.2. Optimizing storage: Bloom’s filters On StarkNet there are several techniques for minimizing storage usage. If it is not necessary to guarantee the availability of the original data then it is sufficient to save on-chain its hash: this is the mechanism used to save data for an ERC-721 (NFT) [22], i.e., an IPFS link that resolves the hash of the data if available. For data that is stored multiple times, it is possible to use a look-up table similar to the caching system introduced for Optimism, requiring all values to be saved at least once. For some applications, saving all the values can be avoided by using a Bloom filter [23, 24, 25], i.e., a probabilistic data structure that allows one to know with certainty whether an element does not belong to a set but admits a small but non-negligible probability of false positives. A Bloom filter is initialized as an array of 𝑚bits at zero. To add an element, 𝑘hash functions with a uniform random distribution are used, each one mapping to a bit of the array that is set to 1. To check whether an element belongs to the set we run the 𝑘hash functions and verify that the 𝑘bits are set to 1. In a simple Bloom’s filter there is no way to distinguish whether an element actually belongs to the set or is a false positive, a probability that grows as the number of entries increases. After inserting 𝑛elements: P[false positive] = (︃ 1 − [︂ 1 −1 𝑚 ]︂𝑘𝑛)︃𝑘 ≈ (︁ 1 −𝑒−𝑘𝑛/𝑚)︁𝑘 assuming independence of the probability of each bit set. If 𝑛elements (of arbitrary size!) are expected to be included and the probability of a false positive tolerated is 𝑝, the size of the array can be calculated as: 𝑚= −𝑛ln 𝑝 (ln 2)2 While the optimal number of hash functions is: 𝑘= 𝑚 𝑛ln 2 If we assume to insert 1000 elements with a tolerance of 1%, the size of the array is 9585 bits with 𝑘= 6, while for a tolerance of 0.1% it becomes 14377 bits with 𝑘= 9. If a million elements are expected to be inserted, the size of the array becomes about 1170 kB for 1% and 1775 kB for 0.1%, with the same values of 𝑘, since it depends only on 𝑝[26]. In a game where players must not be assigned to an opponent they have already challenged, instead of saving in storage for each player the list of past opponents one can use a Bloom filter. The risk of not challenging some players is often acceptable, and the filter can be reset periodically.

4.3. Ethereum compatibility The main advantage of being compatible with EVM and Ethereum is the reuse of all the available tools. Ethereum smart contracts can be published on Optimism without any modification nor new audits. Wallets remain compatible, development and static analysis tools, general analysis tools, indexing tools and oracles. Ethereum and Solidity have a long history of well-studied vulnerabilities, such as reentrancy attacks, overflows and underflows, flash loans, and oracle manipulations. Because of this, Optimism was able to capture a large amount of value in a short time. Choosing to adopt a different virtual machine implies having to rebuild an entire ecosystem, with the advantage of a greater implementation freedom. StarkNet natively implements account abstraction, which is a mechanism whereby each account is a smart contract that can implement arbitrary logic as long as it complies with an interface (hence the term abstraction): this allows the use of different digital signature schemes, the ability to change the private key using the same address, or use a multisig. The Ethereum community proposed the introduction of this mechanism with EIP-2938 in 2020, but the proposal has remained stale for more than a year as other updates have been given more priority [27]. Another important benefit gained from compatibility is the reuse of existing clients: Optimism uses a version of geth for its own node with only ∼800 lines of difference, which has been developed, tested, and maintained since 2014. Having a robust client is crucial as it defines what is accepted as valid or not in the network. A bug in the implementation of the fault proof system could cause an incorrect proof to be accepted as correct or a correct proof for an invalid block to be accepted as incorrect, compromising the system. The likelihood of this type of attack can be limited with a wider client diversity: Optimism can reuse in addition to geth the other Ethereum clients already maintained, and development of another Erigon-based client is already underway. In 2016 a problem in the memory management of geth was exploited for a DoS attack and the first line of defense was to recommend the use of Parity, the second most used client at the time 5. StarkNet faces the same problem with validity proofs, but the clients have to be written from scratch and the proof system is much more complex, and consequently it is also much more complex to ensure correctness.

비교

  1. 비교 4.1. 출금시간 낙관적 롤업과 유효성 롤업을 구별하는 가장 중요한 측면은 출금 초기화부터 완료까지 소요되는 시간입니다. 두 경우 모두, 인출은 L2에서 초기화되고 L1에서 완료됩니다. StarkNet에서 다음과 같이 마무리가 가능합니다. Ethereum에서 새로운 상태 루트의 유효성 증명이 승인되자마자 이론적으로는 다음과 같습니다. 초기화 후 L1의 첫 번째 블록에서 자금을 인출할 수 있습니다. 실제로는 Ethereum에서 유효성 증명을 보내는 빈도는 블록 속도 간의 균형입니다. 마무리 및 증명 집계. 현재 StarkNet은 검증을 위한 유효성 증명을 제공합니다. 10시간마다 4. 단, 거래 활동이 증가함에 따라 감소하도록 의도되었습니다. Optimism Bedrock에서는 분쟁이 끝난 후에만 출금을 완료할 수 있습니다. 기간(현재 7일)이 지나면 루트는 자동으로 유효한 것으로 간주됩니다. 길이 이 기간은 주로 결함 증명이 Ethereum에서 검열될 수 있다는 사실에 의해 결정됩니다. 그것의 끝. 이러한 유형의 공격의 성공 확률은 시간이 지남에 따라 기하급수적으로 감소합니다. E[감산값] = 𝑉𝑝𝑛 여기서 𝑛는 간격의 블록 수, 𝑉는 차감할 수 있는 자금의 양입니다. 유효하지 않은 루트를 게시하여 𝑝는 검열을 성공적으로 수행할 확률입니다. 단일 블록으로 공격합니다. 이 확률이 99%라고 가정하면 Rollup에 고정된 값이 는 100만 이더이고, 간격의 블록은 1800개입니다(12개의 블록이 있는 6시간의 블록). 초 간격): 예상 값은 약 0.01391 Ether입니다. 시스템은 다음에 의해 안전하게 만들어집니다. 제안자에게 예상 가치보다 훨씬 더 많은 양의 Ether를 스테이킹하도록 요청합니다. Winzeret al. 간단한 smart contract을 사용하여 검열 공격을 수행하는 방법을 보여주었습니다. 이는 상태의 특정 메모리 영역이 변경되지 않도록 보장합니다([20]). 공격 모델링 마르코프 게임으로서 이 논문은 검열이 합리적인 판단을 위한 지배적인 전략임을 보여줍니다. 블록 생산자가 변경된 거래를 포함하는 것보다 더 많은 보상을 받는 경우 기억. 위에서 논의된 𝑝값은 합리적인 블록의 백분율로 볼 수 있습니다. 네트워크의 생산자는 "합리적"이라고 할 때 처벌 가능성을 고려하지 않습니다. 암호화폐 가치를 감소시키는 blockchain에 대한 신뢰도 저하와 같은 외부 효과. 다음 코드는 검열 공격을 수행하는 데 사용할 수 있는 smart contract을 나타냅니다. 베드락에. 공격은 뇌물을 제공하여 블록 생산자의 인센티브를 이용합니다. 주의 특정 부분을 수정하는 거래를 검열합니다. 계약의 주요 내용 함수인 ClaimBribe를 사용하면 블록 생산자가 검열에 성공한 경우 뇌물을 요구할 수 있습니다. 유효하지 않은 출력 루트가 건드리지 않았는지 확인하여 대상 트랜잭션을 처리합니다. 함수 ClaimBribe(바이트 메모리 StorageProof) 외부 { require(!claimed[block.number], "뇌물은 이미 청구되었습니다."); OutputProposal 메모리 현재 = StorageOracle.getStorage(L2_ORACLE, block.number, SLOT, 저장 증명); require(invalidOutputRoot == current.outputRoot, "공격 실패"); 청구됨[block.number] = true; (부울 전송됨, ) = block.coinbase.call{value: bribeAmount}(""); 4https://etherscan.io/address/0xc662c410c0ecf747543f5ba90660f6abebd9c8c4require(sent, "이더 전송 실패"); } 목록 1: Bedrock에 대한 검열 공격을 장려하는 계약의 예. 분쟁 기간의 길이는 또한 결함 증명이 다음과 같다는 사실을 고려해야 합니다. 대화형 증거이므로 참가자가 상호 작용할 수 있는 충분한 시간이 제공되어야 합니다. 모든 상호작용은 검열될 수 있습니다. 마지막 이동이 매우 가까운 시간에 발생하는 경우 분쟁 기간이 끝나면 검열 비용이 훨씬 적습니다. 검열이 이루어지긴 하지만 지배적인 전략에서는 검열 노드가 취약하기 때문에 성공 가능성이 낮습니다. 서비스 거부 공격: 공격자는 다음으로 끝나는 매우 복잡한 트랜잭션을 생성할 수 있습니다. 수수료가 지불되지 않으므로 무료로 결함 증명을 게시합니다. 극단적인 경우 긴 분쟁 기간을 통해 성공적인 경우 조정이 가능합니다. 검열 공격을 통해 포크를 구성하고 공격하는 블록 생산자를 배제합니다. 또 다른 가능한 공격은 논쟁자가 확인할 수 있는 것보다 더 많은 상태 루트 제안을 게시하는 것으로 구성됩니다. 이는 주파수 제한을 사용하여 피할 수 있습니다. 4.1.1. 빠른 낙관적 인출 낙관적 롤업의 유효성은 언제든지 전체 노드에서 확인할 수 있으므로 신뢰할 수 있는 oracle을 사용하여 L1에서 출금이 안전하게 완료될 수 있는지 확인할 수 있습니다. 이 메커니즘은 Maker [21]에 의해 처음 제안되었습니다. oracle는 출금을 확인하고, 이자부 대출이 사용자에게 할당된 L1의 결과는 자동으로 7일이 지나면 종료됩니다. 즉, 인출이 실제로 완료될 수 있는 시점입니다. 이 솔루션 신뢰 가정을 도입하지만 Maker의 경우 oracle 연산자 이후로 최소화됩니다. 대출을 제공함으로써 위험을 감수하는 동일한 조직에 의해 관리됩니다. 4.2. 거래비용 L2 트랜잭션 비용은 대부분 L1과의 상호작용에 의해 결정됩니다. 두 솔루션 모두 트랜잭션의 계산 비용은 완전히 오프체인에서 실행되므로 매우 저렴합니다. Optimism은 L2 트랜잭션 calldata를 calldata로 게시하고 오류를 거의(또는 전혀) 실행하지 않습니다. 증명하므로 calldata는 가장 비싼 리소스입니다. 2022년 1월 12일 Bedrock 네트워크 Ethereum의 Goerli 테스트넷에서 출시되었습니다. 가스 압축률을 계산할 수 있습니다. 특정 기간 동안 베드락에서 사용된 가스의 양을 추적하고 이를 비교함으로써 해당 블록의 L1에 소비된 가스의 양입니다. 이 방법을 사용하여 가스 압축 ~20:1의 비율이 발견되었으나, 이 수치는 메인넷의 실제 활동과 다를 수 있습니다. StarkNet은 L2 상태의 모든 변경 사항을 Ethereum에 호출 데이터로 게시하므로 스토리지는 가장 비싼 자원. 네트워크는 EVM을 사용하지 않으므로 거래 비용은 압축은 사소하게 추정할 수 없습니다. 실행 비용과 호출 데이터를 가정하여 무시할 수 있으므로 스토리지 쓰기의 압축률을 계산할 수 있습니다. L1. 배포된 계약이 없고 StarkNet에서 이전에 액세스하지 않은 10개의 셀이 다음과 같다고 가정합니다. 수정된 결과 ~24:1의 스토리지 쓰기 비용 압축률이 발견되었습니다. 셀을 덮어쓴 경우 𝑛데이터 게시 사이에 각 쓰기 비용은 비용과 비교하여 1/𝑛입니다. 단일 쓰기의 경우 마지막 쓰기만 게시되기 때문입니다. 비용을 더욱 최소화할 수 있습니다.자주 사용되는 값을 압축합니다. 유효성 증명 검증 비용은 다음과 같이 나뉩니다. 참조하는 트랜잭션: 예를 들어 StarkNet 블록 4779에는 200개의 트랜잭션이 포함되어 있으며 그 유효성 증명은 각 거래마다 267830개 가스 또는 1339.15개 가스를 소비합니다. 4.2.1. 통화 데이터 최적화: 캐시 계약 아래에는 자주 사용되는 주소 캐시를 구현한 smart contract이 나와 있습니다. 저장 및 실행 비용이 훨씬 저렴하다는 점을 활용하여 주소를 지정합니다. 리소스와 그 사용을 보여주는 Friends 계약이 함께 제공됩니다. 후자는 다음을 추적합니다. addFriend 함수를 호출하여 등록할 수 있는 주소의 "친구"입니다. 주소인 경우 이미 한 번 이상 사용된 경우 addFriendWithCache를 호출하여 추가할 수 있습니다. 함수: 캐시 인덱스는 4바이트 정수이고 주소는 20바이트로 표시됩니다. 따라서 함수 인수가 5:1로 절약됩니다. 다른 데이터에도 동일한 논리를 사용할 수 있습니다. 정수 또는 더 일반적으로는 바이트와 같은 유형입니다. 계약 AddressCache { 매핑(주소 => uint32) 공개 주소2키; 주소[] 공개 키2주소; 함수 캐시Write(address _address) 내부 반환(uint32) { require(key2address.length < type(uint32).max, "AddressCache: 캐시가 가득 찼습니다."); require(address2key[_address] == 0, "AddressCache: 주소가 이미 캐시되었습니다."); // 0은 "찾을 수 없음"을 의미하므로 키는 1부터 시작해야 합니다. uint32 키 = uint32(key2address.length + 1); address2key[_address] = 키; key2address.push(_address); 리턴 키; } 함수 캐시읽기(uint32 _key) 공개 보기는 (주소) {를 반환합니다. require(_key <= key2address.length && _key > 0, "AddressCache: 키를 찾을 수 없습니다."); return key2address[_key - 1]; } } 목록 2: 주소 캐시 계약. 계약 친구는 AddressCache입니다. 매핑(주소 => 주소[]) 공개 친구; 함수 addFriend(주소_친구) 공개 { 친구[msg.sender].push(_friend); 캐시쓰기(_friend); } 함수 addFriendWithCache(uint32 _friendKey) 공개 { 친구[msg.sender].push(cacheRead(_friendKey)); } 함수 getFriends() 공개 보기는 (주소[] 메모리)를 반환합니다. 친구에게 돌아가기[msg.sender];} } 목록 3: 주소 캐시를 상속하는 계약의 예. 계약은 캐시에서 약 40억(232)개의 주소를 지원하며 1바이트를 추가하면 약 1조(240). 4.2.2. 스토리지 최적화: Bloom의 필터 StarkNet에는 스토리지 사용량을 최소화하는 몇 가지 기술이 있습니다. 꼭 필요하지 않은 경우 원본 데이터의 가용성을 보장하면 hash을 온체인에 저장하는 것으로 충분합니다. ERC-721(NFT) [22], 즉 IPFS 링크를 해결하는 데이터를 저장하는 데 사용되는 메커니즘입니다. 사용 가능한 경우 데이터의 hash. 여러 번 저장된 데이터의 경우 조회 기능을 사용할 수 있습니다. 테이블은 Optimism에 도입된 캐싱 시스템과 유사하며 모든 값을 다음 위치에 저장해야 합니다. 적어도 한 번은. 일부 애플리케이션의 경우 Bloom 필터를 사용하면 모든 값을 저장하지 않을 수 있습니다. [23, 24, 25], 즉, 확실하게 알 수 있는 확률적 데이터 구조입니다. 요소는 집합에 속하지 않지만 작지만 무시할 수 없는 거짓 확률을 허용합니다. 긍정적인 점. 블룸 필터는 0에서 𝑚비트 배열로 초기화됩니다. 요소를 추가하려면 𝑘hash 함수를 사용하세요. 균일한 무작위 분포가 사용되며 각각은 설정된 배열의 비트에 매핑됩니다.
  2. 요소가 세트에 속하는지 확인하기 위해 𝑘hash 함수를 실행하고 확인합니다. 𝑘 비트가 1로 설정되어 있습니다. 간단한 Bloom 필터에서는 요소가 실제로 세트에 속하거나 위양성(수에 따라 증가하는 확률)입니다. 항목이 증가합니다. 𝑛요소를 삽입한 후: P[거짓양성] = (︃ 1 - [︂ 1 −1 𝑚 ]︂𝑘𝑛)︃𝑘 ≒ (︁ 1 −𝑒−𝑘𝑛/𝑚)︁𝑘 각 비트 세트의 확률은 독립이라고 가정합니다. 𝑛요소(임의의 크기)가 다음과 같은 경우 포함될 것으로 예상되며 허용되는 잘못된 긍정의 확률은 𝑝, 즉 배열의 크기입니다. 다음과 같이 계산할 수 있습니다. 𝑚= −𝑛ln 𝑝 (2)2 hash 함수의 최적 개수는 다음과 같습니다. 𝑘= 𝑚 𝑛2에 허용오차가 1%인 1000개의 요소를 삽입한다고 가정하면 배열의 크기는 9585비트입니다. 𝑘= 6인 경우 허용 오차가 0.1%인 경우 𝑘= 9인 경우 14377비트가 됩니다. 요소가 백만 개이면 삽입될 것으로 예상되면 배열의 크기는 1%의 경우 약 1170kB, 1%의 경우 약 1775kB가 됩니다. 0.1%, 𝑝[26]에만 의존하므로 𝑘 값이 동일합니다. 플레이어가 이미 도전한 상대에게 배정되어서는 안 되는 게임에서, 각 플레이어의 저장소에 과거 상대 목록을 저장하는 대신 Bloom을 사용할 수 있습니다. 필터. 일부 플레이어에게 도전하지 않는 위험은 대개 허용되며 필터는 재설정될 수 있습니다. 주기적으로.4.3. Ethereum 호환성 EVM 및 Ethereum과 호환되는 주요 이점은 사용 가능한 모든 항목을 재사용한다는 것입니다. 도구. Ethereum smart contracts는 수정 없이 Optimism에 게시될 수 있습니다. 새로운 감사. 지갑은 호환성을 유지하며 개발 및 정적 분석 도구, 일반 분석 도구, 색인 도구 및 oracles. Ethereum 및 Solidity는 오랫동안 잘 연구된 역사를 가지고 있습니다. 재진입 공격, 오버플로 및 언더플로, 플래시 대출 및 oracle과 같은 취약점 조작. 이로 인해 Optimism은 단시간에 많은 가치를 포착할 수 있었습니다. 시간. 다른 가상 머신을 채택한다는 것은 전체 생태계를 재구축해야 한다는 것을 의미합니다. 구현의 자유도가 더 높다는 장점이 있습니다. StarkNet은 기본적으로 계정을 구현합니다. 추상화는 각 계정이 구현할 수 있는 smart contract인 메커니즘입니다. 인터페이스를 준수하는 한 임의의 논리(따라서 추상화라는 용어가 사용됨): 이를 통해 다양한 디지털 서명 체계 사용, 개인 키를 변경하는 기능 동일한 주소를 사용하거나 다중 서명을 사용하세요. Ethereum 커뮤니티에서 이 기능의 도입을 제안했습니다. 2020년에 EIP-2938과 함께 메커니즘을 도입했지만 제안은 1년 넘게 오래된 상태로 남아 있습니다. 다른 업데이트에는 더 많은 우선순위가 부여되었습니다([27]). 호환성을 통해 얻을 수 있는 또 다른 중요한 이점은 기존 클라이언트를 재사용한다는 것입니다. Optimism 자체 노드에 약 800줄의 차이만 있는 geth 버전을 사용합니다. 2014년부터 개발, 테스트 및 유지 관리되었습니다. 강력한 클라이언트를 갖는 것은 정의에 따라 매우 중요합니다. 네트워크에서 유효한 것으로 허용되는 것과 그렇지 않은 것. 결함 증명 구현의 버그 시스템으로 인해 잘못된 증거가 올바른 것으로 받아들여지거나 잘못된 증거에 대한 올바른 증거로 받아들여질 수 있습니다. 차단을 잘못된 것으로 받아들여 시스템을 손상시킵니다. 이런 종류의 확률 더 넓은 클라이언트 다양성으로 공격을 제한할 수 있습니다. Optimism는 geth 외에 재사용할 수 있습니다. 다른 Ethereum 클라이언트는 이미 유지 관리되고 있으며 다른 Erigon 기반 클라이언트의 개발은 이미 진행 중입니다. 2016년에는 geth의 메모리 관리 문제가 악용되었습니다. DoS 공격과 첫 번째 방어선은 두 번째로 가장 많이 사용되는 Parity의 사용을 권장하는 것이었습니다. 당시 사용했던 클라이언트 5. StarkNet은 유효성 증명과 관련해 동일한 문제에 직면했지만 클라이언트는 처음부터 작성해야 하며 증명 시스템은 훨씬 더 복잡합니다. 정확성을 보장하는 것도 훨씬 더 복잡합니다.

Conclusion

Conclusion

  1. Conclusion Rollups are the most promising solution available today to solve the scalability problem in decentralized blockchains, paving the way for the era of modular blockchains as opposed to monolithic blockchains. The choice of developing either an Optimistic Rollup or a Validity Rollup is mainly shown as a trade-off between complexity and agility. StarkNet has numerous advantages such as fast withdrawals, structural inability to have invalid state transitions, lower transaction cost at the expense of a longer development period and incompatibility with EVM, while Optimism has leveraged the network economy to quickly gain a major share of the market. Optimism Bedrock, however, possesses a modular design that allows it to become a Validity 5https://blog.ethereum.org/2016/09/22/ethereum-network-currently-undergoing-dos-attack

Rollup in the future: Cannon currently uses minigeth compiled to MIPS for its fault proof system, but the same architecture can be used to obtain a circuit and produce validity proofs. Compiling a complex machine such as the EVM for a microarchitecture results in a simpler circuit that does not need to be modified and re-verified in case of upgrades. RISC Zero is a verifiable microarchitecture with STARK proofs already in development based on RISC-V that can be used for this purpose as an alternative to MIPS [28]. One aspect that should not be underestimated is the complexity in understanding how the technology works. A strength of traditional blockchains is to be able to verify the state of the blockchain without trusting any third party entity. However, in the case of StarkNet, it is necessary to trust the implementation when it is not possible to verify the various components based on cryptography and advanced mathematics. This may initially create friction for the adoption of the technology, but as the tools and the usage of integrity proofs advance even outside the blockchain field this problem will be hopefully solved.

결론

  1. 결론 롤업은 오늘날 확장성 문제를 해결하기 위해 사용할 수 있는 가장 유망한 솔루션입니다. 탈중앙화된 blockchain, 모듈형 blockchain 시대의 길을 열다 모놀리식 blockchains. 낙관적 롤업 또는 유효성 롤업 개발 선택이 주로 표시됩니다. 복잡성과 민첩성 사이의 절충안입니다. StarkNet은 빠른 속도와 같은 많은 장점을 가지고 있습니다. 인출, 유효하지 않은 상태 전환의 구조적 불가능, 낮은 거래 비용 개발 기간이 길어지고 EVM과의 비호환성이 발생하는 반면 Optimism은(는) 네트워크 경제를 활용하여 시장의 주요 점유율을 빠르게 확보했습니다. Optimism 그러나 Bedrock은 Validity가 될 수 있는 모듈식 설계를 보유하고 있습니다. 5https://blog.ethereum.org/2016/09/22/ethereum-network-currently-undergoing-dos-attack

향후 롤업: Cannon은 현재 오류 방지를 위해 MIPS로 컴파일된 minigeth를 사용합니다. 시스템이지만 동일한 아키텍처를 사용하여 회로를 얻고 유효성 증명을 생성할 수 있습니다. 마이크로아키텍처에 대해 EVM과 같은 복잡한 시스템을 컴파일하면 더 간단해집니다. 업그레이드 시 수정 및 재검증이 필요하지 않은 회로입니다. RISC 제로는 RISC-V을 기반으로 이미 개발 중인 STARK 증명을 갖춘 검증 가능한 마이크로 아키텍처 MIPS [28] 대신 이 목적으로 사용할 수 있습니다. 과소평가해서는 안되는 한 가지 측면은 어떻게 이해하는 것이 복잡하다는 것입니다. 기술이 작동합니다. 기존 blockchain의 장점은 상태를 확인할 수 있다는 것입니다. 제3자 실체를 신뢰하지 않고 blockchain. 그러나 StarkNet의 경우에는 다양한 구성요소를 검증하는 것이 불가능할 때 구현을 신뢰하는 데 필요함 암호화 및 고급 수학을 기반으로 합니다. 이로 인해 처음에는 마찰이 발생할 수 있습니다. 기술을 채택했지만 무결성 증명의 도구와 사용이 발전함에 따라 blockchain 필드 외부에서는 이 문제가 해결되기를 바랍니다.