Getting Started
Installation
Add Cloak SDK to your Rust project. Published on crates.io as cloak-sdk.
Requirements
- Rust 1.70 or later
- Solana CLI 1.18+ (for on-chain interactions)
- Anchor 0.30.x (for program deployment)
Add dependency
Using cargo:
Terminal
cargo add cloak-sdkOr add it manually to your Cargo.toml:
Cargo.toml
[dependencies]
cloak-sdk = "1.0"What's included
The SDK includes everything you need:
| Module | Description |
|---|---|
keys | Meta-address generation, key storage, public sharing |
address | Stealth address derivation, payment creation |
scanner | Payment detection, viewing keys, payment history |
spend | Spending key derivation, Solana keypair conversion |
zk | Groth16 proofs, Pedersen commitments (BN254) |
Verify installation
Create a test to verify everything is working:
tests/verify.rs
use cloak_sdk::StealthMetaAddress;
#[test]
fn test_cloak_sdk() {
let meta = StealthMetaAddress::generate();
let public_str = meta.to_public_string();
assert!(public_str.starts_with("stealth1"));
println!("Cloak SDK v1.0 installed successfully!");
println!("Public meta-address: {}", public_str);
}Terminal
cargo test test_cloak_sdk -- --nocaptureCLI installation
Cloak also provides a CLI for terminal-based operations:
Terminal
# From the cloak-sdk repository
cargo install --path cli
# Verify
cloak --helpThe CLI supports all SDK operations including --private (zk-SNARK hidden amounts) and --relayer (sender privacy) modes.