This section provides practical, working examples that demonstrate how to use SnarkVM in real-world applications. Each example includes complete, runnable code that you can use as a starting point for your own projects.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/provablehq/snarkvm/llms.txt
Use this file to discover all available pages before exploring further.
Available examples
Hello world
A minimal example to get started with SnarkVM
Token transfer
Transfer credits between accounts on the Aleo network
Custom program
Create and execute a custom Aleo program
Proof verification
Generate and verify zero-knowledge proofs
Prerequisites
All examples assume you have:- Rust installed (version 1.88.0 or later)
- SnarkVM added to your
Cargo.toml:
Cargo.toml
Running the examples
Each example is self-contained and can be run with:main.rs file.
Learning path
We recommend following the examples in this order:- Hello world - Learn basic account creation and address derivation
- Token transfer - Understand transaction creation and execution
- Custom program - Write and deploy your own Aleo program
- Proof verification - Work with zero-knowledge proofs directly
Example structure
Each example follows a consistent structure:Additional resources
API reference
Detailed API documentation for all SnarkVM types
Guides
In-depth guides for common tasks
All examples use the Testnet3 network for demonstration. You can switch to MainnetV0 or CanaryV0 by changing the network type parameter.