# Changes - Unified the `RLN` struct and core protocol types across public, FFI, and WASM so everything works consistently. - Fully refactored `protocol.rs` and `public.rs` to clean up the API surface and make the flow easier to work with. - Added (de)serialization for `RLN_Proof` and `RLN_ProofValues`, and matched all C, Nim, WASM, and Node.js examples. - Aligned FFI and WASM behavior, added missing APIs, and standardized how witness are created and passed around. - Reworked the error types, added clearer verification messages, and simplified the overall error structure. - Updated variable names, README, Rust docs, and examples across the repo, updated outdated RLN RFC link. - Refactored `rln-cli` to use the new public API, removed serialize-based cli example, and dropped the `eyre` crate. - Bumped dependencies, fixed CI, fixed `+atomic` flags for latest nightly Rust and added `Clippy.toml` for better fmt. - Added a `prelude.rs` file for easier use, cleaned up public access for types and types import across zerokit modules. - Separated keygen, proof handling, slashing logic, and witness into protocol folder.
1.2 KiB
Zerokit RLN-CLI
The Zerokit RLN-CLI provides a command-line interface examples on how to use public API of the Zerokit RLN Module.
Relay Example
The following Relay Example demonstrates how RLN enables spam prevention in anonymous environments for multple 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.
The customize TREE_DEPTH constant differs from the default value of 20 should follow 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 RLN instance.
This example function similarly to the Relay Example but uses a stateless RLN and seperate Merkle tree.
You can run the example using the following command:
cargo run --example stateless --no-default-features --features stateless