Skip to content

shakhvit/risc0-cpp-compilation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Risc0 C++ compilation example

Quick Start

First, make sure rustup is installed.

Then, install the Risc Zero toolchain.

This example works with 1.0.1 version of the toolchain.

To build all methods and execute the method within the zkVM, run the following command:

make execute

or to prove:

make prove

Disabling external dependencies

External dependencies could be disabled by adding arguments to the CPPFLAGS environment variable.

The format is the following:

CPPFLAGS="-DNO_<lib_name>"

For example, to disable libsodium you can use the following command

CPPFLAGS="-DNO_SODIUM" make ...

Here is the list of libs with their macros:

libsodium = -DNO_SODIUM
libutf8proc = -DNO_UTF

Building external dependencies

First, make sure that submodules are installed.

git submodule update --init

Then, to build an external library use a corresponding bash script in the scripts folder.

For example, to build libsodium, use the following script.

./scripts/build-sodium.sh

Built files will be placed at external/libs/<lib>/lib and external/libs/<lib>/include and commited to the git, so, possibly, you don't even need to build external dependencies since they are prebuilt.

About

Compiling C++ code to risc0 ZKVM.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published