Skip to content

A STARK provable modular framework executing user-defined logic on multi-chain data in Cairo general purpose ZKVM.

License

Notifications You must be signed in to change notification settings

HerodotusDev/hdp-cairo

Repository files navigation

HDP Cairo

HDP (Herodotus Data Processor) is a modular framework for validating on-chain data from multiple blockchain RPC sources, executing user-defined logic written in Cairo1, and producing an execution trace that can be used to generate a zero-knowledge proof. The proof attests to the correctness of both the on-chain data and the performed computation.

program_hash

Installation

Option 1: Install CLI Directly

You can install the CLI using install script:

curl -fsSL https://raw.githubusercontent.com/HerodotusDev/hdp-cairo/main/install-cli.sh | bash

Option 2: Build from Source

To install the required dependencies and set up the Python virtual environment, run:

make

Running

Runtime require chain nodes RPC calls, ensure an environment variables .env are set.

Steps to Execute:

  1. Simulate Cairo1 Module and Collect Proofs Information:

    cargo run --release --bin hdp-cli -- dry-run -m module_contract_class.json --print_output

    module_contract_class.json is built contract code from Scarb build, more specific example in DOCS

  2. Fetch On-Chain Proofs Needed for the HDP Run:

    cargo run --release --bin hdp-cli --features progress_bars -- fetch-proofs
  3. Run Cairo1 Module with Verified On-Chain Data:

    cargo run --release --bin hdp-cli -- sound-run -m module_contract_class.json --print_output

    module_contract_class.json is built contract code from Scarb build, more specific example in DOCS

The program will output the results root and tasks root. These roots can be used to extract the results from the on-chain contract.

Testing

Tests require chain nodes RPC calls. Ensure an environment variables .env are set.

  1. Build Cairo1 Modules:

    scarb build
  2. Run Tests with nextest:

    cargo nextest run