Private Off-chain Resource Tracking and Orchestration
PORTO is a radically new decentralized framework that implements an Actor-Model orchestration engine using Erlang/OTP natively integrated with the Aleo Zero-Knowledge (ZK) execution layer via the Leo CLI.
It fundamentally solves the throughput-privacy trilemma plaguing monolithic Layer-2 sequencers by completely isolating state logic across multi-node parallel environments. Mathematical confidentiality is generated strictly off-chain while verifiable cryptographic proofs are transmitted to the Aleo ecosystem.
See Tutorial.md for a deep dive into the philosophy and practical usage of PORTO.
The easiest way to set up PORTO and its dependencies (Erlang, Rust, Leo CLI) is using the provided setup script. The script is idempotent and will automatically:
- Install missing system headers (OpenSSL, pkg-config).
- Resolve OTP Version Mismatches: It bootstraps
rebar3from source to guarantee compatibility with your local Erlang version (fixes the common "badfile" error). - Correctly build the Leo CLI from its sub-crate boundaries.
- Compile the Benchmark Kernel: Automatically builds the native Rust workload kernel needed for performance testing.
git clone https://github.com/KathiraveluLab/PORTO
cd PORTO
chmod +x setup_porto.sh
./setup_porto.shgit clone https://github.com/KathiraveluLab/PORTO
cd PORTO
setup_porto.batAfter running the setup script, the PORTO core is already compiled. You can boot the Erlang distributed orchestration engine natively using rebar3 shell. This automatically handles dependency paths and starts the application supervision tree:
cd core
rebar3 shellInside the Erlang shell, you can dynamically spin up your off-chain tracking actors using the provided API. This will seamlessly spawn concurrent OS processes mapping to your Aleo execution circuits:
% Spawns a new actor to track "ResourceA" and validate bounds via zero-knowledge
porto_core_app:track_resource("ResourceA").The setup script already compiles the native Rust binary that simulates ZK computation cost. If you need to recompile it manually:
cd circuits
rustc heavy_workload.rs -O -o heavy_workloadFrom the same Erlang shell (or by launching a new one in core/ via rebar3 shell), run:
% Synchronous baseline (monolithic sequencer model), N=10 proofs
porto_benchmark:run_sync(10).
% PORTO parallel actor dispatch, N=10 proofs
porto_benchmark:run_porto_async(10).The benchmark measures orchestration layer overhead independently of Leo compiler startup latency.
Once started, the node accepts tracking requests over HTTP:
curl -X POST http://localhost:8080/track \
-H "Content-Type: application/json" \
-d '{"resource_id": "node-42"}'The port defaults to 8080 and can be overridden via the $PORT environment variable.
If you encounter "badfile" errors, BEAM mismatches after an Erlang/OTP upgrade, or wish to reset the local database, use the provided cleanup utility.
This utility will prompt for confirmation before deleting any data. It clears build artifacts, resets the Mnesia database, and performs an ASCII-Safety Scan to ensure no toolchain-breaking characters have been introduced.
# Linux
chmod +x cleanup.sh
./cleanup.sh
# Windows
cleanup.batIf you prefer to perform individual steps manually:
- Reset Mnesia State:
rm -rf core/data/ - Clear Build Cache:
rm -rf core/_build/ - ASCII Check: Ensure no non-ASCII characters (like em-dashes
—) exist incore/orcircuits/.