Skip to content

zk proof for state transition function in lean consensus #854

@DimitriosMitsios

Description

@DimitriosMitsios

Describe the feature

Introduction

Current issue introduces the reasoning and structure of a prototype meant to generate a zk proof of the state transition function in collaboration with @unnawut and @x-senpai-x. The implementation of this feature should not interfere with the rest of the codebase and will be initialized with a cli flag. Draft PR #835 hosts the development branch of the present issue and issue #13 provides useful guidelines. The choice of risc0 as a zkVM is temporary and is due to our previous experience with it and useful documentation. We plan to abstract the interface so that the user chooses among various zkVM options. This interface abstraction has been implemented for beacon chain https://github.com/x-senpai-x/Ream-ZKVM-Benchmarks with integration for: SP1, RiscZero, Zisk, Pico, Jolt, (OpenVM is coming soon).

Proof generation

  1. Cli flag risc0 enabled as --features risc0.
  2. ValidatorService sends a message to lean chain service
    LeanChainServiceMessage::ProduceBlockProof{ slot, sender, need_gossip }
  3. For gossiping, we introduce a new p2p request variant
    LeanP2PRequest::GossipBlockProof(slot)

Proof verification

  1. The proof is verified using LeanChainServiceMessage::ProcessBlockProof { proof_block, is_trusted: false, need_gossip: true }

  2. Voting based on block proofs could also be implemented but only after we complete all the above

Metrics

  • elapsed (wall-clock) time for proving and verification

Logs

At the beginning, we will include logs for:

  • success/failure
  • latest block proven, to track the progress of the client
  • (time metrics as well?)

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions