anagrambuild / bonsol

solana + risc0
https://bonsol.sh
GNU Affero General Public License v3.0
57 stars 7 forks source link

乃ㄖ几丂ㄖㄥ

Bonsol is the Offchain compute framework to make everything possible on solana.

commitlint Docker Build from Image CI

Interact with the docs at Bonsol.sh

Roadmap

Stage 1: Dawn (current stage)

Local Development

Prerequisites:

Rust

You will need to install rust

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
rustup install 1.80.0

Risc0 Toolchain

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

ZK Snark deps

Run the setup script to install the zksnark deps and compile the zksnark prover

./setup.sh

Running a Local Environment

  1. Download and setup the system with the needed binaries and keys to run the groth16 prover over the risc0 FRI
    ./setup.sh
  2. Compile the 乃ㄖ几丂ㄖㄥ on chain program and start a localnet with the program loaded
    ./validator.sh
  3. On a separate terminal, compile the 乃ㄖ几丂ㄖㄥ off-chain node and start it
    ./run-node.sh
  4. Build the image binary if it hasn't already been built, this will result in the binary's path being available in the manifest.json (in this case images/simple/manifest.json)
    cargo run -p bonsol-cli build -z images/simple
  5. Use the bonsol cli to deploy a zkprogram (here is a example already uploaded for you)
    cargo run -p bonsol-cli deploy -m images/simple/manifest.json -t url --url https://bonsol-public-images.s3.amazonaws.com/simple-68f4b0c5f9ce034aa60ceb264a18d6c410a3af68fafd931bcfd9ebe7c1e42960
  6. Use the bonsol cli to execute a zkprogram
    cargo run -p bonsol-cli execute -f testing-examples/example-execution-request.json -x 2000 -m 2000 -w

Contributing

Please see our Contributing Guide for details on how to get started building 乃ㄖ几丂ㄖㄥ.