Files
27b67e058d release(v3.0.0): full redesign of zerokit's internals, public API and FFI/WASM boundaries to enum/generic-based runtime configuration
## Changes:
- #420 refactor(PR 10): migrate all modules and testcases to new v3
types and remove old code
- #421 refactor(PR 11): rework Merkle tree layer and error type, remove
sled and pmtree utilities, migrate to pmtree v3, fix override_range bug,
generic PmTree<D,H> for any persistent backend
- #423 refactor(PR 12): add SecretFr, WasmSecretFr, FFI_SecretFr,
standardize type naming in Wasm and FFI
- #424 refactor(PR 13): clean generic hash for all zerokit modules
(prepare for future PoseidonHash2)
- #425 refactor(PR 14): cleanup ffi, finalize public apis, rewrite
documentation and readme, bump deps and version
- #430 fix(rln): fix pmtree reload race silently reinitializing the
persisted tree, fix testcase with TempDir
- #427 chore: add devcontainer, split Makefile installdeps, build
devcontainer image on CI
- chore: bump Cargo.lock

---------

Co-authored-by: Ekaterina Broslavskaia <seemenkina@gmail.com>
Co-authored-by: Sydhds <sylvain@status.im>
2026-07-31 20:50:57 +07:00
..

Zerokit RLN-CLI

The Zerokit RLN-CLI provides command-line interface examples on how to use the public API of the Zerokit RLN Module.

Relay Example

The following Relay Example demonstrates how RLN enables spam prevention in anonymous environments for multiple users.

You can run the example using the following command:

cargo run --example relay

You can also change MESSAGE_LIMIT and TREE_DEPTH in the relay.rs file to see how the RLN instance behaves with different parameters.

To customize the TREE_DEPTH constant to differ from the default value of 20, follow the Custom Circuit Compilation instructions.

Stateless Example

The following Stateless Example demonstrates how RLN can be used for stateless features by creating the Merkle tree outside of the RLN instance.

This example functions similarly to the Relay Example but uses a stateless RLN and separate Merkle tree.

You can run the example using the following command:

cargo run --example stateless

Multi Message ID Example

The following Multi Message ID Example demonstrates how RLN supports consuming multiple message_id units in a single proof.

This example functions similarly to the Relay Example but uses the multi-message-id resource files.

You can run the example using the following command:

cargo run --example multi_message_id

Partial Proof Example

The following Partial Proof Example demonstrates how RLN supports accelerated proof generation by pre-computing and caching the static witness portion, then quickly finishing proofs for new messages.

This example functions similarly to the Relay Example but demonstrates the partial proof optimization technique for improved proof generation performance.

Cached partial proofs remain usable across tree changes within a small window - verify against a bounded set of recent roots (e.g. via verify_with_roots) instead of regenerating immediately. Once the root falls outside the allowed window, reset by generating a new partial proof with the latest Merkle path. See the Partial Proof Generation section for details.

You can run the example using the following command:

cargo run --example partial