github risc0/risc0 v0.12.0

latest releases: v0.21.0, v0.21.0-rc.2, v0.21.0-rc.1...
15 months 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)

Don't miss a new risc0 release

NewReleases is sending notifications on new releases.