a16z / jolt

The simplest and most extensible zkVM. Fast and fully open source from a16z crypto and friends. ⚡
https://jolt.a16zcrypto.com
MIT License
619 stars 123 forks source link

feat: standard library support #300

Closed ncitron closed 4 months ago

ncitron commented 4 months ago

Adds support for the standard library in guests. This is done by adding the guest-std flag when importing jolt in the guest. Also note that the flag supplied to the sdk when called from the host has changed from std to host to avoid confusion (although existing programs will need to be updated).

To use this, you need to have a custom rust toolchain by running jolt install-toolchain with this version of the jolt tool.

I've also noticed a few bugs that crop up when tracing and proving some programs generated with the standard library which we should get to the bottom of.

Levike34 commented 4 months ago

@ncitron

To use this, you need to have a custom rust toolchain by running jolt install-toolchain with this version of the jolt tool.

which custom toolchain? I get an error about the target riscv32i-jolt-zkvm-elf not being available for the specified toolchain in the repo.

ncitron commented 4 months ago

The toolchain is riscv32i-jolt-zkvm-elf which is downloaded from a16z/rust. To install make sure you have the latest version of the Jolt tool and run jolt install-toolchain. You can reinstall the jolt tool to update it by running cargo +nightly install --git https://github.com/a16z/jolt --force --bins jolt.

We should probably just check on the fly to see if it is available and install it if not though to avoid these issues.