Giter VIP home page Giter VIP logo

blobstreamx's Introduction

Blobstream X

Blobstream X

Implementation of zero-knowledge proof circuits for Blobstream, Celestia's data availability solution for Ethereum.

Overview

Blobstream X's core contract is BlobstreamX, which stores commitments to ranges of data roots from Celestia blocks. Users can query for the validity of a data root of a specific block height via verifyAttestation, which proves that the data root is a leaf in the Merkle tree for the block range the specific block height is in.

headerRange

headerRange is used to generate the data root of a block range. The data root is the root of a Merkle tree of the data roots of all the blocks in the block range.

To prove the last header of a block range, headerRange uses skip as a sub-circuit. After proving the last header, the headerRange circuit proves the chain of headers from the start header to the last header. From a valid chain of headers, the headerRange circuit can generate the commitment of the block range with the data root of each block in the block range.

nextHeader

nextHeader is used to generate the commitment to the data root of the current block.

This is rarely used, as nextHeader will only be invoked when the validator set changes by more than 2/3 in a single block.

Current Deployment

The circuits are currently available on Succinct X here.

Blobstream X is currently deployed for Celestia Mainnet on Sepolia here.

Configuration

Add the following to the environment variable configuration (hosted proving) or .env (local proving & relaying) for the Blobstream X operator:

TENDERMINT_RPC_URL=(comma-separated list of tendermint rpc urls)

Run Blobstream X Operator

Operator with Hosted Proving

Add env variables to .env, following the .env.example. You do not need to fill out the local configuration, unless you're planning on doing local proving.

Run BlobstreamX script to request updates to the specified light client continuously. For the cadence of requesting updates, update LOOP_DELAY_MINUTES.

In /, run


cargo run --bin blobstreamx --release

Local Proving & Relaying

To enable local proving & local relaying of proofs with the Blobstream X operator, download the proving binaries by following the instructions here.

Then, simply add the following to your .env:


LOCAL_PROVE_MODE=true
LOCAL_RELAY_MODE=true

# Add the path to each binary (ex. PROVE_BINARY_0x6d...=blobstream-artifacts/header_range)

PROVE_BINARY_0xFILL_IN_NEXT_HEADER_FUNCTION_ID=
PROVE_BINARY_0xFILL_IN_HEADER_RANGE_FUNCTION_ID=
WRAPPER_BINARY=

Relay an Existing Proof

Add env variables to .env, following the .env.example.

If you want to relay an existing proof in /proofs, run the following command:


cargo run --bin local_relay --release -- --request-id {REQUEST_ID}

Deploy Blobstream X Contract

Get the genesis parameters for a BlobstreamX contract from a specific Celestia block.


cargo run --bin genesis -- --block 100

Add .env variables to contracts/.env, following contracts/.env.example.

Initialize BlobstreamX contract with genesis parameters.

In contracts/, run


forge install

source .env

forge script script/Deploy.s.sol --rpc-url $RPC_URL --private-key $PRIVATE_KEY --broadcast --verify --verifier etherscan --etherscan-api-key $ETHERSCAN_API_KEY

blobstreamx's People

Contributors

ratankaliani avatar puma314 avatar jtguibas avatar rach-id 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.