Rust/Linux

For the purposes of this guide, the zkpass-sdk repository is cloned into the home directory of the current user, retaining its default name. This places the zkpass-sdk repository at ~/zkpass-sdk. As a result, the root directory for the zkPass SDK is set to ~/zkpass-sdk/rust.

Should you choose to clone the zkpass-sdk repository into a different location, ensure that you adjust any referenced paths in the instructions to match your chosen directory structure.

SDK Structures

To find out how the SDK is structured, at the root of the zkPass SDK run the following:

cd ~/zkpass-sdk/rust
tree -L 2

The output should look like this:

├── bin
│   └── zkpass-query-tool
├── Cargo.lock
├── Cargo.toml
├── lib
│   ├── libr0_zkpass_query.so
│   └── libsp1_zkpass_query.so
├── localization
│   ├── en-US.ftl
│   └── id-ID.ftl
├── README.md
├── target
│   ├── CACHEDIR.TAG
│   └── debug
├── test
│   └── data
├── test.sh
├── zkpass-client
│   ├── Cargo.toml
│   └── src
├── zkpass-core
│   ├── Cargo.toml
│   └── src
├── zkpass-demo
│   ├── Cargo.toml
│   ├── src
│   └── tests
└── zkpass-query
    └── types

Here are the descriptions for each sub directory:

  • bin This contains the tool binaries. Currently, it has the zkpass-query-tool app.

  • lib This contains the libr0_zkpass_query.so dynamic library which implements the zkPass query engine. This library is needed at run-time by the zkpass-client library for proof verification purposes. The dynamic library must be included in the LD_LIBRARY_PATH env variable so that the system loader knows where to find the library.

  • localization Contains language files (.ftl) for translations.

  • target This is the output directory of the cargo build.

  • test/data This contains several test queries and their related user data in json encoding. You can use this test data when running the zkpass-demo app.

  • zkpass-client This is the main SDK library crate.

  • zkpass-core This is an internal library that is linked statically with the zkpass-client crate.

  • zkpass-demo This is the demo application of zkpass

  • zkpass-query Type declaration for query engine errors

Last updated