Giter Club home page Giter Club logo

verified-logs's Introduction

Verified Logs with SP1

Overview

This repository contains a program that can be run in a zkVM to prove the contents of a log at a given log index in a block. In particular, the program takes in a block_hash and a log_index as public inputs, and returns the log at the provided index as a public output (an illustrative function signature is below).

fn log_at_index(block_hash: B256, log_index: u64) -> Log

The program is written in Rust and in the program directory at program/src/main.rs. It is compiled to RISC-V bytecode (contained in program/elf/riscv32im-succinct-zkvm-elf) and can be run in the SP1 zkVM. To run the program in a zkVM and generate a proof, use the script directory. The script directory contains logic to get necesary private inputs to the program (such as the full block header and block receipts) and uses SP1 to generate and verify the proof.

Generate Proof

To generate a proof, run the following command in the script directory:

cd script;
RUST_LOG=info cargo run --release

Proof generation should take 2-3 minutes on a Mac M1.

You can change the block_hash and log_index in the script/src/main.rs file to generate a proof for a different block and log index.

verified-logs's People

Contributors

puma314 avatar

Watchers

 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.