Skip to content

Releases: risc0/risc0

v0.17.0

11 Aug 13:24
da5bc39
Compare
Choose a tag to compare

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

  • Bonsai Governance Showcase and Ethereum smart contract libraries. by @nategraf in #695
  • Bonsai relay by @capossele in #696
  • Improve Bonsai Relay by @capossele in #699
  • Add xtask install by @flaub in #701
  • Remove thiserror from risc0-zkp by @flaub in #704
  • Fix solc installation by @flaub in #705
  • Update Cargo.lock files by @flaub in #711
  • chore: remove allow(unused) from guest code, cleanup by @austinabell in #688
  • add a hook in Session to support the proof generation progress bar by @roseiliend in #717
  • Fix typos in governance demo by @criadoperez in #724
  • Add RSA support to sha2 compat by @flaub in #726
  • zkVM: split binfmt feature to a new "risc0-binfmt" crate for modularity by @SchmErik in #725
  • Emulator: Improve usability by restricting memory region access for guest programs by @SchmErik in #727
  • Adjust risc0-binfmt deps by @flaub in #731
  • Run examples as separate job by @flaub in #732
  • Adjust cache keys by @flaub in #733
  • Fix for large I/O by @flaub in #737
  • Replace Receipt trait with InnerReceipt enum by @flaub in #703
  • Update links for new website by @tzerrell in #728
  • Editing pass on starter template readme by @pdg744 in #693
  • typo fixes on bonsai governance readme by @pdg744 in #741
  • Add default run to ECDSA example to make cargo run just work by @nategraf in #742
  • Add test for in-browser verification by @flaub in #716
  • Provide a higher-level API for most use-cases by @flaub in #748
  • Fixes for clippy and add lint to CI by @flaub in #751
  • workspace: patch cc crate by @SchmErik in #757
  • update generated code by @SchmErik in #761
  • refactor(ethereum-relay): Make websocket connection more reliable by @Cardosaum in #697
  • updating bevy readme by @pdg744 in #683
  • Support SNARK seals in Bonsai relay and enable CI for Solidity code via Foundry by @nategraf in #712
  • Fix typos in IBonsaiRelay by @nategraf in #771
  • Add cargo-risczero install by @flaub in #773
  • Support CI in cargo-risczero build-toolchain by @flaub in #778
  • Added GITHUB_TOKEN explicitly to risczero install by @mothran in #780
  • Remove trailing slash from URL in bonsai-sdk by @mothran in #759
  • zkvm: add dev mode by @SchmErik in #752
  • Convert dev mode unit tests to integration tests by @flaub in #785
  • Commented out governance with-zkvm tests by @mothran in #781
  • updating chess readme by @pdg744 in #764
  • Add new verify overload to IRiscZeroVerifier.sol by @nategraf in #782
  • Prepare for release v0.17.0 by @flaub in #786

New Contributors

v0.16.1

13 Jul 05:15
0d02111
Compare
Choose a tag to compare

What's Changed

Full Changelog: v0.16.0...v0.16.1

v0.16.0

11 Jul 16:08
789f006
Compare
Choose a tag to compare

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

#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

  • Starter template: added pointer to website explainer by @pdg744 in #593
  • Update instructions in factors README and comments in starter template by @3lkn in #564
  • Rename examples/evm to examples/zkevm-demo by @flaub in #611
  • factors readme: add pointer to factors explainer by @pdg744 in #592
  • sha example: add pointer from readme to explanatory video by @pdg744 in #587
  • Add ECDSA verification example using bigint acceleration support by @nategraf in #590
  • Fix the password checker example README by @criadoperez in #674
  • Add ZK financial calculation example by @choongng in #595
  • Added Brian's minimal bevy example by @SchmErik in #643
  • Remove older bonsai-template by @mothran in #650
  • Fix typos in examples by @criadoperez in #667

Bonsai SDK

  • Add first draft of bonsai-alpha SDK by @mothran in #606
  • Add first version of Bonsai SDK as 'omega' by @Wollac in #630
  • Revert "Add first version of Bonsai SDK as 'omega' (#630)" by @flaub in #642
  • Update the Bonsai SDK README example code by @mothran in #685
  • Add stark2snark routes to Bonsai SDK by @mothran in #665
  • Bonsai SDK: migrate from image UUID to imageID by @mothran in #662
  • Migrate from BONSAI_ENDPOINT -> multi env var by @mothran in #641

Build / CI

Dependencies

zkVM

New Contributors

Full Changelog: v0.15.0...v0.16.0

v0.15.3

16 Jun 02:47
8094bf8
Compare
Choose a tag to compare

What's Changed

Full Changelog: v0.15.2...v0.15.3

v0.15.2

05 Jun 17:20
6bd9570
Compare
Choose a tag to compare

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: v0.15.1...v0.15.2

v0.15.1

24 May 20:04
42266f0
Compare
Choose a tag to compare

This is a bugfix and documentation release for v0.15. In particular, this fixes a problem installing cargo risczero as described in #579.

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

What's Changed

  • Add a migration guide for the 0.15 release by @3lkn (#578)
  • Pin bstr to fix build issue by @flaub (#580)
  • Include release branches for CI by @flaub (#583)
  • Add a few Rust doc examples to Executor and ExecutorEnv by @3lkn (#572)
  • Update instructions in factors README and comments in starter template by @3lkn (#564)

Full Changelog: v0.15.0...v0.15.1

v0.15.0

23 May 04:58
6c6f98d
Compare
Choose a tag to compare

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

  • Update serial_test requirement from 1.0 to 2.0 by @dependabot in #486
  • Removed Snakecase from risczero new proj name by @mothran in #487
  • Align example project code with latest starter template by @tzerrell in #488
  • Added RISC0_CUDA_OPT and set ptxas opt level to -O1 by @mothran in #492
  • ExecState::segmentize creates execution segments against which proofs may be generated by @shkoo in #482
  • README Getting Started steps have been updated to include new cargo risczero tool by @flaub in #490
  • Update to latest ethers & revm by @flaub in #494
  • Update memory map and drop unused code by @flaub in #491
  • Moved tempdir for risc0-build into cache_dir by @mothran in #497
  • Fixes risc0-build deadlocks on large outputs by @mothran in #498
  • Hash function cleanups by @flaub in #493
  • Added RISC0_GUEST_LOGFILE and fixed clippy warns by @mothran in #499
  • Add system initiated splits to support continuations by @flaub in #469
  • Use generated layout to determine location of registers in rv32im circuit by @shkoo in #476
  • Remove zeroio in favor of risc0_zkvm::serde by @shkoo in #502
  • Add test and example of using stdio through ProverOpts. by @shkoo in #506
  • Move to flashbots RPC for EVM test by @mothran in #508
  • Crates.io validation tooling by @mothran in #501
  • Add serde derives to MemoryImage by @spaugh in #511
  • Delete github-action-benchmark repo directory by @mothran in #512
  • Implementation of new API (as described in Breaking Changes), part 1 by @flaub in #503
  • Document Session and Segment by @tzerrell in #509
  • Add additional sanity checking to the ELF parser by @mothran in #515
  • Added templ_subdir flag to cargo risczero new by @mothran in #517
  • Implementation of new API, part 2 by @flaub in #514
  • Revive profiler, add docs, cleanups by @flaub in #518
  • Update the rust-starter template to match new API by @mothran in #519
  • Replace default_hal with default_prover by @flaub in #520
  • Support Poseidon 254 by @jbruestle in #524
  • Add Clone derive to Segment by @spaugh in #523
  • Added index to Segment / SegmentReceipt by @mothran in #525
  • Move gh-repository location in bench-trend workflow by @mothran in #526
  • Migrate Getting Started into Factors README by @tzerrell in #516
  • Keep CUDA context alive by @flaub in #528
  • Fixing nightly crate validator workflows by @mothran in #522
  • Make MemoryImage::new() failable + bound check by @mothran in #533
  • Added pc to MemoryImage by @mothran in #534
  • Rename risc0/benchmarks to ghpages by @mothran in #537
  • Added running WASM within the zkvm example by @mothran in #539
  • Improve executor perf by @flaub in #536
  • Add BigInt syscall and accelerator in rv32im circuit by @nategraf in #466
  • API adjustment: executor segment callback by @flaub in #540
  • Add mdBook stub by @tzerrell in #527
  • Change the RISC-V circuit semantics for recursions by @jbruestle in #541
  • Update db-dump in crate-validator to fix nightly CI by @mothran in #542
  • Fixed evm block off-by-one, added block_numb arg by @mothran in #544
  • serde: add support to serialize and deserialize 32 bit and 64 bit floating point values by @SchmErik in #545
  • Added libm externs to zkvm guest by @mothran in #543
  • Always provide risc0_zkvm::guest module for easier analyzing, even when not on target=zkvm by @shkoo in #546
  • Remove outdated limitation on EVM example by @tzerrell in #548
  • Fix executor by accounting for extra cycles and patch continuations test for CI by @SchmErik in #556
  • Fix spurious build warning about "duplicate package wordle". by @choongng in #550
  • Use crypto-bigint instead of num-bigint by @nategraf in #547
  • Update to Rust 1.69.0 by @mothran in #553
  • Add FileSegmentRef by @tzerrell in #560
  • Store memory image as a btree of pages by @shkoo in #561
  • Adding feature flag documentation to crate READMEs by @3lkn in #521
  • Update Where's Waldo with syscalls and new hashing traits by @nategraf in #448
  • Adjust image_id to be the hash of (merkle_root, pc) by @flaub in #566
  • Fix for FFI function signature mismatch (issue #569) by @flaub in #570
  • Make sys_sha_buffer available as extern and add RustCrypto sha2 patching example by @nategraf in #567
  • Add error string to opcode decode failure in Executor by @nategraf in #571
  • Workaround to fix self-hosted runners by @flaub in #577
  • Improve receipt docs by @tzerrell in #576

Full Changelog: v0.14.0...v0.15.0

v0.14.0

30 Mar 23:58
e5358c7
Compare
Choose a tag to compare

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: v0.13.0...v0.14.0

v0.13.0

22 Feb 05:51
fceb38d
Compare
Choose a tag to compare

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

  • Decrease use of hardcoded set of buffers (accum, code, data), part 1 by @shkoo in #354
  • risc0-sys crate / HAL refactor by @mothran in #348
  • Add riscv-tests and fix divide extern by @flaub in #359
  • Fix bug in decoding memory instructions by @flaub in #361
  • Improvements to SHA-256 API by @nategraf in #330
  • [NFC] Refactor code in advance of adding support for alternate hashes by @jbruestle in #367
  • Fix metal support by @jbruestle in #369
  • Reword & re-link zkvm README by @tzerrell in #370
  • Update circuit to make it small enough that Metal works. by @jbruestle in #372
  • Add GPU to CI by @flaub in #378
  • Add support for the Poseidon hash and its use by the CPU + Metal Hals for proving and verifying by @jbruestle in #379
  • Add tracing instrumentation to prover to restore granularity by @shkoo in #382
  • Migrate factors & sha examples with shared methods by @tzerrell in #374
  • Add example tests & GPU support by @tzerrell in #386
  • Add SyncSlice for safe(r) multithreading use of slices by @shkoo in #387
  • Fix for #381 by @flaub in #391
  • Add risc0-build-kernel helper crate by @flaub in #392
  • fix: remove unnecessary unsafe sync impls from Elem by @austinabell in #383

New Contributors

Full Changelog: v0.12.0...v0.13.0

v0.12.0

27 Jan 23:47
d44f0be
Compare
Choose a tag to compare

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)