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:1
Setup
Import necessary types and create the runtime environment
2
Execution
Perform the core operations demonstrated by the example
3
Verification
Verify the results and print output
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.