Code Monkey home page Code Monkey logo

extractoor-contracts's Introduction

MIT License

Extractoor contracts

Library of contracts used for proving the Merkle Patricia Tree (MPT) inclusion of a certain storage inside a rollup. For easy generation of proofs and their encoding you can use the contracts alongside with the extractoor typescript sdk.It is part of the ongoing effort of LimeLabs and LimeChain to give back and contribute to the blockchain community in the form of open source tooling and public goods infrastructure.

Installation

To install with Foundry:

forge install LimeChain/extractoor-contracts

Contracts

MPT
├─ MerklePatriciaProofVerifier"Verifier for Ethereum MPT Proofs"
├─ CombinedProofVerifier"Combined Account and Storage Proofs Verifier"
├─ StateProofVerifier"A helper library for verification of Merkle Patricia account and state proofs"
library
├─ optimism
│  ├─ OptimismBedrockStateProver"Common functionality for the L1 and L2 Optimism Bedrock State Verifiers"
│  ├─ Types"Contains various types used throughout the Optimism verification process"
L1
├─ optimism
│  ├─ IOptimismBedrockOutputOracle"Interface for the Optimism Bedrock Output Proover"
│  ├─ L1OptimismBedrockStateProver"Contract for verification of MPT inclusion inside Optimism Bedrock from within the anchored L1"
L2
├─ ILightClient"Interface for input of L1 state root to the L2 state prover"
├─ SimpleLightClient"Simple contract that can be used as LightClient providing state roots for blocks by their number"
├─ optimism
│  ├─ L2OptimismBedrockStateProver"Role based Authority that supports up to 256 roles"

Why L1 and L2 contracts

For each rollup there are two types of contracts - L1 and L2.

The L1 contracts can be used in the Ethereum L1 where the rollups anchor. They call the contracts and get the state roots (or some derivation of them) and verify MPT inclusion against it.

The L2 contracts can be used in external networks and count on the L1 anchor state root to be read via an interface ILightClient. Depending on your use case you would need to write your own implementation of ILightClient or use our SimpleLightClient. Two MPT proofs are used inside the L2 contract - one proving the existence of the rollup root (or its derivatives) and one proving the actual storage against the proven rollup state root.

Supported rollups

  • Optimism Bedrock
    • Optimism Goerli
    • Base Goerli

Contributing

Feel free to make a pull request. All unit tests must pass!

Safety

This is experimental software and is provided on an "as is" and "as available" basis.

We do not give any warranties and will not be liable for any loss incurred through any use of this codebase.

Please always include your own thorough tests when using Extractoor to make sure it works correctly with your code.

Acknowledgements

These contracts were inspired by or directly modified from many sources, primarily:

extractoor-contracts's People

Contributors

perseverance avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.