scripts/aleo/counter-smoke.sh)
Candidate target id: aleo-leo
This note records the first ProofForge classification for Aleo and the
implemented Road 1 spike. It does not add a Lean target profile yet; the spike
validates the Leo source-generation boundary before any code registry changes.
Primary deliverables:
ProofForge.Backend.Aleo.IRlowers the portable IRCounterfixture to Leo.proof-forge --emit-counter-ir-leoemitsCounter.leo.Examples/Aleo/Counter.golden.leois the tracked golden fixture.scripts/aleo/counter-smoke.shgenerates a Leo package, runsleo buildandleo test, writesproof-forge-artifact.json, and validates the metadata.ProofForge.Compiler.Leo.Emitadditionally supports pure entrypoints with parameters/return values and control-flow statements (assert,if/else,boundedFor,assign,assignOp).proof-forge --emit-pure-math-ir-leoemitsPureMath.leo.Examples/Aleo/PureMath.golden.leois the tracked golden fixture.scripts/aleo/pure-math-smoke.shvalidates the PureMath fixture end-to-end.
- Aleo getting started
- Leo installation
- Aleo Instructions overview
- Public & Private State
- Programs
- Transactions
- Leo finalization model
- Leo CLI overview
- leo build
- leo execute
- leo test
Local Smoke
The Road 1 spike is validated end-to-end by:- Lean toolchain from
lean-toolchainand a builtproof-forgebinary. python3for package/manifest helpers.leoCLI onPATH(tested with Leo 4.0.2); ifleois missing, the script reports the generatedCounter.leoand exits with code127.
- Portable IR
ProofForge.IR.Examples.Counterlowers to a Leo 4.0 program with a publicmapping,@noupgrade constructor, andfn ... -> Finalentry points whosefinalblocks read/write the mapping. - Generated Leo source matches the tracked golden fixture
Examples/Aleo/Counter.golden.leo. leo buildproduces Aleo Instructions (build/main.aleo) and ABI JSON (build/abi.json).leo testpasses.proof-forge-artifact.jsonis produced and schema-validated.
- Private records, transitions, or proof generation.
- Direct Aleo Instructions generation.
- Devnet deployment or execute transactions.
- Cross-target equivalence with EVM/Psy Counter semantics.
- A standalone
.avmbytecode file; the currentleo buildoutput embeds VM artifacts in the compiled package rather than emitting a separate file.
Classification
Aleo is a ZK-native smart-contract L1. It is not the same kind of target as Zcash, Psy/DPN, or Starknet. The better first classification is:- proof context: private, off-chain execution that can consume/create records and generate ZK proofs;
- finalization context: public, on-chain execution that reads/writes mappings, storage variables, and storage vectors.
Why This Is Not The Same As Existing ZK Targets
Existing ProofForge ZK-related notes cover different shapes:psy-dpn: target source compiles to DPN circuit JSON artifacts.zcash-shielded: ZK proves protocol-defined shielded payment statements.kaspa-toccata: an L1 covenant may verify a proof inline or settle based-app state.starknet-cairo: Cairo contracts compile through Sierra/CASM; Starknet is not modeled as a generic circuit target.
- Leo programs are smart contracts with program ids, imports, entry functions, records, mappings, finalization logic, and deploy/execute transactions;
- private state uses records, which are encrypted and UTXO-like;
- public state uses mappings/storage updated by validators in
finallogic; - execute transactions contain transitions and ZK proofs;
- build outputs include
.aleoinstructions, ABI, prover/verifier files, and Aleo VM bytecode; - local validation can use
leo build,leo test,leo execute, and devnet deployment flows.
Candidate Target Family
Do not add this toProofForge.Target.Registry until the target model can
express Aleo’s proof/finalization split and record/mapping state split.
Candidate family:
Candidate Capabilities
These are research candidates, not canonical capability ids yet.| Candidate capability | Meaning |
|---|---|
lang.leo | Target emits Leo source packages. |
ir.aleo_instructions | Build emits or consumes Aleo Instructions. |
vm.aleo_avm | Target runs on the Aleo VM, not Algorand AVM. |
artifact.avm | Build emits Aleo VM bytecode. |
artifact.aleo_abi | Build emits Aleo ABI metadata. |
proof.prover_key | Build or execute flow produces prover artifacts. |
proof.verifier_key | Build or deploy flow records verifier artifacts. |
execution.transition | Entry execution produces a transition and proof. |
execution.finalize | Program has public on-chain finalization logic. |
state.record | Private state is held in encrypted records. |
state.mapping | Public state is held in mappings. |
state.storage | Public state may use storage variables or storage vectors. |
input.private | Function input is private proof-context data. |
input.public | Function input is public data. |
output.private | Function output is private by default. |
output.public | Function output is public. |
program.import | Program imports and calls another Aleo program. |
program.upgrade | Deployment may support explicit program upgrades. |
transaction.execute | Validation can produce an execute transaction. |
transaction.deploy | Validation can produce or inspect a deploy transaction. |
fee.credits | Fees are paid in Aleo Credits, publicly or privately. |
test.leo | Validation uses Leo tests. |
test.aleo_devnet | Validation uses Leo devnet or devnode-backed flows. |
zk.circuit alone is not sufficient for Aleo. It may describe the proof aspect,
but Aleo also needs program, state, transaction, and finalization capabilities.
Implementation Roads
Road 1: Leo Sourcegen Package
Use this road first. First spike:- choose a tiny Counter-like program;
- generate Leo source with one entry
fnand onefinal { }block; - use a public
mappingfor the counter; - run
leo buildand record.aleo, ABI, bytecode, and toolchain metadata; - run
leo test, with--proveas an optional heavier gate.
Road 2: Private Record Flow
Use this road to validate Aleo’s ZK-specific value proposition. First spike:- define a simple private record type;
- consume one record and create one successor record in a proof-context entry function;
- keep record contents private while exposing only required public outputs or finalize effects;
- run
leo execute --printor SDK-backed execution to inspect transaction and proof metadata.
Road 3: Direct Aleo Instructions
Use this road only after Leo sourcegen proves the semantics. First spike:- lower a tiny typed IR fixture directly to
.aleoinstructions; - preserve public/private input annotations;
- generate or validate prover/verifier artifacts through the official toolchain;
- compare output against Leo-generated Aleo Instructions for the same behavior.
Non-Goals For The First Pass
- Do not add
aleo-leoto the code registry before candidate capabilities are reviewed. - Do not classify Aleo as only a generic ZK circuit target.
- Do not confuse Aleo VM with Algorand AVM.
- Do not model records as EVM storage or as Zcash shielded notes.
- Do not model
finalblocks as private execution; finalization is public and on-chain. - Do not claim full Aleo support until there is a reproducible local build/test command.
- Do not start with direct Aleo Instructions if Leo sourcegen is enough to validate the first spike.
Research Exit Criteria
Aleo can leave Research only when we have:- a reviewed target profile proposal;
- a committed capability proposal for Leo, Aleo Instructions, Aleo VM bytecode, transitions, finalization, records, mappings, proofs, ABI, fees, and devnet validation;
- a minimal artifact manifest schema for Leo source, compiled outputs, prover/verifier artifacts, ABI, and transaction/deploy metadata;
- a toolchain decision for local validation using Leo CLI, SDK, devnet, or devnode;
- one reproducible local command or script that validates a tiny Leo program package, even if proving-heavy gates are optional in CI.
Research Exit Plan
A detailed design spec covering Research exit + Road 1 spike is in docs/superpowers/specs/2026-07-01-aleo-leo-design.md. The spec finalizes:- Target family:
zk-app-sourcegen. - Canonical capabilities for the first spike:
lang.leo,vm.aleo_avm,artifact.avm,artifact.aleo_abi,execution.finalize,state.mapping,input.public,output.public,test.leo. - Research-only capabilities for future spikes:
ir.aleo_instructions,proof.prover_key,proof.verifier_key,execution.transition,state.record,state.storage,input.private,output.private,program.import,program.upgrade,transaction.execute,transaction.deploy,fee.credits,test.aleo_devnet. - Artifact manifest schema for
aleo-leo-package. - Toolchain decision:
leo build+leo testprimary; prove/execute optional. - Spike scope: Road 1 only, public mapping Counter from
ProofForge.IR.Examples.Counter.
ProofForge.Target.Capability / ProofForge.Target.Registry) remain deferred
until the proof/finalization split and private-record roadmap are reviewed.