Skip to content

LimeChain/hedera-zk-poc

Repository files navigation

Hedera State Consensus ZK PoC

Dependencies

First, [install Rust] and [Foundry], and then restart your terminal.

# Install Rust
curl https://sh.rustup.rs -sSf | sh
# Install Foundry
curl -L https://foundry.paradigm.xyz | bash

Next, you will need to install the cargo risczero tool. We'll use [cargo binstall][cargo-binstall] to get cargo-risczero installed, and then install the risc0 toolchain. See [RISC Zero installation] for more details.

cargo install cargo-binstall
cargo binstall cargo-risczero
cargo risczero install

Now you have all the tools you need to develop and deploy an application with [RISC Zero].

Quick Start

First, install the RISC Zero toolchain using the instructions above.

Update submodules with:

git submodule update --init --recursive

Build the Code

  • Builds for zkVM program, the publisher app, and any other Rust code.

    cargo build
  • Build your Solidity smart contracts

    NOTE: cargo build needs to run first to generate the ImageID.sol contract.

    forge build

Run the Tests

  • Tests your zkVM program.

    cargo test
  • Test your Solidity contracts, integrated with your zkVM program.

    RISC0_DEV_MODE=true forge test -vvv 

Configuring Bonsai

Note: To request an API key complete the form here.

With the Bonsai proving service, you can produce a [Groth16 SNARK proof] that is verifiable on-chain. You can get started by setting the following environment variables with your API key and associated URL.

export BONSAI_API_KEY="YOUR_API_KEY" # see form linked above
export BONSAI_API_URL="BONSAI_URL" # provided with your api key

Alternatively, there is a .env.example with the same variables. Rename the file to .env, fill in the values and apply the changes using

source .env

If you run forge test, the test will be fully verifying RiscZeroGroth16Verifier and will request a SNARK receipt from Bonsai.

forge test -vvv

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published