risc0 / risc0

RISC Zero is a zero-knowledge verifiable general computing platform based on zk-STARKs and the RISC-V microarchitecture.

Home Page:https://risczero.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Feature] cargo-risczero: add a `verify` command to verifiy receipts locally or from bonsai

SchmErik opened this issue · comments

Feature

Add a command in cargo-risczero that would verify a receipt stored locally or from bonsai. The command will fetch the receipt from bonsai or disk and run receipt.verify on it.

Motivation

The primary motivation is improved devex. This feature allows one to easily verify existing receipts with out 1) going through the prover or writing code in order to verify receipts.

Implementation

Create a new command verify in cargo-risczero. There should be two modes of operation: 1) download a receipt from bonsai and 2) fetch a receipt from local storage. In the bonsai case, we need to use the bonsai-sdk to download a receipt. Parameters to this should be the bonsai url/api key, and an ID that refers to a receipt. In the local case, we need the filepath of the receipt. After downloading the receipt, it should be de-serialized to a receipt type and we should be able to call receipt.verify() and return the result.

This may raise the need to version stamp the receipt so that we know whether the current version of cargo-risczero can deserialize it