risc0

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

APACHE-2.0 License

Downloads
2.2M
Stars
1.4K
Committers
91

Bot releases are hidden (Show)

risc0 - v0.19.0-alpha.1

Published by flaub about 1 year ago

What's Changed

New Contributors

Full Changelog: https://github.com/risc0/risc0/compare/v0.18.0...v0.19.0-alpha.1

risc0 - v0.18.0

Published by flaub about 1 year ago

Our 0.18 release upgrades the Bonsai SDK with Groth16 SNARK seals for better on-chain verification, better error handling, and more. In the zkVM, this release separates host and guest build toolchains and also supports reproducibly building the same ImageID for the same zkVM code by using a consistent Docker environment.

Thank you to community members @austinabell and @winor30 for their contributions to this release!

Important and Breaking Changes

  • Separate host and guest build toolchains, allowing the use of different versions of rustc for host and guest code. This has allowed us to move the default host toolchain to the stable channel. The guest toolchain remains on a nightly release of 1.69.
  • Add cargo risczero build command to build zkVM guest programs using a Docker container, which enables ImageIDs to remain consistent across builds. See #799 for details.
  • Bonsai Ethereum contracts now use Forge as a subprocess, so building Bonsai code will now require installing Foundry tools.
  • Bonsai SDK: upload_img and upload_img_file no longer return ImageIdExists errors. Instead they return a boolean, true if the image exists on the server.
  • Bonsai SDK: Bonsai now returns Groth16 SNARK seals as well as the journal and post_state_digest for easy on-chain verification.
  • Expand Prover support to better work with remote provers like Bonsai.
  • Fix bug #820, correcting iterative calls to SHA2
  • Add 128 bits of entropy to the memory state, addressing a potential privacy issue where the SystemState root in the ReceiptMetadata was not guaranteed to be a hiding commitment.

What's Changed

New Contributors

Full Changelog: https://github.com/risc0/risc0/compare/v0.17.0...v0.18.0

risc0 - v0.17.0

Published by flaub about 1 year ago

With our 0.17 release, we have expanded our Bonsai content and updated the installation process. The latter change means existing users will have to install again when upgrading, by running cargo install cargo-risczero and cargo risczero install. See the Getting Started section of our README for prerequisites and more details. We've also added a developer mode for more rapid development and continued to streamline the proof and receipt APIs, among other changes.

Thank you to community members @criadoperez, @austinabell, and @roseiliend for their contributions to this release!

Important and Breaking Changes

  • Added a cargo risczero install tool for setting up the RISC Zero toolchain. Fixes in this release require a "risc0" rustup toolchain; the cargo risczero install command will install this toolchain and do other RISC Zero setup. All users, new and old, will need to run this command to install the RISC Zero zkVM. Full details are available in the Getting Started section of our README.
  • Added a Developer Mode enabling more rapid development by skipping proving and validation steps. No proof is generated or verified while in developer mode, and in particular running verification in developer mode provides no security whatsoever. The RISC0_DEV_MODE environment variable controls whether developer mode is enabled, and this feature can be fully disabled at build time, regardless of environment, by using the disable-dev-mode feature flag on the risc0-zkvm crate.
  • Streamlined the Receipt, Executor, and Prover APIs. A basic high-level usage now looks like let receipt = default_prover().prove_elf(env, SOME_ELF).unwrap();. Receipt implementation details are encapsulated in an InnerReceipt object which most users will not need to interact with. The Prover now has additional high level methods, included prove and prove_elf. See the Executor, Receipt, and Prover sections of our docs for the current API, and this PR for details about the changes.
  • Moved binary format functionality into a separate risc0-binfmt crate. See its docs for details.
  • Prevented guest from writing to memory that will crash the prover if tampered with. See this PR for details.
  • Fixed large I/O and prevent splitting to a new segment when no instructions have been run. See this PR for details.
  • Updated circuit as well in the previous PR as well as this PR.
  • Pinned the cc crate to a specific version as a workaround to build problems when using its latest version.
  • Adjusted the Bonsai Ethereum Relay in several ways, including websockets, Solidity CI, SNARK seal support, and verify interface

What's Changed

New Contributors

risc0 - v0.16.1

Published by flaub over 1 year ago

What's Changed

Full Changelog: https://github.com/risc0/risc0/compare/v0.16.0...v0.16.1

risc0 - v0.16.0

Published by flaub over 1 year ago

The 0.16 release contains slight modifications to the zkVM API with the goal of allowing the zkVM to generate proofs either locally or remotely using Bonsai. Most changes are internal and only a few breaking changes are present, though they will require updates for most programs.

Breaking changes

We've made significant changes to the Executor. The executor was previously created and run using the following code:

let exec = Executor::from_elf(env, METHOD_ID);
let session = exec.run().unwrap();

As of 0.16, you will need to replace

use risc0_zkvm::Executor;

with

use risc0_zkvm::default_executor_from_elf;

and

let exec = Executor::from_elf(env, METHOD_ID);

with

let exec = default_executor_from_elf(env, METHOD_ID);

Note that the default executor used depends on whether you have (correctly) set environment variables BONSAI_API_URL and BONSAI_API_KEY. If these are present and valid, you'll be working remotely using Bonsai; otherwise, you'll be running locally.

Usage Highlights

https://github.com/risc0/risc0/pull/559 When using std on the guest, note that you no longer need to include #![no_main] or risc0_zkvm::entry!(...); just a standard pub fn main will do. (Note: the risc0 zkvm crate must still be included with use risc0_zkvm as _ if nothing else from it is used.)

Change Log

Examples

Bonsai SDK

Build / CI

Dependencies

zkVM

New Contributors

Full Changelog: https://github.com/risc0/risc0/compare/v0.15.0...v0.16.0

risc0 - v0.15.3

Published by flaub over 1 year ago

What's Changed

Full Changelog: https://github.com/risc0/risc0/compare/v0.15.2...v0.15.3

risc0 - v0.15.2

Published by flaub over 1 year ago

This release primarily fixes a bug (#597) where the prover would sometimes generate invalid receipts (which would therefore not verify). See the changelog below for the full list of what has changed since v0.15.1.

For more details on how this release differs from v0.14, see the v0.15.0 release notes.

What's Changed

  • Fix for #594 (where an invalid receipt would sometimes be generated, and thus fail verification) by @flaub (#597)
  • Enable feature-gated programmatic access to methods.rs contents by @hashcashier (#585)

Full Changelog: https://github.com/risc0/risc0/compare/v0.15.1...v0.15.2

risc0 - v0.15.1

Published by flaub over 1 year ago

This is a bugfix and documentation release for v0.15. In particular, this fixes a problem installing cargo risczero as described in https://github.com/risc0/risc0/issues/579.

For more details on how this release differs from v0.14, see the v0.15.0 release notes.

What's Changed

Full Changelog: https://github.com/risc0/risc0/compare/v0.15.0...v0.15.1

risc0 - v0.15.0

Published by flaub over 1 year ago

This release includes continuations, a mechanism for splitting a large program into several smaller segments that can be computed and proven independently. We’re excited about the benefits continuations provide in terms of features (such as adding the ability to pause & resume a guest), in terms of performance (such as capping the memory requirements for long-running guests), and in terms of functionality (such as the elimination of the cycle count limit on guest programs — you can now run a guest for as long as you are willing to wait).

Along with continuations 0.15 is bringing substantial changes to the zkVM API. We have done our best to highlight key breaking changes in the “Breaking Changes” section below, and we’ve put together a Migration Guide to help developers upgrade from 0.14 to 0.15. If you run into problems while upgrading, we invite you to reach out to us on Discord or open an issue!

Breaking Changes

Because this release includes many breaking API changes, we have also published a migration guide for updating 0.14 code to 0.15.

  • 0.15 depends on a different version of Rust than previous versions.
    • Please update rust-toolchain to channel = "nightly-2023-03-06" from channel = "nightly-2022-10-28"
  • Generation of proofs has been split into two phases: execution & proving.
    • This has many ramifications in the API, and we will discuss major ones below. For full details of the current API, please see the zkVM documentation.
  • risc0_zkvm::Prover has been replaced with risc0_zkvm::Executor
  • risc0_zkvm::ProverOpts has been replaced with risc0_zkvm::ExecutorEnv
  • The API for host-guest communication has been changed on the host side
    • Replace Prover::add_input_u8_slice and Prover::add_input_u32_slice with ExecutorEnvBuilder::add_input
    • If you previously relied on ProverOpts::with_send_recv_callback, consider ExecutorEnvBuilder::io_callback. For some cases, you may instead want to consider ExecutorEnvBuilder::stdin and ExecutorEnvBuilder::stdout. There are other options as well, see the ExecutorEnvBuilder documentation.
    • See the 0.15 Migration Guide for detailed instructions and other cases
  • risc0_zkvm::Receipt is replaced with risc0_zkvm::SessionReceipt which contains a Vec<risc0_zkvm::SegmentReceipt>
  • risc0_zkvm::serde replaces the functionality of risc0-zeroio and so the latter has been removed.

What's Changed

Full Changelog: https://github.com/risc0/risc0/compare/v0.14.0...v0.15.0

risc0 - v0.14.0

Published by flaub over 1 year ago

As with all our pre-1.0 versions, our codebase and APIs remain under heavy development. Take a look at the "Breaking Changes" section below for the changes we think are likely to affect your projects. That said, we've probably missed some things. If you run into problems, we invite you to open an issue or reach out to us on Discord.

We've created a cargo risczero tool for creating, managing, and testing RISC Zero projects. Check out cargo risczero new the next time you start a new project!

Thanks to community members @kubaplas, @KaiGeffen, and @justinFrevert for their contributions to this release!

Breaking Changes

  • risc0_zkvm::Prover no longer takes an image_id parameter. The Image ID is instead calculated from the supplied ELF binary.
  • We have moved the examples and starter template into our main repository. You can now find the examples in the examples directory. You can generate a starter project from our template using our cargo risczero tool. The standalone risc0-rust-examples and risc0-rust-starter repositories are deprecated.
  • The backend for host-guest communication has been updated. There have been some corresponding changes to the API for host-guest communication, including some breaking changes, although the most commonly used functions like env::read will generally still work without adjustment. Check out the new env::stderr, env::stdin, and env::stdout! See the guest::env documentation and the prove::io documentation for more details.
  • Replaced risc0_zkvm::MemoryImage::root with risc0_zkvm::MemoryImage::get_root().
  • Dropped VerificationError::SealJournalLengthMismatch and renamed VerificationError::JournalSealRootMismatch to VerificationError::JournalDigestMismatch.

Changelog

New Contributors

Full Changelog: https://github.com/risc0/risc0/compare/v0.13.0...v0.14.0

risc0 - v0.13.0

Published by flaub over 1 year ago

We have some breaking changes in v0.13. If you are migrating code from v0.12, please see the Breaking Changes section below for updates you will need to make to your code. We expect our APIs to continue to undergo substantial changes prior to the v1.0 release.

Thanks to community member @austinabell for their contributions to this release!

Breaking Changes

  • Receipt verification now takes a Digest reference, not a Digest.
    • Now use receipt.verify(&IMAGE_ID) where you would previously have used receipt.verify(IMAGE_ID). (Where receipt is a risc0_zkvm::receipt::Receipt.)
  • We have updated our SHA accelerator interface
    • Now use risc0_zkvm::sha::Impl instead of risc0_zkvm::sha::sha. For example, where you would previously have called risc0_zkvm::sha::sha().hash_bytes(&bytes) in v0.12, now you instead call risc0_zkvm::sha::Impl::hash_bytes(&bytes) in v0.13.
    • There are various other SHA changes, please see our reference documentation for the risc0_zkvm::sha and risc0_zkvm::guest::sha modules for details.

Changelog

New Contributors

Full Changelog: https://github.com/risc0/risc0/compare/v0.12.0...v0.13.0

risc0 - v0.12.0

Published by flaub over 1 year ago

We have made a number of breaking changes in v0.12. If you are migrating code from v0.11, please see the Breaking Changes section below for updates you will need to make to your code. We expect our APIs to continue to undergo substantial changes prior to the v1.0 release.

Thanks to community members @Vesnica, @stskeeps and @0xkrabbypatty for their contributions to this release!

Breaking Changes

(If you still have trouble migrating your code after applying the updates in this section, take a look at our 0.12 migration FAQ.)

  • 0.12 depends on a different version of Rust from 0.11.
    • Please update rust-toolchain to channel = "nightly-2022-10-28" (instead of 2022-06-20)
  • The risc0_build::link function is no longer necessary and has been removed.
    • Remove risc0_build::link from build files.
    • In particular, the starter template (and examples) repo had the build file methods/guest/build.rs which was only used for this link function. This file should now be deleted altogether, as should analogous files in your own repositories.
  • The risc0_zkvm_guest crate no longer exists, and its contents have been moved to the guest module of the risc0_zkvm crate.
    • Replace use risc0_zkvm_guest with use risc0_zkvm::guest
    • Change your Cargo.toml files from risc0-zkvm-guest = "0.11" to instead depend on risc0-zkvm = { version = "0.12", default_features = false } (guest code must not include default features, as those features include host-specific code).
    • If you are using our experimental rust standard library support in the guest, you must additionally specify features = [ "std" ].
  • There is no longer a host module in risc0_zkvm, and Prover and Receipt are now at the top level.
    • Use risc0_zkvm::Prover instead of risc0_zkvm::host::Prover
    • Use risc0_zkvm::Receipt instead of risc0_zkvm::host::Receipt
  • We have adjusted our SHA acceleration interface.
    • Use the risc0_zkvm::guest::sha::digest function instead of the old risc0_zkvm_guest::sha_digest_u8_slice function.
    • See the documentation for the risc0_zkvm::guest::sha and risc0_zkvm::sha modules for details on other parts of the SHA API.
  • There is no longer a risc0_zkvm::Prover::add_input function
    • Use add_input_u32_slice (or add_input_u8_slice) instead.
  • You can now directly access a risc0_zkvm::Receipt’s journal and seal fields, and the corresponding get_* functions have been removed.
    • Replace rec.get_journal_vec() with rec.journal
    • Replace rec.get_seal() with rec.seal
    • Replace rec.get_journal() with rec.get_journal_bytes() (or rec.journal if you don’t specifically need the journal formatted as a u8 slice)
  • Receipt::get_output now returns a &[u8]
    • If you still want a Vec<u32>, use Receipt::get_output_u32_vec

Changelog

(Full Changelog: v0.11.1...v0.12.0)

  • Switch to pure Rust prover & verifier (#233, #258, #260)
  • Genericize field used in ZKP to enable the possibility of using a different field in our circuit (#238, #250, #253, #255, #257, #272)
  • Make TapSet in generated Rust code (#242)
  • Adjust what functionality is included in the HAL, add VerifyHal (#241, #252, #266, #273)
  • Use Montgomery form for field elements (#247)
  • Move host-guest communication (#246)
  • Update Rust version to nightly-2022-10-28 (#248, #320)
  • Change some asserts to Result Errs (#251)
  • Generate constant with Elf file contents to avoid needing to link to built files from code. (#244)
  • Let guest methods indicate if they use std or are no_std and provide appropriate panic and alloc implementations based on this choice
  • Add initial guest profiling support (#274)
  • Standardize internal representation of SHA code, e.g. switching to big-endian (#268, #291, #303)
  • Add insecure_skip_seal feature, allowing faster turnaround for development at the cost of security. WARNING: If you turn on this feature when running the verifier, it no longer verifies that the proof is correct. (#293)
  • Add risc0_zeroio crate with alternative serialization options (#301)
  • Clean up memory map (#304)
  • Update PRNG to run in fixed time (#305, #311)
  • Add MemoryImage and replace MethodIDs with ImageIds (#326)
  • Change visibility of poly_ext (#317, #309)
  • Use $HOME/.risc0 for tmpdir for downloads (#327)
  • Improve build times by removing largely unused debugging info (#329)
  • Improve nvcc error message (#340)
  • Generate control_id in bootstrap (#339)
  • Don’t unnecessarily publish the bootstrap package
  • Fix build status badge
  • Fix tap caching for multiple verifies (#346)
  • Fix CUDA endianness (#353)
  • Format private outputs for deserialization (#355)
  • Fix typos and broken links (#237, #239)
  • Clean up style & formatting (#264, #268)
  • Improve documentation and comments (#254, #275, #280, #297, #306, #313, #314, #315, #316, #318, #319, #333, #345, #351)
  • Expand tests, add benchmarks (#243, #259, #292, #289)
  • Build system fixes (#350)
  • Upgrade circuit (#276, #298, #337, #347)
  • Update integration with the circuit (#317)
  • Various performance upgrades (#263, #265, #269, #277, #290)
  • Keep license headers up-to-date (#294, #331)
  • Update dependencies and remove unnecessary dependencies (#268, #302, #310, #335, #336, #342, #352)
risc0 - v0.11.1

Published by flaub about 2 years ago

What's Changed

This patch release updates internal crate dependencies to 0.11 (instead of 0.11.0-rc.4)

Full Changelog: https://github.com/risc0/risc0/compare/v0.11.0...v0.11.1

risc0 - v0.11.0

Published by flaub about 2 years ago

Release Notes

Thanks to community members @cemozerr, @ianklatzco, and @hcho1989 for their contributions to this release!

Breaking Changes

Crate dependencies

Crates have been simplified:

  • Consolidation into risc0-zkp
    • risc0-zkp-core
  • Consolidation into risc0-zkvm
    • risc0-zkvm-host
    • risc0-zkvm-core
    • risc0-zkvm-serde
    • risc0-zkvm-verify

Look at this password checker Cargo.toml file for an example. Previously, the listed dependencies were:

risc0-zkvm-host = "0.10"
risc0-zkvm-core = "0.10"
risc0-zkvm-serde = "0.10"

Now, the dependencies are:

risc0-zkp = "0.11"
risc0-zkvm = "0.11"

Guest SHA usage

If your project uses our in-house SHA implementation (optimized for the zkVM), you'll want to refer to risc0_zkp::core::sha rather than risc0_zkvm_core::sha. As an example, see our changes to the digital signature Rust example:

pub fn get_identity(&self) -> Result<risc0_zkp::core::sha::Digest> {...}

Projects that need to use risc0-zkp in the guest should set default-features = false. See our digital signatures Rust example:

risc0-zkp = { version = "0.11.0-rc.4", default-features = false }

CHANGELOG

Our pure Rust implementation of the prover is nearly complete:

We've simplified the crate system:

  • The ZKP portion of the pure Rust implementation risc0-zkvm-verify/zkp has also been moved into risc0-zkp by @flaub in #183
  • risc0-build and risc0-zkvm-guest have been extracted from risc0-zkvm by @flaub in #210
  • risc0_zkvm_guest is now its own workspace by @tzerrell in #212
  • The Rust prover APIs (FFI-based and in pure Rust) have been adjusted to behave more similarly by @shkoo in #221
  • For details on how these changes impact your projects, see our notes on updating your project dependencies.

We’ve made the following zkVM improvements:

  • The Rust standard library support continues to improve by @shkoo in https://github.com/risc0/risc0/pull/216
  • You can now embed methods with features by @cemozerr in #204
  • Code limits are now configurable with DEFAULT_METHOD_ID_LIMIT by @flaub in #203
  • Method ID now has Clone and PartialEq methods by @flaub in #186
  • You can now run the guest without generating a proof by @shkoo in #177
  • Support has been added for parsing ELF files by @flaub in #200
  • Compatibility with older C++ has been fixed by @flaub in https://github.com/risc0/risc0/pull/209

We’ve made the following build and benchmarking improvements:

Here are this release’s documentation updates:

risc0 - v0.10.0

Published by flaub over 2 years ago

What's Changed

We've made quite a few changes this time! This release includes improvements to the guest zkVM, progress towards a pure Rust implementation, work on the Receipt object, an API improvement, and expanded documentation.

Improvements have been made to the guest zkVM:

We've also made progress towards a pure Rust zkVM implementation:

The following improvements have been made to Receipts and verification:

Our API can now take in-memory buffers:

Lastly, we've improved our documentation:

Full Changelog: https://github.com/risc0/risc0/compare/v0.9.0...v0.10.0

risc0 - v0.9.0

Published by flaub over 2 years ago

What's Changed

Full Changelog: https://github.com/risc0/risc0/compare/v0.8.0...v0.9.0

risc0 - v0.8.0

Published by flaub over 2 years ago

What's Changed

risc0 - v0.7.2

Published by flaub over 2 years ago

What's Changed

Full Changelog: https://github.com/risc0/risc0/compare/v0.7.1...v0.7.2

risc0 -

Published by flaub over 2 years ago