This research was carried out by the researchers at Quantstamp funded by Quantstamp and the Ethereum Foundation Grant ID FY23-0882 (Back-End API Standard for L2 Block Explorers)
0.1.0. July 21, 2023.
- Alejandro Padilla, Audit Engineer @ Quantstamp, [email protected]
- Cameron Biniamow, Audit Engineer @ Quantstamp, [email protected]
- Ali Farooq, Software Engineer @ Quantstamp, [email protected]
- Jim Wood, Software Engineer @ Quantstamp, [email protected]
- Marius Guggenmos, Audit Engineer @ Quantstamp, [email protected]
- Jeff Chen, Junior Research Engineer @ Quantstamp, [email protected]
- Tasheme Thomas, Technical Writer @ Quantstamp, [email protected]
- Jan Gorzny, Ph.D., Head of L2 Scaling @ Quantstamp, [email protected]
- Martin Derka, Ph.D., Head of New Initiatives @ Quantstamp, [email protected]
This document presents research on APIs powering L2 block explorer. The standard is intended to be modular, to evolve, and to foster community participation in extension and long-term maintenance. This document serves as the gateway into the research contained within this repository. It is organized into three main sections. Section 1 presents the standard itself. It contains all the individual artifacts which resulted in the existence of the standard, and can be further extended by the community. Section 2 shows the thoughts behind the standard, which resulted in the form that the standard currently has. Section 3 outlines guidelines for contribution.
The presented standard defines the API that a layer 2 blockchain needs to expose to a block explorer web application. We do not anticipate that the blockchain would expose the API directly through its nodes, but rather through an indexing service (see the diagram in Section 1.1). The API itself is presented in the OpenAPI format linked from Section 1.3.
The API standard would be self-serving and not useful without a reference block explorer application in mind, we tightly couple it with requirements for a block explorer application. Those are presented in Section 1.4. The requirements have the form of a hierarchy of extensions that can be applied to a basic data model of a blockchain that is formed only by blocks and transactions. The hierarchy is described in Section 1.2. While the basic model of blocks and transactions would be sufficient to present a rudimentary block explorer for any generic blockchain (not even necessarily L2), the extensions are required to capture the nuances of the L2 families and individual chains.
If implementing a block explorer application that uses this standard, you should select the subset of the specification extensions that your application intends to implement, and require that the API that your application consumes exposes the endpoints that this standard defines for those individual extensions. If you are implementing a blockchain, or an indexer for the blockchain, you should choose the subset of the extensions that apply to your chain, and exposed the specified APIs.
Each requirement in an individual extension is further tagged as core or optional. The block explorers MUST implement all the core requiremetns to implement the extension, but they CAN but DO NOT HAVE TO implement the optional requirements. Similarly, the API conforming to this standard MUST include all the data to support implementation of the core requriements, but DOES NOT HAVE TO include the optional data.
The standard is catered towards L2s that use Ethereum as their L1.
The standard is not intended to be frozen in time. It is inteded to evolve as new L2 networks are developed, and it is structured to foster community contributions (more in Section 3).
The API Specification assumes a block chain explorer architecture of four levels as depicted:
flowchart TB;
ui(User Interface)-->app(Web Application Backend);
app--> |API Defined by This Standard | indexer(Indexer)
indexer-->chain(Chain)
The reference API is therefore only intended for fetching data that exists on-chain by the block explorer web application - either via an intermediate indexer, or directly through a node on the chain. This document therefore explicitly excludes information not stored on-chain such as smart contract source code.
The API standard has a hierarchical structure formed by the Base requirements and APIs, and Extensions to those. See the introduction in Section 1 for more details. Here we present the hierarchy in the form of a graph (DAG).
flowchart BT
subgraph base ["Base"]
Transaction
Block
end
eth_acc_ex(Eth Account\nExtension)-->base
batch_ex(Batch\nExtension)-->base
op_ex(Optimistic Rollup\nExtension)-->base
zk_batch_ex(Zero Knowledge\nBatch Extension)-->batch_ex
l2_l1_ex(L2 -> L1\nTransaction\nExtension)-->base
l1_l2_ex(L1 -> L2\nTransaction\nExtension)-->base
int_tx_ex(Internal EVM Transaction\nExtension)-->base
event_logs(Event Logs\nExtension)-->base
evm_sc_ex(EVM Smart Contract\nExtension)-->eth_acc_ex
evm_scsc_ex(EVM Smart Contract\nSource Code\nExtension)-->evm_sc_ex
evm_sci_ex(EVM Smart Contract\nInteraction\nExtension)-->evm_scsc_ex
int_tx_ex(Internal EVM Transaction\nExtension)-->l2_l1_ex
int_tx_ex(Internal EVM Transaction\nExtension)-->l1_l2_ex
We provide the specification in the OpenAPI format. The reference OpenAPI specification files can be found in the open-api directory:
- Base Data Endpoints (accommodates requirements listed in Sections 1.4.1.1 and 1.4.1.2)
- Block Batch Extension (accommodates requirements listed in Section 1.4.2.1)
- Ethereum Account Extension (accommodates requirements listed in Section 1.4.2.2)
- EVM Smart Contract Extension (accommodates requirements listed in Section 1.4.2.3)
- Requirements listed in Section 1.4.2.4 related to verification of smart contract source code are not matched with a reference API as the source code of smart contract is not persisted on-chain and should be managed on the block explorer application level rather than by the chain indexer
- Requirements listed in Section 1.4.2.5 related to interaction of the block explorer with smart contracts, typically using the web3 library, and thus are not matched with a reference API
- L1->L2 Transactions Extension (accommodates requirements listed in Section 1.4.2.6)
- L2->L1 Transactions Extension (accommodates requirements listed in Section 1.4.2.7)
- Optimistic Rollup Extension (accommodates requirements listed in Section 1.4.2.8)
- Zero Knowledge Batch Extension (accommodates requirements listed in Section 1.4.2.9)
- Internal EVM Transaction Extension (accommodates requirements listed in Section 1.4.2.10)
- Event Logs Extension (accommodates requirements listed in Section 1.4.2.11)
In this section, we list requirements for a block explorer web application that can be supported by the standardized API presented in Section 1.3.
The base requirements focus on the basis of a generic L2 blockchain. They capture only the basic aspect - the chain contains some blocks, and those blocks contain transactions. The extensions to this basic concept are covered in Section 1.4.2. See Section 1.2 for the extension dependency graph.
ID | Description | Core or Optional |
---|---|---|
TX1 | A block explorer MUST display a list of L2 transactions. | Core |
TX2 | The list of L2 transactions MUST be sequential and sortable with a default sorting that displays the more recent L2 transactions first. | Core |
TX3 | The list of L2 transactions MUST contain at least the L2 transactions that are a part of the current chain as per the definition of the βcurrent stateβ of the rollup. | Core |
TX4 | The list of L2 transactions MUST contain at least the identifier of the L2 transactions (such as the hash). | Core |
TX5 | The list of L2 transactions SHOULD include L2 transactions that are not yet part of the state, but it is expected that they will become part of the state in the future (e.g. they are in the pending L2 blocks). | Optional |
TX6 | A block explorer MUST display the core details of each individual L2 transaction. | Core |
TX7 | The page displaying the details of an L2 transaction MUST be directly accessible via the transaction hash. | Core |
TX8 | A block explorer SHOULD display the optional details of each individual L2 transaction. The details to display depend on the specific chain. | Optional |
TX9 | A block explorer SHOULD display the details of each individual L2 transaction that is known to the chain (the transaction was at some point submitted to the nodes, but was dropped or has not been processed yet), but is not part of the current chainβs state as per the definition of the βcurrent stateβ of the rollup. | Optional |
TX10 | When displaying details of a single L2 transaction, the block explorer MUST display at least the following information:
|
Core |
ID | Description | Core or Optional |
---|---|---|
BL1 | A block explorer MUST display a list of L2 blocks. | Core |
BL2 | The list of L2 blocks MUST be sequential and sortable with a default sorting that displays the more recent L2 blocks first. | Core |
BL3 | The list of L2 blocks MUST contain at least the L2 blocks that are a part of the current chain as per the definition of the βcurrent stateβ of the rollup. | Core |
BL4 | The list of L2 blocks MUST contain at least the identifier of the L2 block (e.g. block hash). | Core |
BL5 | The list of L2 blocks SHOULD include L2 blocks that are not yet part of the state (e.g. pending L2 blocks), but it is expected that they will become part of the state in the future. | Optional |
BL6 | A block explorer MUST display the core details of each individual L2 block. | Core |
BL7 | The page displaying the details of an L2 block MUST be directly accessible via the unique block identifier (e.g. hash, but not block number). | Core |
BL8 | A block explorer SHOULD display the optional details of each individual L2 block. The details to display depend on the specific chain. | Optional |
BL9 | A block explorer SHOULD display the details of each individual L2 block that is known to the chain (either, the block is not yet fully included in the state, or it is not a part of the state any more), but is not part of the current chainβs state as per the definition of the βcurrent stateβ of the rollup. | Optional |
BL10 | When displaying details of a single L2 block, the block explorer MUST display at least the following information:
|
Core |
This section covers the extensions to base requirements presented in Section 1.4.1. See Section 1.2 for the extension dependency chart.
ID | Description | Core or Optional |
---|---|---|
X_BB_1 | A block explorer MUST display a list of L2 block batches. | Core |
X_BB_2 | The list of L2 block batches MUST be sequential and sortable with a default sorting that displays the more recent L2 batches first. | Core |
X_BB_3 | The list of L2 block batches MUST contain at least the L2 block batches that are a part of the current chain as per the definition of the βcurrent stateβ of the rollup. | Core |
X_BB_4 | The list of L2 block batches MUST contain at least the identifier of the L2 block batch. | Core |
X_BB_5 | The list of L2 block batches SHOULD include L2 block batches that are not yet part of the state (e.g. pending L2 block batches), but it is expected that they will become part of the state in the future. | Optional |
X_BB_6 | A block explorer MUST display the core details of each individual L2 block batch. | Core |
X_BB_7 | The page displaying the details of an L2 block batch MUST be directly accessible via the unique block batch identifier (e.g. hash). | Core |
X_BB_8 | A block explorer SHOULD display the optional details of each individual L2 block batch. The details to display depend on the specific chain. | Optional |
X_BB_9 | A block explorer SHOULD display the details of each individual L2 block batch that is known to the chain (either, the block batch is not yet fully included in the state, or it is not a part of the state any more), but is not part of the current chainβs state as per the definition of the βcurrent stateβ of the rollup. | Optional |
X_BB_10 | When displaying details of a single L2 block batch, the block explorer MUST display at least the following information:
|
Core |
X_BB_11 | When displaying details of a single L2 block, the block explorer MUST display at least the following information in addition to the information stipulated by other requirements:
|
Core |
ID | Description | Core or Optional |
---|---|---|
X_EA_1 | A block explorer MUST display the core details of each individual account. | Core |
X_EA_2 | The page displaying the details of an account MUST be directly accessible via the address. | Core |
X_EA_3 | When displaying details of a single account, the block explorer MUST display at least the following information:
|
Core |
ID | Description | Core or Optional |
---|---|---|
X_SC_1 | A block explorer MUST indicate that an account is a smart contract if it has non-null bytecode. | Core |
X_SC_2 | When displaying details of a smart contract account, the block explorer MUST display the following information in addition to the other account details defined previously:
|
Core |
ID | Description | Core or Optional |
---|---|---|
X_SCSC_1 | A block explorer MUST provide the option of verifying smart contracts. | Core |
X_SCSC_2 | A block explorer MUST accept the source code if it compiles into the deployed bytecode given the constructor parameters and the configuration of the compiler. | Core |
X_SCSC_3 | A block explorer MUST reject the source code if it does not compile into the deployed bytecode given the constructor parameters and the configuration of the compiler. | Core |
X_SCSC_4 | When displaying details of a smart contract account, the block explorer MUST display the following information in addition to the other smart contract account details defined previously:
|
Core |
X_SCSC_5 | A block explorer MUST provide the option to challenge the existing verified contract source code. If the smart contract source code does not compile into the deployed bytecode given the constructor parameters and the configuration of the compiler, then the block explorer MUST nullify the above smart contract details. | Core |
ID | Description | Core or Optional |
---|---|---|
X_SCI_1 | A block explorer MUST be able to create L2 transactions that interact with the write methods of smart contracts that have verified code. | Core |
X_SCI_2 | A block explorer MUST be able to invoke read methods and display the return value of smart contracts that have verified code. | Core |
ID | Description | Core or Optional |
---|---|---|
X_L1L2_1 | A block explorer MUST indicate that a transaction in the list of L2 transactions is L1->L2 if it is. | Core |
X_L1L2_2 | When displaying details of a single L1->L2 transaction, the block explorer MUST display the following information in addition to the other L2 transaction details defined previously:
|
Core |
ID | Description | Core or Optional |
---|---|---|
X_L2L1_1 | A block explorer MUST indicate that a transaction in the list of L2 transactions is L2->L1 if it is. | Core |
X_L2L1_2 | When displaying details of a single L2->L1 transaction, the block explorer MUST display the following information in addition to the other L2 transaction details defined previously:
|
Core |
ID | Description | Core or Optional |
---|---|---|
X_OR1 | A block explorer MUST indicate that a block in the list of L2 blocks has been challenged if it was. | Core |
X_OR2 | When displaying details of a challenged L2 block, the block explorer MUST display the following information in addition to the other L2 block details defined previously:
|
Core |
ID | Description | Core or Optional |
---|---|---|
X_ZK1 | When displaying details of a batch, the block explorer MUST display the following information in addition to the other batch details defined previously:
|
Core |
ID | Description | Core or Optional |
---|---|---|
X_IT1 | A block explorer MUST display the internal transactions[1] (message calls) that were triggered while executing the L2 transaction. | Core |
X_IT2 | When displaying details of an internal transaction, the block explorer MUST display at least the following information:
|
Core |
X_IT3 | When displaying details of an internal transaction, the block explorer SHOULD display the following information: | Optional |
Internal Transaction. This refers to transactions that take place between smart contracts, including transactions from a smart contract to an external address when sending ETH to a user. When an external address calls a smart contract to execute an operation, the contract's built-in logic calls other contracts needed for completion. In a single transaction, a smart contract may need to perform several internal transactions with one or many contracts.
Type of internal transaction. In most block explorers, the type of internal transaction is determined by the OPCODE that was used to trigger the internal transaction. For example, CREATE
, CALL
, STATICCALL
, DELEGATECALL
, SUICIDE
, etc.
Type Trace Address. An identifier used by some block explorers to identify internal transactions within a transaction. For example, call_0_1
. This identifier consists of two parts:
- The type of internal transaction (e.g.,
call
,staticcall
,create
,suicide
, etc). - The trace address, which is the index of a given internal transaction in an EVM trace tree (EVM traces provide a step-by-step record of what happened during the execution of a transaction and are represented in a tree format).
ID | Description | Core or Optional |
---|---|---|
X_LE1 | A block explorer MUST display the events emitted while executing the L2 transaction. | Core |
X_LE2 | When displaying details of an emitted event, the block explorer MUST display at least the following information:
|
Core |
X_LE3 | A block explorer SHOULD indicate if each parameter in an event is indexed or not. | Optional |
X_LE4 | A block explorer SHOULD allow the representation of event parameters in different formats (e.g. decimal, hexadecimal). | Optional |
Event Signature. The combination of the event name and the types of parameters it contains. For example, Transfer(address,address,uint256)
.
Log Topic. A log topic is a 32-byte word used to describe the inner workings of an event. A log object describing an event can have up to four topics. The first topic corresponds to the keccak256 hash of the event signature (except for anonymous events). The remaining topics are used for the values of indexed parameters in the event. Topics are typically used to narrow down search queries based on data.
This section outlines the systematic investigation of the L2 block explorer API that resulted in the presented standard.
In this section, we describe the methodology applied to the investigation in the block explorers.
- Mapping the L2 landscape. We begin the investigation by listing L2s and other blockchains relevant for this work. We note down some basic characteristics about these networks: are they zero-knowledge or optimistic rollups, are they EVM compatible, what blockchain explorer do they use, etc. Based on these attributes, we make a shortlist of networks that we will use for deriving data.
- Documenting transaction models. For the selected blockchains from the L2 landscape, we document the model for executing transactions and their respective rollups. We use sequence and entity-relationship diagrams to capture the information more formally.
- Defining a block explorer. Before proposing an API standard, we need to define what we actually mean by a block explorer. We base this definition on the individual transaction models, derive commonalities and elicit requirements for a sensible block explorer. We define the minimum functionality based on the common patterns (such as a block list visualization), and call such requirements base. We further define a system of optional extensions to the base requirements. This makes our standard modular.
- Cross-referencing the block explorer features. Having defined requirements for a block explorer, we evaluate the existing block explorer implementations. We evaluate both the closed source explorers that are currently used by selected networks, and the open source block explorer implementations.
- Refining the requirements. Based on our survey of the existing implementations as well as the network features, we refine the original requirements. We focus on universality and the proper isolation of features into individual modules.
- Proposing the API. With the systematic preparation done, we can propose an API that allows for implementation of the required features.
- Describing a sample indexing service implementation. To demonstrate the feasibility, we include a high-level description of how an indexing service that serves the required API could be implemented.
In this section, we present a comparison of L2 networks, and select networks that we will use as a representative sample during our investigation.
- The first Arbitrum AnyTrust Chain running on Ethereum mainnet.
- Gaming and social use cases.
- Implements the Arbitrum AnyTrust Protocol, not the Arbitrum Rollup Protocol protocol.
- Etherscan and BlockScout explorers.
- Focuses on ultra-low transaction fees - it's meant to be used by cost-sensitive apps.
- Nova differs from Arbitrum One by not posting transaction data on-chain but to Data Availability Committee.
- Proof construction relies fully on data that is NOT published on-chain. There is a data availability committee (DAC) that is tasked with protecting and supplying the data.
- Just like Arbitrum One, it supports Nitro technology to be EVM compatible.
- Arbiscan was built by the Etherscan team.
- As of May 2023, it has a total value locked (TVL) of approximately 5.8 billion USD.
- Full EVM compatibility. Previously, would use the AVM (Arbitrum Virtual Machine) to achieve this, now it is done via Nitro (it uses WASM - WebAssembly).
- All data is available on-chain.
- The first Arbitrum Rollup Chain running on Ethereum mainnet.
- Fully trustless; inherits Ethereum's base-layer security guarantees without introducing additional trust assumptions.
- Used for decentralized finance and other use-cases that demand L1-level trustlessness.
- The Aztec protocol has been deprecated. Deposits and shielding are no longer accepted, and blocks will be processed until the 8th of July, 2023 to allow users to withdraw their funds.
- Aztec was an open-source layer 2 network aiming to bring scalability and privacy to Ethereum.
- It aimed to enable affordable, private crypto payments via zero-knowledge proofs.
- Used ZK-SNARKS.
- All the data needed for proof construction is published on-chain.
- Balances and identities for all tokens on the Aztec rollup are encrypted. Each transaction is encoded as a zkSNARK, protecting user data.
- This project was replaced by Aztec Connect, which in turn is being deprecated, for a new version of Aztec with support for Aztec Noir.
- Aztec Connect stopped operations on March 21st, 2023. Moving forward, Aztec Connect will only allow for withdrawals for one year.
- Privacy-first ZK Rollup. Aims to bring scalability and privacy to Ethereum.
- Aimed to enable affordable, private crypto payments via zero-knowledge proofs.
- Uses ZK-SNARKS.
- All data needed for proof construction is published on-chain.
- The explorer appears to be custom.
- The Aztec team is shifting the resources used for Aztec Connect to two projects:
- Aztec Noir: A programming language for writing and verifying zero-knowledge proofs. Their goal is to make it easy to incorporate zero-knowledge cryptograpy in applications, without deep cryptography knowledge.
- New Aztec encrypted ZK Rollup: They are creating a new rollup, based on Aztec Connect's infrastructure, with support for their Aztec Noir programming language.
- This rollup will allow private smart contract execution.
- Based on Optimism Bedrock.
- Base has minor differences from Ethereum including opcodes, block time and size, and some custom JSON-RPC methods.
- The block explorer is also based on Etherscan.
- It is based on Optimism. However, they have added a swap-based mechanism to allow for faster withdrawal times. Also, they approach cross-chain and bridging differently.
- As of May 2023, it has a total value locked (TVL) of approximately 11.19M USD.
- Boba is built and maintained by Enya and the OMG Foundation (they deal with OMG Plasma network too).
- It appears that there is also a blockscout explorer for Boba. In fact, the OMG GitHub has a Blockscout project. However, Blockscout is not mentioned in their official documentation.
- Built using StarkEx technology.
- Provides centralized investment and trading services to financial institutions.
- Private chain without a public block explorer.
- Uses ZK-STARKs.
- Proof construction relies entirely on data that is NOT published on-chain.
- This is an exchange.
- It is based on Starkware (StarkEx)
- The block explorer is NOT officially supported by dYdX (does not appear in their documentation). It was created by L2Beat (with funding from StarkWare).
- It uses ZK-Snarks.
- All data for proof construction is published on-chain.
- As of May 2023, it has a total value locked (TVL) of approximately 351M USD.
- Low/no activity on the Fuel mainnet - unclear what there roadmap looks like.
- Fuel testnet is active but uses a different block explorer than the mainnet.
- All of the data needed for proof construction is published on-chain.
- Application specific (exchange).
- Based on StarkEx.
- Their documentation does not describe it as a validium. However, L2Beat classifies it as such. This is probably because proof of construction relies fully on data that is NOT published on-chain. There exists a data availability committee (DAC) that is tasked with protecting and supplying the data.
- Focuses a lot on games. It is a Layer 2 for NFTs.
- It looks like their blockchain explorer was built by the community.
- Uses ZK-Starks.
- Provides an escape hatch (MP)
- Built using Polygon zkEVM.
- Still in development.
- No block explorer.
- Application-specific layer 2 which aggregates users' DeFi transactions.
- All of the data needed for proof construction is published on-chain.
- No block explorer.
- Uses ZK-SNARKS.
- All of the data needed for proof construction is published on-chain.
- Provides an escape hatch (MP)
- It does not appear to be EVM compatible.
- Currently only on a testnet.
- Appears to use a custom BlockScout explorer.
- Has a public repo for the custom explorer.
- Based on Optimism.
- According to Metis documentation, this is a Rollup. However, L2Beat calls it an optimistic chain. This is probably because, according to L2 Beat, since April 2022 they use an "optimistic data availability" scheme in which transaction data is kept off-chain in MEMO, while Validators can request tx data from Sequencer via L1 challenge mechanism if it does not make it available for validation off-chain.
- Note: MEMO is an off-chain decentralized storage from MemoLabs.
- The block explorer is based on Blockscout.
- The EVM compatibility is done via the OVM (Optimistic Virtual Machine)
- Focuses on supporting the easy creation of DACs (Decentralized Autonomous Companies).
- By default, Optimism uses Etherscan. However, it also supports Blockscout for Testnet.
- As of May 2023, it has a total value locked (TVL) of approximately 1.77B USD.
- All data is available on-chain.
- Optimism claims that they are EVM equivalent.
- Rolled out the beta version to mainnet.
- Polygon zkEVM is aiming to become a decentralized Ethereum Layer 2 scalability solution using zk proofs to offer validity and finality of off-chain transactions.
- Attempts to provide Ethereum Virtual Machine (EVM) equivalence (opcode-level compatibility).
- Uses ZK-SNARKS.
- All the data needed for proof construction is published on-chain. However, unlike other ZK rollups, transactions are posted instead of state diffs.
- There is NO mechanism to add transactions to L1 if the sequencer is down or censoring transactions.
- Currently only on a testnet.
- Compatible with EVM byte code.
- Has BlockScout and Unifra block explorers.
- It is NOT EVM compatible. Instead, it uses Cairo.
- All data for proof construction is published on-chain.
- Does NOT provide escape hatches.
- Does NOT have a mechanism to handle a sequencer that is down or that censors transactions (not possible to push directly on L1).
- Uses ZK-Starks.
- Starkscan has a GitHub repository for that part in charge of verifying Cairo contracts.
- Viewblock develops block explorers for many blockchains.
- Application-specific which consists of three main parts:
- ZKSwap V3 - L2 AMM DEX utilizing ZK Rollup technology.
- ZKSquare - payment service.
- ZKSea - NFT Marketplace.
- Uses ZK-SNARKs.
- All of the data needed for proof construction is published on-chain.
- It is not clear which technology is used by the explorer. Matter Labs has a BlockScout repository, and the explorer does have some resemblance to BlockScout. However, ultimately it looks like a separate explorer.
- As of March 2023, it has a total value locked (TVL) of approximately 239M USD.
- It uses SNARKs
- Uses PLONK zero-knowledge proof system with KZG commitments.
- All of the data (state diffs) needed for proof construction is published on-chain.
- Formerly zkSync.
- It uses ZK-SNARKs.
- All of the data needed for proof construction is published on-chain.
- As of March 2023, it has a total value locked (TVL) of approximately 76M USD.
- Application specific - exchange, NFT minting.
- zkScan is a custom explorer with only basic features.
So far, we have surveyed the existing L2s and selected networks that we consider representative for this work in Section 2.2.1. We proceed by modeling the functionality of these networks in a greater detail. The transaction models used to derive the standard and extensions are linked below:
In the previous sections, we have investigated the properties of L2 networks. In this section, we for the first time outline what we understand the block explorer to be. We present the requirements, which we be later refined in Section 2.6 based on the existing implementations of block explorers.
ID | Description | Core or Optional |
---|---|---|
TX1 | A block explorer MUST display a list of L2 transactions. | Core |
TX2 | The list of L2 transactions MUST be sequential and sortable with a default sorting that displays the more recent L2 transactions first. | Core |
TX3 | The list of L2 transactions MUST contain at least the L2 transactions that are a part of the current chain as per the definition of the βcurrent stateβ of the rollup. | Core |
TX4 | The list of L2 transactions MUST contain at least the identifier of the L2 transactions (such as the hash). | Core |
TX5 | The list of L2 transactions SHOULD include L2 transactions that are not yet part of the state, but it is expected that they will become part of the state in the future (e.g. they are in the pending L2 blocks). | Optional |
TX6 | A block explorer MUST display the core details of each individual L2 transaction. | Core |
TX7 | The page displaying the details of an L2 transaction MUST be directly accessible via the transaction hash. | Core |
TX8 | A block explorer SHOULD display the optional details of each individual L2 transaction. The details to display depend on the specific chain. | Optional |
TX9 | A block explorer SHOULD display the details of each individual L2 transaction that is known to the chain (the transaction was at some point submitted to the nodes, but was dropped or has not been processed yet), but is not part of the current chainβs state as per the definition of the βcurrent stateβ of the rollup. | Optional |
TX10 | When displaying details of a single L2 transaction, the block explorer MUST display at least the following information:
|
Core |
ID | Description | Core or Optional |
---|---|---|
BL1 | A block explorer MUST display a list of L2 blocks. | Core |
BL2 | The list of L2 blocks MUST be sequential and sortable with a default sorting that displays the more recent L2 blocks first. | Core |
BL3 | The list of L2 blocks MUST contain at least the L2 blocks that are a part of the current chain as per the definition of the βcurrent stateβ of the rollup. | Core |
BL4 | The list of L2 blocks MUST contain at least the identifier of the L2 block (e.g. block hash). | Core |
BL5 | The list of L2 blocks SHOULD include L2 blocks that are not yet part of the state (e.g. pending L2 blocks), but it is expected that they will become part of the state in the future. | Optional |
BL6 | A block explorer MUST display the core details of each individual L2 block. | Core |
BL7 | The page displaying the details of an L2 block MUST be directly accessible via the unique block identifier (e.g. hash, but not block number). | Core |
BL8 | A block explorer SHOULD display the optional details of each individual L2 block. The details to display depend on the specific chain. | Optional |
BL9 | A block explorer SHOULD display the details of each individual L2 block that is known to the chain (either, the block is not yet fully included in the state, or it is not a part of the state any more), but is not part of the current chainβs state as per the definition of the βcurrent stateβ of the rollup. | Optional |
BL10 | When displaying details of a single L2 block, the block explorer MUST display at least the following information:
|
Core |
ID | Description | Core or Optional |
---|---|---|
BB1 | A block explorer MUST display a list of L2 block batches. | Core |
BB2 | The list of L2 block batches MUST be sequential and sortable with a default sorting that displays the more recent L2 batches first. | Core |
BB3 | The list of L2 block batches MUST contain at least the L2 block batches that are a part of the current chain as per the definition of the βcurrent stateβ of the rollup. | Core |
BB4 | The list of L2 block batches MUST contain at least the identifier of the L2 block batch. | Core |
BB5 | The list of L2 block batches SHOULD include L2 block batches that are not yet part of the state (e.g. pending L2 block batches), but it is expected that they will become part of the state in the future. | Optional |
BB6 | A block explorer MUST display the core details of each individual L2 block batch. | Core |
BB7 | The page displaying the details of an L2 block batch MUST be directly accessible via the unique block batch identifier (e.g. hash). | Core |
BB8 | A block explorer SHOULD display the optional details of each individual L2 block batch. The details to display depend on the specific chain. | Optional |
BB9 | A block explorer SHOULD display the details of each individual L2 block batch that is known to the chain (either, the block batch is not yet fully included in the state, or it is not a part of the state any more), but is not part of the current chainβs state as per the definition of the βcurrent stateβ of the rollup. | Optional |
BB10 | When displaying details of a single L2 block batch, the block explorer MUST display at least the following information:
|
Core |
ID | Description | Core or Optional |
---|---|---|
X_EA_1 | A block explorer MUST display the core details of each individual account. | Core |
X_EA_2 | The page displaying the details of an account MUST be directly accessible via the address. | Core |
X_EA_3 | When displaying details of a single account, the block explorer MUST display at least the following information:
|
Core |
ID | Description | Core or Optional |
---|---|---|
X_SC_1 | A block explorer MUST indicate that an account is a smart contract if it has non-null bytecode. | Core |
X_SC_2 | When displaying details of a smart contract account, the block explorer MUST display the following information in addition to the other account details defined previously:
|
Core |
ID | Description | Core or Optional |
---|---|---|
X_SCSC_1 | A block explorer MUST provide the option of verifying smart contracts. | Core |
X_SCSC_2 | A block explorer MUST accept the source code if it compiles into the deployed bytecode given the constructor parameters and the configuration of the compiler. | Core |
X_SCSC_3 | A block explorer MUST reject the source code if it does not compile into the deployed bytecode given the constructor parameters and the configuration of the compiler. | Core |
X_SCSC_4 | When displaying details of a smart contract account, the block explorer MUST display the following information in addition to the other smart contract account details defined previously:
|
Core |
X_SCSC_5 | A block explorer MUST provide the option to challenge the existing verified contract source code. If the smart contract source code does not compile into the deployed bytecode given the constructor parameters and the configuration of the compiler, then the block explorer MUST nullify the above smart contract details. | Core |
ID | Description | Core or Optional |
---|---|---|
X_SCI_1 | A block explorer MUST be able to create L2 transactions that interact with the write methods of smart contracts that have verified code. | Core |
X_SCI_2 | A block explorer MUST be able to invoke read methods and display the return value of smart contracts that have verified code. | Core |
ID | Description | Core or Optional |
---|---|---|
X_L1L2_1 | A block explorer MUST indicate that a transaction in the list of L2 transactions is L1->L2 if it is. | Core |
X_L1L2_2 | When displaying details of a single L1->L2 transaction, the block explorer MUST display the following information in addition to the other L2 transaction details defined previously:
|
Core |
ID | Description | Core or Optional |
---|---|---|
X_L2L1_1 | A block explorer MUST indicate that a transaction in the list of L2 transactions is L2->L1 if it is. | Core |
X_L2L1_2 | When displaying details of a single L2->L1 transaction, the block explorer MUST display the following information in addition to the other L2 transaction details defined previously:
|
Core |
flowchart BT
subgraph core ["Core"]
Transaction
Block
Batch
end
eth_acc_ex(Eth Account\nExtension)-->core
l2_l1_ex(L2 -> L1\nTransaction\nExtension)-->core
l1_l2_ex(L1 -> L2\nTransaction\nExtension)-->core
evm_sc_ex(EVM Smart Contract\nExtension)-->eth_acc_ex
evm_scsc_ex(EVM Smart Contract\nSource Code\nExtension)-->evm_sc_ex
evm_sci_ex(EVM Smart Contract\nInteraction\nExtension)-->evm_scsc_ex
In this section, we investigate the implementations of select existing block explorers. We include block explorers that are currently used by L2s, and open source block explorers available to the general public.
ID | Optimism | Arbiscan | zkSync | Aztec | Polygon ZK EVM | Scroll | Starknet (StarkScan) | DyDx |
---|---|---|---|---|---|---|---|---|
TX1 | β | β | β | β | β | β | β | |
TX2 | β | β | β | β | β (by age) | β (default by age, not sortable) | β | β |
TX3 | β | β | β | β | β | β | β | β |
TX4 | β | β | β | β | β | β | β | β |
TX5 | π« | π« | π« (has status, but is always βincludedβ) | π« | π« | π« (has pending state but not in the list) | π« | π« |
TX6 | β | β | β | β | β | β | β | |
TX7 | β | β | β | β | β | β | β | β |
TX8 | β | β | β | β | β | β | β | β |
TX9 | π« | π« | π« | π« | π« | π« | π« | π« |
TX10 | β | β | β | β | β |
ID | Optimism | Arbiscan | zkSync | Aztec | Polygon ZK EVM | Scroll | Starknet (StarkScan) | DyDx |
---|---|---|---|---|---|---|---|---|
BL1 | β | β | β | β | β | β | β | β |
BL2 | β | β | β | β | β | β (already sorted by age, but not sortable) | β | β |
BL3 | β | β | β | β | β | β | β | β |
BL4 | β | β | β | β | β (id=block number) | β (id=block number) | β | β (id = block number) |
BL5 | π« | π« | π« | π« | π« | π« (seeing pending state, but not seeing pending only blocks) | π« | π« |
BL6 | β | β | β | β | β | β | β | β |
BL7 | β | β | π« | π« | β (look by block hash, block number) | β (look by block hash, block number) | β | |
BL8 | β | β | β | β (no extra details, no proof etc) | β (has validated by) | β | β | |
BL9 | π« | π« | π« | π« | π« | π« | π« | π« |
BL10 |
ID | Optimism | Arbiscan | zkSync | Aztec | Polygon ZK EVM | Scroll | Starknet (StarkScan) | DyDx |
---|---|---|---|---|---|---|---|---|
BB1 | β | β | π« | β | β | π« | π« | |
BB2 | β | β | β | π« | β (by age) | β (default by age, not sortable) | π« | π« |
BB3 | β | β | β | π« | β | β | π« | π« |
BB4 | β | β | β | π« | β (batch number) | β (batch number) | π« | π« |
BB5 | π« | π« | π« | β (unfinalized) | β (committed batch) | π« | π« | |
BB6 | β | β | β | π« | β | β | π« | π« |
BB7 | β | β | β | π« | β | β | π« | π« |
BB8 | β (batch root) | β | β (batch root) | π« | β (state root) | β (finalized tx hash) | π« | π« |
BB9 | π« | π« | π« | π« | π« | π« | π« | |
BB10 | π« | π« | π« |
ID | Optimism | Arbiscan | zkSync | Aztec | Polygon ZK EVM | Scroll | Starknet (StarkScan) | DyDx |
---|---|---|---|---|---|---|---|---|
X_EA_1 | β | β | β | π« | β | β | β | |
X_EA_2 | β | β | β | π« | β | β | β | |
X_EA_3 | β | β | β | π« | β | β | β |
ID | Optimism | Arbiscan | zkSync | Aztec | Polygon ZK EVM | Scroll | Starknet (StarkScan) | DyDx |
---|---|---|---|---|---|---|---|---|
X_SC_1 | β | β | β | π« | β | β | β | π« |
X_SC_2 | β | β | β | π« | β | β | π« |
ID | Optimism | Arbiscan | zkSync | Aztec | Polygon ZK EVM | Scroll | Starknet (StarkScan) | DyDx |
---|---|---|---|---|---|---|---|---|
X_SCSC_1 | β | β | β | π« | β | β | π« | |
X_SCSC_2 | β | β | β | π« | π« | |||
X_SCSC_3 | π« | π« | π« | |||||
X_SCSC_4 | β | β | π« | β | π« | |||
X_SCSC_5 | π« (submit audit, compare) | π« (submit audit, compare) | π« | π« | π« | π« | π« |
ID | Optimism | Arbiscan | zkSync | Aztec | Polygon ZK EVM | Scroll | Starknet (StarkScan) | DyDx |
---|---|---|---|---|---|---|---|---|
X_SCI_1 | β | β | β | π« | β | β | π« | |
X_SCI_2 | β | β | β | π« | β | β | π« |
ID | Optimism | Arbiscan | zkSync | Aztec | Polygon ZK EVM | Scroll | Starknet (StarkScan) | DyDx |
---|---|---|---|---|---|---|---|---|
X_L1L2_1 | π« | π« | β | π« | π« | π« | π« | |
X_L1L2_2 | π« (dedicated page to view L1->L2 tx) | π« (dedicated page to view L1->L2 tx) | β (has initiator) | π« | π« (no way to see l1->l2 tx) | π« (has l1 status on tx) | π« | β |
ID | Optimism | Arbiscan | zkSync | Aztec | Polygon ZK EVM | Scroll | Starknet (StarkScan) | DyDx |
---|---|---|---|---|---|---|---|---|
X_L2L1_1 | π« | π« | β | π« | π« | π« | π« | |
X_L2L1_2 | π« (dedicated page to view L2->L1 tx) | π« (dedicated page to view L2->L1 tx) | β (has initiator) | π« | π« (no way to see l2->l1 tx) | π« (has l1 status on tx) | π« | β |
Starkscan: There are no pending blocks. Accounts have to create themselves, which requires an extension to the block explorer standard, due to the βDeploy Accountβ transaction type. Block page is accessible via block number, not block hash. There is some notion of βSTEPSβ on the block page. Block has a state root. We also see transactions, events, and message logs for every block. Blocks do not have batches, so block detail is partially implemented. The transaction list is provided. It can be sorted from the most recent or oldest. Batches do not exist on Starknet. Ethereum account is not supported, because this is Cairo, but it is very similar with the exception of the address being different. Starknet has different contract model - contracts are instances of classes, which are source codes of contracts. Classes have ABIs and code. No indications of cross-chain code.
DyDx: DyDx is not an EVM-compatible chain. It is a specialized chain which uses slightly different terminology for its concepts. The concept of blocks appears to be replaced by state updates, so we treat them as synonymous. The block explorer by L2 Beat does not allow for sorting state updates, and certainly does not show the full history. The state updates have numbers. The parents' state updates are not listed, but they can be inferred from the sequential numbering. The pending transactions are not shown. DyDx is based on StarkNet so the accounts are identified by StarkKeys. However, users can request linking with Ethereum accounts, so in this sense, displaying account information is supported. There is no smart contract support here. The L1 β L2 and L2 β L1 transactions are shown, but only for accounts, not globally.
Aztec: There are no pending blocks. Only block lists are currently supported. Explorer displays number of pending transactions, but there is no navigation to view this pending transaction list. Block details show the proof data, data root, status and the list of transactions for a given block. Block lookup is done by block number only. Cannot view any account details. There is no support to view list of transactions. There is no smart contract support.
Optimism: There are no pending blocks. Block page is directly linked by block number through the search bar, but also by hash if pasted directly into the url. Unable to find an example of a block that is no longer part of the chain's current state. Block lists do not indicated the block hash (only the block number), nor does it show a block status. There are no pending transactions. As with blocks, unable to find examples of transactions that are no longer part of the chain. Transaction details only include the block number, not the hash. Optimism Mainnet displays batches, however the Bedrock upgrade deployed in the Goerli testnet does not. No pending or removed blocks, nor do block details contain a status. Batches list the transactions contained within, but not the blocks - however blocks all appear to only contain one transaction. L1->L2 and L2->L1 transactions each have a separate dedicated page for display. There does not appear to be a mechanism for challenging existing verified contract source code.
Arbiscan: There are no pending blocks. Block page is directly linked by block number through the search bar, but also by hash if pasted directly into the url. Unable to find an example of a block that is no longer part of the chain's current state. Block lists do not indicated the block hash (only the block number), nor does it show a block status. There are no pending transactions. As with blocks, unable to find examples of transactions that are no longer part of the chain. Transaction details only include the block number, not the hash. Unlike Optimism, Arbiscan does have batches, and details show all transactions contained within as well as the block number (but not hash) of each. L1->L2 and L2->L1 transactions each have a separate dedicated page for display. There does not appear to be a mechanism for challenging existing verified contract source code.
zkSync: There are no pending blocks. Block lookup is done by block number. There does not appear to be any way to look up a bock by its hash. Unable to find an example of a block that is no longer part of the chain's current state. Block lists and details do not contain the block hash. The details contain a root hash, but since lookup by hash is unsupported, it was not possible to verify. Unable to find examples of pending transactions, or one that is no longer part of the chain's current state. Transaction details include the block number, but not the hash. It also contains the block number. Batches are well supported, although it is unclear from the display what the different status values could be or what they mean exactly - only "sealed" and "verified" statuses could be found. Batch details contain a list of included transactions, but do not indicate which blocks they belong to. L1->L2 and L2->L1 transactions appear alongside L2->L2 transactions as per requirements. There does not appear to be a mechanism for challenging existing verified contract source code. Source code display is missing construction parameters.
Polygon ZK EVM: There are no pending blocks. Block lookup can be done through block number or block hash. Unable to find an example of a block that is no longer part of the chain's current state. Block lists only displays block number but block details shows block hash along with the sequencer hash. Has a dedicated page to view pending transactions, however was not able to find an example of any pending transactions on the pending transactions page. Batch list shows the batch number along with the sequencer hash. When a batch is "unfinalized" sequence hash is displayed as "pending". Batch details shows the batch number, sequencer hash, state root and the list of transactions included in the batch. A sequencer hash is shown only if the status is "L1 Sequence Confirmed". There are no pages to view L1->L2 and L2->L1 transactions. There does not appear to be a mechanism for challenging existing verified contract source code.
Scroll: We looked at scroll's unifra explorer to see L2 and L1 transactions alongside the rollup status. Blocks can be seen whose status is "committed" on L2 but "pending" on L1. Block lookup can be done through block number or block hash. Block list displays L1 status, block number along with the validator hash. Block details shows the final status along with the block hash. Batch list shows L1 status ("pre-committed", "committed", "finalized", "skipped"), batch index along with the commit tx hash. Batch details shows the batch number, number of blocks, number of transactions, commit hash and a finalized hash if the batch is "finalized". Transaction page shows all transactions without differentiating between L1 vs L2 transactions. There are no pages to view L1->L2 and L2->L1 transactions. There does not appear to be a mechanism for challenging existing verified contract source code.
In this section, we investigate the implementations of open source block explorers.
ID | Blockscout |
---|---|
TX1 | β |
TX2 | β |
TX3 | β |
TX4 | β |
TX5 | π« |
TX6 | β |
TX7 | β |
TX8 | β |
TX9 | π« |
TX10 | β |
ID | Blockscout |
---|---|
BL1 | β |
BL2 | β |
BL3 | β |
BL4 | β (id = block number) |
BL5 | π« |
BL6 | β |
BL7 | β (look by block hash, block number) |
BL8 | β |
BL9 | π« |
BL10 |
ID | Blockscout |
---|---|
BB1 | β |
BB2 | β |
BB3 | β |
BB4 | β |
BB5 | π« |
BB6 | β |
BB7 | β |
BB8 | π« |
BB9 | π« |
BB10 |
ID | Blockscout |
---|---|
X_EA_1 | β |
X_EA_2 | β |
X_EA_3 | β |
ID | Blockscout |
---|---|
X_SC_1 | β |
X_SC_2 | β |
ID | Blockscout |
---|---|
X_SCSC_1 | β |
X_SCSC_2 | |
X_SCSC_3 | |
X_SCSC_4 | |
X_SCSC_5 | β |
ID | Blockscout |
---|---|
X_SCI_1 | β |
X_SCI_2 | β |
ID | Blockscout |
---|---|
X_L1L2_1 | π« |
X_L1L2_2 | π« (dedicated page to view L1->L2 tx) |
ID | Blockscout |
---|---|
X_L2L1_1 | π« |
X_L2L1_2 | π« (dedicated page to view L2->L1 tx) |
BlockScout: Blockscout is a popular open source block explorer. It is used by multiple L2s including Arbitrum Nova, Boba, Scroll, Gton Capital. See full list here.
Blockscout uses an indexer to store chain data into its own database. It starts indexing from the head of the chain (the current block) and goes backwards towards the genesis block. The genesis block is the final block indexed during this process. The webapp backend queries the database to fetch necessary data to display.
Blockscout exposes multiple types of APIs. REST API, GraphQL, RPC API, Eth RPC API. The REST API is the most comparable to what is being proposed through this standard. Their REST API does not provide any batch information nor does it provide any L2 rollup details.
In the explorer there are no pending blocks. Block lookup can be done through block number or block hash. Unable to find an example of a block that is no longer part of the chain's current state. Block list displays block number and validator hash. Block details shows the block number, block hash, validator hash and included transactions. It has a dedicated page to display L2 output root state changes. In its vanilla goerli version batches are referred to as L2 blocks. L1->L2 and L2->L1 transactions each have a separate dedicated page for display. There does not appear to be a mechanism for challenging existing verified contract source code.
Based on our investigation of the network features in Section 2.2.2 and the features offered by block explorers described in Section 2.4, we now refine the initial block explorer requirements. The refined requirements are presented in Section 1.2.
Batches. In general, L2s and especially rollups are expected to record state updates onto L1 by batching L2 blocks. However, this concept is not present in all the networks. Batches do not exist for example on StarkNet or DyDx. These networks form bundles of transactions. Batches do not exist in Aztec Connect either. Additionally, even the networks that use batches, such as Polygon Hermez and Optimism, appear to use them only out of the implementation convenience. Both Polygon Hermez and Optimism configure their networks to seal a block after every individual transaction. Thus, their batches of blocks do not conceptually differ much from what batches of transactions would be, however, sealing blocks after individual transactions allows these networks to conveniently execute each transaction and manage the L2 state via geth
. This shows that the concept of a batch is rather redundant in the general L2 terminology, and the networks with custom implementations of the state management are unlikely to use such a concept altogether. Therefore, in the refined requirements of a generally applicable block explorer, we position the visualization of data that relates to batches as an optional extension.
Rollup Extensions. While surveying select optimistic and zero-knowledge rollups, we identified rollup-specific features which existed jointly across them. Rollup-specific features such as batches were consistent within rollup types (optimistic vs. zero-knowledge), but inconsistent otherwise as is the case with validity proofs and challenges (especially for application-specific chains). For optimistic rollups, such as Aribitrum and Optimism, both of these chains use fraud-proofs to test the validity of transactions prior to being posted on the L1. These chains create a challenge window during which blocks can be challenged prior to being finalized. The difference between these two being how many rounds of fraud proofs are required prior to finalization and the cost and speed which follows as consequence.
Therefore, we positioned the rollup data into independent extensions, and created them to define the additional requirements of optimistic and zero-knowledge rollups. For a zero-knowledge rollup, the block explorer has additional requirements in the form of batches, L1 state update transactions, and L1 validity proof transactions, as is the case with Starknet. As for an optimistic rollup, the block explorer will have additional requirements regarding challenged L2 blocks, such as L1 challenge transactions and the status of the challenge as is the case for Optimism. For an application-specific rollup, the data may be absolutely custom, and still be accommodated in this standard via an appropriate extension.
Internal EVM transactions. While exploring various blockchain explorers, we noticed that some of them show internal transactions (also known as message calls) that occur during the execution of an L2 transaction. This information can be useful for end-users to understand the interaction between smart contracts and other addresses involved in the transaction, as well as the value transferred in each of those calls. However, it is important to note the following points:
- Some explorers only show internal transactions with a value transfer greater than zero.
- In chains that support L1βL2 and L2βL1 transactions, such as Optimism and Arbitrum, internal transactions can be present in both L1 and L2 transactions. However, the L2 block explorers only display the internal transactions that occur in L2. L1 internal transactions are shown in a separate block explorer, such as Etherscan.
L1 Explorer. Our investigation aimed to derive requirements for L2 block explorers. Some of the requirements we identified are only relevant to L2s, such as ZK or optimistic rollups. However, many requirements are generic and also applicable to L1 block explorers, such as Etherscan (please refer to the table below). With this in mind, this standard can serve as a starting point for work on an L1 block explorer.
Type of Requirements | Requirements | Etherscan Support |
---|---|---|
Base | Transactions (1.2.1.1) | β Β (For L1 transactions) |
Base | Blocks (1.2.1.2) | β Β (For L1 Blocks) |
Extension | Block Batch (1.2.2.1) | π« |
Extension | Ethereum Account (1.2.2.2) | β Β (Displays L1 transactions) |
Extension | EVM Smart Contract (1.2.2.3) | β Β |
Extension | EVM Smart Contract Source Code (1.2.2.4) | β Β |
Extension | EVM Smart Contract Interaction (1.2.2.5) | β Β |
Extension | L1βL2 Transactions (1.2.2.6) | π« |
Extension | L2βL1 Transactions (1.2.2.7) | π« |
Extension | Optimistic Rollup (1.2.2.8) | π« |
Extension | Zero Knowledge Rollup (1.2.2.9) | π« |
Extension | Internal EVM Transaction (1.2.2.10) | β Β |
Extension | Event Logs (1.2.2.11) | β Β |
Several of the chains, notably Starknet/StarkEx and dYdX, use a batching protocol known as bundles. These bundles are multi-typed transactions which are executed completely or not at all. The purpose of these is to execute orders containing multiple asset types, e.g. selling a set of NFTs as one package. Bundles receive a singular id. On EVM blockchains, there is absolute sequencing, therefore a bundled transactionβwhich executes all at once and only has a singular transaction idβwould require an extension to "unravel" the bundle and submit them sequentially. This creates a problem because the native behavior will only execute the bundle if all of the transactions can be fit onto a batch.
Starknet state is comprised of contract classes and contract instances. The state is updated given one of the three transaction types: invoke
, deploy_account
, and declare
. The implementation of one of these transactions types will transition the state of Starknet via a state commitment. The Starknet state is too novel to be shoehorned into EVM and consequently it is necessary to create an extension.
Stark Keys are a public key defined over a Stark-friendly elliptic curve that is different from the standard Ethereum elliptic curve. On dYdX, they have created a smart contract to link the Ethereum account addresses to their Stark Key, so it is possible. However, this additional functionality would require an extension.
Starknet has different contract model. A Contract Class is a mapping between class hash and the class definition. Starknet distinguishes between a contract and its implementation by separating contracts into classes and instances. A contract class is the definition of the contract: Cairo byte code, hint information, entry point names, and everything that defines its semantics unambiguously.
A contract instance is a deployed contract corresponding to a class. That is, it is a mapping between addresses (251-bit field elements) and the contractβs state. Contract instances behave similar to contracts do within EVM in that they have their own storage and can be called by transactions or other contracts. However, the distinction between classes and instances is not native to EVM and comes with nuances that would not be easily shoehorned in, so it requires an extension.
Starknet execution resource. Cairo Steps are the amount of steps executed during the proof trace. It is one of several limiting factors (the others being Pedersen hashes, signature verifications and range checks) which are used to calculate gas costs. While gas costs are currently denoted in ETH (in turn making this black box output), the actual concept is alien to other L1/L2s and requires an extension to properly integrate.
Based on the refined requirements established in Section 2.5, we are now able to define the API capable of serving a block explorer that meets these requirements. The API specificiation is presented in Section 1.3.
This file is considered an evolving document. As such, we encourage feedback and contributions from the different members of the community. If you wish to contribute, please follow the guidelines described in the CONTRIBUTING.md file.
- The Standard Review and Corrections: The standard described in this repository contains a substantial amount of information. While the authors made sincere effort to conduct a systematic investigation work, they admit that the documents may contain inaccuracies, errors, and discrepancies introduced during editing. In academic research, such discrepancies and errors are usually caught during the peer review process prior publishing. In this case, we are publishing a standard for the benefit of the greater Ethereum community, without any formal peer review process being available to us. Therefore, we kindly ask the community for the review of this work. The contributors are invited to publish improvements and corrections in the form of PRs. Those will be carefully assessed by the maintainers of this repository.
- Versioning and Available Extensions: The presented standard is designed to be modular and evolving. However, the API endpoints currently do not include any information where the user could learn about the version of the standard that the API implements. It also does not include an endpoint for learning which extensions are implemented and can be queried. The authors suggest that such a feature would be a useful part of the standard, and invite the community to add it.
- EVM Usability Extension: The API standard currently includes only the minimal information about transactions, blocks, proofs, and other entities that pertain to the chain concepts. These are sufficient for producing a useful block explorer, but we do not necessarily claim that such a block explorer interface would maximize the user experience. For example, Etherscan displays the sender and recipient of each transaction in the list of the most recent transactions. The requirement TX4 in Section 1.4.1.1 only stipulates that the list should contain identifiers (such as transaction hashes), and defers more details to the transaction detail required in TX10. The authors feel that one can identify many aspects that would increase the usability of a reference block explorer application, which could form its own extension. Formulating the requirements for such an extension, and the specification of the required API, would be a great community contribution.
- Reference API Implementations: This work publishes standard for an API that can be consumed by a block explorer. However, it provides no implementation, as such implementation goes beyond the scope of this work. We invite all developers in the greater Ethereum community to try developing an indexing service that would expose such an API for any of the numerous layer 2 chains.
- Reference Front End Implementation: Similarly to the previous point, this work formulates requirements for a block explorer application. However, it does not provide an implementation of a block explorer, as such implementation goes beyond the scope of the standard. The authors invite all developers in the greater Ethereum community to develop a block explorer based on consuming the standardized API described here.
- New Extensions and Specializations: This standard is intentionally designed to be modular and extensible so that it can acommodate layer 2 chains, concepts, and technologies that were not part of our selection for investigation. The authors invite the community to propose new extensions that could benefit this standard. The contributors can propose improvements and corrections in the form of PRs. Those will be carefully assessed by the maintainers of this repository.