Arbitrum Nitro Integration

Overview

What’s Arbitrum?

Arbitrum benefits Ethereum L2 by providing a suite of solutions to rollup data and extend the scalability. Due to the rollup nature, it also offers cheap gas without compromising the trustlessness. Furthermore, it supports the same set of EVM-executable smart contracts and transactions in the Ethereum format, enabling interoperability and a rich set of applications.

Who’s Nitro?

Nitro is a timely and significant update to the classical Arbitrum protocols. Compared with classical ones, to reduce gas fees, it further compresses transactions by calldata compression and separating fault proving from execution. Also, it improves interoperability via gas compatibility and tighter synchronizations with L1. Finally, a strong security guarantee is provided by the newest techniques like safe retryables and Geth tracing.

In a nutshell, after determining the transaction order and assembling a block, the sequencer(s) batch and compress transaction data and send them to L1 for secure settlement. At the same time, the transactions are executed in another thread and the execution results are settled to L1. In this way, users are allowed to securely and efficiently obtain the transaction data with execution results and the security and data availability are guaranteed by L1 and rollup proofs.

With Nubit DA

After the integration with Nubit DA, instead of batching and compressing transactions and sending them to the L1 chain, sequencers are allowed to send the transaction data to the Nubit DA. In this way, the expensive gas fee is saved and the storage burden is significantly reduced.

After receiving the transaction data, proof of data inclusion is returned to the sequencer and delivered to the L1 chain via a trustless DA streaming service. Users or light clients could obtain the desired transaction data from the Nubit DA backend. Obtaining the concerned DA proofs from L1 would allow the user to verify the data.


Run the Integration Demo

Docker

sudo groupadd docker
sudo usermod -aG docker $USER
newgrp docker

Clone

git clone https://github.com/RiemaLabs/nitro.git
cd nitro
git submodule update --init --recursive --force
git clone https://github.com/ethereum/go-ethereum.git go-ethereum
git clone https://github.com/VictoriaMetrics/fastcache.git fastcache
git clone https://github.com/OffchainLabs/nitro-contracts
git clone https://github.com/google/brotli.git brotli
cd contracts
yarn install
cd ..
touch .nitro-tag.txt

Build

docker build . --tag nitro-node

Install essentials:

brew install git curl make cmake npm go gvm golangci-lint wabt llvm gotestsum
npm install --global yarn
sudo mkdir -p /usr/local/bin
sudo ln -s  /opt/homebrew/opt/llvm/bin/wasm-ld /usr/local/bin/wasm-ld

Configure node

curl -o- <https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh> | bash
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \\. "$NVM_DIR/nvm.sh"
nvm install 16.19
nvm use 16.19

Configure Rust

curl --proto '=https' --tlsv1.2 -sSf <https://sh.rustup.rs> | sh
source "$HOME/.cargo/env"
rustup install 1.73
rustup default 1.73
rustup target add wasm32-unknown-unknown --toolchain 1.73
rustup target add wasm32-wasi --toolchain 1.73
cargo install cbindgen

Configure Go

brew install bison

bash < <(curl -s -S -L <https://raw.githubusercontent.com/moovweb/gvm/master/binscripts/gvm-installer>)
source "$HOME/.gvm/scripts/gvm"
gvm install go1.20
gvm use go1.20 --default
curl -sSfL <https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh> | sh -s -- -b $(go env GOPATH)/bin v1.54.2

Install foundry

curl -L <https://foundry.paradigm.xyz> | bash
foundryup

Make

make
make build

Exemplary Execution

./target/bin/nitro
./target/bin/nitro --parent-chain.connection.url=https://ethereum.publicnode.com --chain.id=42161 --http.api=net,web3,eth,debug --execution.caching.archive --parent-chain.blob-client.beacon-url https://rpc.ankr.com/premium-http/eth_beacon/c70b270c595b144165fe667e4475664c7c09888f0ba4e1ca0ffdc4399cb956c8 --init.url="https://snapshot.arbitrum.foundation/arb1/nitro-genesis.tar" --http.addr=0.0.0.0

Check logs

Observably, the data is submitted to Nubit DA for every block generation.

Last updated