This repository provides an end-to-end code solution for resolving data from rollup chains and verifying it against state posted to Layer 1 Ethereum.
Install our npm package:
$ npm i @unruggable/gateways
✓
We have extensive documentation, with a slightly less quick Quickstart.
The examples page may be of particular interest.
We also have an examples repo that utilises our npm package to demonstrate both simple and complex use cases in a few clicks.
The core components of a chain solution are:
- Gateway: A HTTP server that handles responding to a virtual machine request by interfacing with the appropriate rollup to return proofs of the requested data stored on that chain.
- Verifier: A Solidity smart contract (deployed on Layer 1) that verifies the proofs returned by the gateway and returns the proven data values.
- Prover: A Solidity library (deployed on Layer 1) that handles the chain-specific proving process.
In addition to these core components, we have provided TypeScript implementations of the request builder (vm.ts) and the provers (listed below) to allow smart contract implementors to quickly iterate and test when building solutions.
There are currently implementations for the following chains:
Arbitrum
Base
Blast
Fraxtal
Linea
Optimism
Polygon PoS
Scroll
Taiko
ZKSync
Zora
If you are interested in building out a solution for another chain, please take a look at our our Contribution Guidelines and/or get in touch.
- Provers
- EthProver →
eth_getProof
- LineaProver →
linea_getProof
- ZKSyncProver →
zks_getProof
- EthProver →
- Rollups:
- OP — Base, Blast, Fraxtal, Zora
- OP w/Fault Proofs — OP Mainnet
- Nitro — Arbitrum One
- Linea
- Polygon PoS
- Polygon ZK — WIP
- Scroll
- Taiko
- ZKSync
bun run serve <chain> [port]
- Chain names:
arb1
base
blast
fraxtal
linea
op
polygon
scroll
taiko
zksync
zora
- Default port:
8000
- Chain names:
There is an extensive test suite available for testing individual components of the solution in an isolated manner.
Using blocksmith.js and Foundry we fork the chain in question (such that can interact with contracts deployed on a real network) and then deploy and test against an isolated unit (for example the chain specific verifier).
Commands available include:
bun run test
bun run test-components
bun run test-gateways
- Contract → Reader → Tests
⚠️ Scroll failsreadZero()
test⚠️ Polygon has pooreth_getProof
support
A number of examples are provided as part of this repository. For more extensive step-wise example code, please see our documentation.
- linea-ens
- Replacement backend demo for https://names.linea.build/
bun serve lineaV1
# installed by forge in step (2)
# provided for reference
forge install foundry-rs/forge-std
forge install OpenZeppelin/openzeppelin-contracts@v5.0.2
# installed by script instead of the following command
# placed at standard remapping location
# see: https://github.com/ethereum-optimism/optimism/issues/10202
#forge install ethereum-optimism/optimism
bun build/import-op.ts
We welcome contributions to this codebase.
The premise behind the development of this software is to minimise duplication of effort and provide tooling that allows developers to interface with a simple, standardised API to read data from other chains.
Please take a look at our CONTRIBUTING.md file for a more in depth overview of our contribution process.
- main is our stable release branch that reflects the latest release.
- develop is our ongoing development branch. Feature branches are to merged down into this.
- Feature Branches: Separate branches will be utilised for new feature development or bug fixes.
All files within this repository are licensed under the MIT License unless stated otherwise.