Expand description
§Aleo Rust SDK
A comprehensive Rust SDK for interacting with the Aleo blockchain. Provides tools for account management, program loading, local zero-knowledge execution, proof generation, network querying, and transaction broadcasting.
Built on top of snarkVM 4.10.0 for zero-knowledge proving and reqwest for async HTTP.
§Architecture
The SDK is organized into five modules:
| Module | Purpose |
|---|---|
account | Key chain: PrivateKey → ViewKey → ComputeKey → Address |
program | Load, parse, and inspect Aleo programs |
execution | Authorize, execute, prove, and package transactions |
network | HTTP client for Aleo v2 JSON-RPC and REST endpoints |
record | Record discovery, decryption, and coin selection |
client | High-level AleoClient orchestrating the full lifecycle |
§Quick Start
use aleo_rust_sdk::{AleoClient, AleoAccount};
use snarkvm::prelude::TestRng;
#[tokio::main]
async fn main() -> anyhow::Result<()> {
let mut rng = TestRng::default();
let client = AleoClient::new("https://api.explorer.provable.com/v2/testnet")?;
// Create a random account
let account = AleoAccount::new_random(&mut rng)?;
println!("Address: {}", account.address_str());
// Query the network
let height = client.get_block_height().await?;
println!("Block height: {height}");
Ok(())
}§Feature flags
All features are built-in. The heavy lifting dependency is snarkVM for zero-knowledge proving.
§Related crates
§License
Licensed under MIT OR Apache-2.0.
Re-exports§
pub use account::AleoAccount;pub use client::AleoClient;pub use error::AleoError;pub use execution::ExecutionEngine;pub use network::AleoHttpClient;pub use network::FixedStateRootQuery;pub use network::ProvableQuery;pub use program::AleoProgram;
Modules§
- account
- Aleo Account — key management for Aleo blockchain accounts.
- client
- Aleo Client — the top-level entry point for the SDK.
- error
- Aleo SDK — custom error types.
- execution
- Aleo Execution — authorization, proving, and transaction packaging pipeline.
- network
- Aleo Network — RPC client for interacting with Aleo blockchain nodes.
- program
- Aleo Program — load and inspect Aleo programs.
- record
- Aleo Record — record discovery, decryption, and selection.