Skip to main content

Rust Crates

Overview

The Rust SDK is a set of crates that power the sequencer, prover, and client tooling. These crates are designed for low-level integrations and protocol implementations.

Crates

CratePurpose
zelana-transactionTransaction types and signing
zelana-privacyShielded notes, nullifiers, and encryption helpers
zelana-thresholdThreshold encryption primitives
zelana-accountAccount identifiers and state types
zelana-pubkeyPublic key helpers
zelana-signatureSignature types and verification
zelana-keypairKeypair generation and utilities
zelana-blockBlock header serialization and parsing
txblobEncrypted transaction blob format
zephyrUDP transport protocol primitives
zelana-ownership-proverOwnership proof helpers

Add to Your Project

  1. Choose a dependency strategy.

Workspace (this repo):

[dependencies]
zelana-transaction = { workspace = true }
zelana-privacy = { workspace = true }
zelana-block = { workspace = true }
zephyr = { workspace = true }

External path:

[dependencies]
zelana-transaction = { path = "../zelana/sdk/transaction" }
zelana-privacy = { path = "../zelana/sdk/privacy" }
zelana-block = { path = "../zelana/sdk/block" }
zephyr = { path = "../zelana/sdk/zephyr" }

Run cargo build to confirm the crates resolve correctly.

Example: Serialize a Block Header

use zelana_block::BlockHeader;

fn main() -> Result<(), Box<dyn std::error::Error>> {
let header = BlockHeader::genesis();
let bytes = header.to_bytes()?;
let parsed = BlockHeader::from_bytes(&bytes)?;

assert_eq!(header, parsed);
println!("Block header OK: batch_id={}", parsed.batch_id);
Ok(())
}

You should see Block header OK: batch_id=0.

What’s Next

  • Use zephyr for UDP transport experiments and low-latency submissions.
  • Use txblob and zelana-privacy if you are implementing shielded flows.