| Crates.io | zklense |
| lib.rs | zklense |
| version | 0.1.0 |
| created_at | 2026-01-23 09:01:50.108648+00 |
| updated_at | 2026-01-23 09:01:50.108648+00 |
| description | A command-line tool for profiling, building, and deploying zero-knowledge proofs built with Noir for Solana Blockchain |
| homepage | https://github.com/jinali98/zk-profiling-solana |
| repository | https://github.com/jinali98/zk-profiling-solana |
| max_upload_size | |
| id | 2063886 |
| size | 276,270 |
A command-line tool for profiling, building, and deploying zero-knowledge proofs built with Noir for Solana Blockchain.
zklense is developed using Noir and Sunspot to build and deploy zero-knowledge proofs for Solana Blockchain.
zklense streamlines the ZK development workflow by providing:
📦 For detailed installation instructions, see INSTALL.md
cargo install zklense (requires Rust)brew tap gihanrcg/zklense && brew install zklense (macOS/Linux)scoop install zklense (Windows)# Create a new Noir project with a template
zklense generate --name my_circuit --template age_verifier
# Navigate to the project
cd my_circuit
# Run the full build pipeline
zklense run
# Simulate on Solana devnet
zklense simulate --program-id <PROGRAM_ID>
# View profiling results
zklense view
zklense generateCreate a new Noir project with optional templates.
zklense generate [OPTIONS]
Options:
-n, --name <NAME> Project name (prompts if not provided)
-t, --template <TEMPLATE> Template: age_verifier, merkle_inclusion, or none
Available Templates:
| Template | Description |
|---|---|
none |
Start with default Noir template |
age_verifier |
Verify age threshold based on year of birth |
merkle_inclusion |
Prove membership in a Merkle tree |
Examples:
# Interactive mode
zklense generate
# With arguments
zklense generate --name my_proof --template merkle_inclusion
zklense initInitialize zklense in an existing Noir project.
zklense init [PATH]
Arguments:
[PATH] Project path (defaults to current directory)
Creates a .zklense/ directory with configuration:
.zklense/
└── config.toml
zklense runRun the full proof generation pipeline.
zklense run [PATH]
Arguments:
[PATH] Project path (defaults to current directory)
Pipeline Steps:
nargo execute to generate witnessGenerated Files:
| File | Description |
|---|---|
*.ccs |
Compiled circuit |
*.pk |
Proving key |
*.vk |
Verifying key |
*.proof |
Groth16 proof |
*.pw |
Public witness |
*.so |
Solana program |
zklense simulateSimulate proof verification on Solana devnet and generate a cost analysis report.
zklense simulate [OPTIONS]
Options:
-p, --program-id <PROGRAM_ID> Solana program ID (prompts if not provided)
Report includes:
The report is saved to .zklense/report.json.
zklense viewOpen an interactive web viewer for the profiling report.
zklense view [PATH]
Arguments:
[PATH] Project path (defaults to current directory)
Starts a local server and opens the report in your browser at zklenseile.netlify.app.
zklense versionDisplay the current version.
zklense version
After running zklense generate and zklense run:
my_project/
├── Nargo.toml # Noir project configuration
├── Prover.toml # Proof inputs
├── src/
│ └── main.nr # Circuit code
├── target/
│ ├── my_project.json # Compiled ACIR
│ ├── my_project.ccs # Compiled CCS
│ ├── my_project.pk # Proving key
│ ├── my_project.vk # Verifying key
│ ├── my_project.proof # Groth16 proof
│ ├── my_project.pw # Public witness
│ └── my_project.so # Solana program
└── .zklense/
├── config.toml # zklense configuration
└── report.json # Simulation report
zklense generate --name age_proof --template age_verifier
cd age_proof
Create or edit Prover.toml:
year_of_birth = "1990"
current_year = "2024"
age_threshold = "21"
# Run the full pipeline
zklense run
# When prompted, deploy to Solana devnet
# Save the Program ID that's returned
# Simulate with your deployed program
zklense simulate --program-id <YOUR_PROGRAM_ID>
# View the report
zklense view
zklense tracks several metrics to help optimize zero-knowledge proofs for Solana deployment. Understanding these metrics and how to interpret them is important for building efficient and cost-effective ZK applications.
What it measures:
What it means:
Compute units represent the computational resources consumed by your Solana program. Each operation in your circuit consumes a certain amount of CUs.
How to use it:
What to change:
Simplify circuit logic (reduce constraints, optimize arithmetic operations)
Reduce the number of public inputs/outputs
Use more efficient data structures in your Noir code
Consider splitting complex proofs into multiple smaller proofs
What it measures:
What it means:
Smaller proofs reduce transaction size and costs. The CU per proof size ratio indicates how efficiently your proof is processed.
How to use it:
What to change:
What it measures:
What it means:
Transaction costs determine how expensive it is to verify proofs on-chain. Lower costs make your application more accessible.
How to use it:
What to change:
Reduce compute units consumed (see Compute Units section)
Optimize proof size to reduce transaction size
Set appropriate prioritization fees based on network conditions
Monitor recent_prioritization_fees in the report to set competitive fees
What it measures:
What it means:
Solana has strict transaction size limits. If your transaction exceeds these limits, it will be rejected.
How to use it:
What to change:
What it measures:
What it means:
Indicates whether your proof verification transaction would succeed on-chain.
How to use it:
What to change:
zklense stores configuration in .zklense/config.toml:
[settings]
version = "0.1.0"
initialized_at = "1234567890"
web_app_url = "https://zklenseile.netlify.app/"
| Crate | Purpose |
|---|---|
clap |
Command-line argument parsing |
dialoguer |
Interactive prompts |
console |
Terminal styling |
solana-client |
Solana RPC interactions |
solana-sdk |
Transaction building |
serde / serde_json |
Serialization |
toml |
Configuration files |
webbrowser |
Opening browser for viewer |
anyhow |
Error handling |
zklense provides helpful error messages:
# Missing nargo
❌ Error: Failed to execute 'nargo new'. Is Nargo installed and in PATH?
# Not initialized
⚠️ zklense is not initialized in: /path/to/project
Would you like to initialize it now? [y/N]:
# Missing proof files
❌ Error: Could not find file with extension .proof
Contributions are welcome! Please feel free to submit issues and pull requests.