
Understanding the four Legion Score pillars
What each score represents, how it is calculated, and what it takes to reach the top

Concrete Vaults: the most accessible path to real yield in DeFi
A beginner-friendly introduction to automated DeFi strategies powered by Concrete.

Deploying your first Solidity Contract on Arc Testnet
Deploying your first Solidity Contract on Arc Testnet


Understanding the four Legion Score pillars
What each score represents, how it is calculated, and what it takes to reach the top

Concrete Vaults: the most accessible path to real yield in DeFi
A beginner-friendly introduction to automated DeFi strategies powered by Concrete.

Deploying your first Solidity Contract on Arc Testnet
Deploying your first Solidity Contract on Arc Testnet


Subscribe to Colliseum

Subscribe to Colliseum
<100 subscribers
<100 subscribers
My name is Heorhii, and I work with the Aleo stack every day. I write a lot of zero knowledge programs, experiment with Leo, and build SDK integrations. One thing every Aleo developer eventually needs is a clear, reliable path to deploy a program. It looks simple on the surface, but behind the scenes are key generation, proving, verification, and strict network rules.
This guide is written for developers who want a step by step process with full code examples. I cover everything from writing a Leo program to deploying it with the Provable SDK and verifying the resulting transaction on chain.
Writing the program in Leo. Let’s start with a realistic Leo program. Below is a simple example, but formatted the way you will see real Leo code used in production.
program calculator.aleo {
transition add(public a: u32, public b: u32) -> u32 {
let result: u32 = a + b;
return result;
}
transition multiply(public a: u32, b: u32) -> u32 {
let temp: u32 = a * b;
return temp;
}
transition encrypted_add(a: u32.private, b: u32.private) -> u32.private {
let sum: u32 = a + b;
return sum;
}
}
Before deploying, this program must be compiled to Aleo Instructions.
In your project directory:
This produces:
./build/calculator.aleo
This file is the source you will load into your JavaScript or TypeScript deployment script.
Importing dependencies and initializing WebAssembly. You must always initialize the threadpool before using any Provable SDK features.
import {
Account,
AleoNetworkClient,
ProgramManager,
AleoKeyProvider,
initThreadPool
} from "@provablehq/sdk";
// Initialize WASM worker threads
await initThreadPool();
Creating the Account
const account = new Account({
privateKey: "APrivateKey1abcdefghijklmnopqrstuvw"
});
console.log("Using address:", account.address());
Connecting to the Aleo Network. You can use Testnet or Mainnet. Here we use the official public Testnet endpoint.
const networkClient = new AleoNetworkClient(
"https://api.explorer.provable.com/v1"
);
Setting up the AleoKeyProvider. KeyProvider handles proving and verifying keys for every transition.
Caching keys dramatically improves performance.
const keyProvider = new AleoKeyProvider();
keyProvider.useCache(true);
You can also point it to a custom CDN:
keyProvider.useRemote("https://my-cdn.example.com/keys");
Initializing ProgramManager
const programManager = new ProgramManager(networkClient, keyProvider);
programManager.setAccount(account);
Loading the program as a string. If the program was compiled by Leo:
import fs from "fs";
const program = fs.readFileSync(
"./build/calculator.aleo",
"utf8"
);
Or you can inline it:
const program = `
program calculator.aleo;
function add:
input r0 as u32.public;
input r1 as u32.public;
add r0 r1 into r2;
output r2 as u32.public;
`;
Estimating deployment fee. This is very useful before deployment.
const estimatedFee = await ProgramManager.estimateDeploymentFee(program);
console.log("Estimated fee in microcredits:", estimatedFee);
If you need to convert microcredits to credits:
const credits = estimatedFee / 1_000_000;
console.log("Estimated fee in credits:", credits);
Building a deployment transaction
const fee = 3.8; // pay in Aleo credits
const privateFee = false;
const deploymentTx = await programManager.buildDeploymentTransaction(
program,
fee,
privateFee
);
console.log("Deployment transaction built:");
console.log(deploymentTx);
Submitting the transaction
const txId = await programManager.networkClient.submitTransaction(deploymentTx);
console.log("Submitted deployment tx:", txId);
Checking the deployment status
const txInfo = await programManager.networkClient.getTransaction(txId);
if (txInfo.execution.success) {
console.log("Deployment successful");
} else {
console.log("Deployment failed");
console.log(txInfo);
}
You can also poll until the transaction finalizes:
async function waitForFinalization(id) {
while (true) {
const tx = await networkClient.getTransaction(id);
if (tx.finalized) return tx;
await new Promise(r => setTimeout(r, 4000));
}
}
const finalized = await waitForFinalization(txId);
console.log("Finalized deployment:", finalized);
Deploying in one step:
const txId = await programManager.deploy(program, fee, false);
console.log("Deployment submitted:", txId);
const result = await programManager.networkClient.getTransaction(txId);
console.log(result);
Calling a function after deployment. Example: calling the add transition in calculator.aleo.
const response = await programManager.execute(
"calculator.aleo",
"add",
["5u32", "7u32"],
0.1,
false
);
console.log("Execution result:", response);
Encrypted example:
const response = await programManager.execute(
"calculator.aleo",
"encrypted_add",
["3u32", "2u32"],
0.1,
false
);
Deploying programs privately. You can pay deployment fees using private credits.
You must provide a private fee record:
const record = "{
owner: aleo1abc...,
microcredits: 10000000u64,
_nonce: 123scalar
}";
const tx = await programManager.buildDeploymentTransaction(
program,
0.2,
true,
record
);
Full deployment script example. A complete script:
import fs from "fs";
import {
Account,
AleoNetworkClient,
ProgramManager,
AleoKeyProvider,
initThreadPool
} from "@provablehq/sdk";
async function main() {
await initThreadPool();
const privateKey = "APrivateKey1...";
const account = new Account({ privateKey });
const program = fs.readFileSync("./build/calculator.aleo", "utf8");
const networkClient = new AleoNetworkClient("https://api.explorer.provable.com/v1");
const keyProvider = new AleoKeyProvider();
keyProvider.useCache(true);
const pm = new ProgramManager(networkClient, keyProvider);
pm.setAccount(account);
const fee = 3.8;
const tx = await pm.deploy(program, fee, false);
console.log("Deployment submitted:", tx);
const result = await pm.networkClient.getTransaction(tx);
console.log("Deployment result:", result);
}
main();
Troubleshooting tips:
• If deployment fails with an insufficient fee error, raise the fee value
• If proving gets stuck, ensure await initThreadPool() is called
• If a transition cannot find keys, set keyProvider.useCache(true)
• If deployment is rejected, check for syntax errors in Aleo Instructions
• If program name already exists, rename your program
More info you can find here:
Final thoughts. Deploying a program on Aleo can look complex at first because the platform performs real zero knowledge proving during deployment. After you understand how ProgramManager, AleoNetworkClient, and AleoKeyProvider work together, the workflow becomes predictable and comfortable.
With Leo, you write expressive zero knowledge logic.
With the Provable SDK, you ship it to the network.
With the explorer, you verify it live.
To know more about Aleo, join now!
Aleo Twitter
Aleo Discord
Aleo Website
List of Aleo and Leo code and resourses
Prepared by Colliseum
My name is Heorhii, and I work with the Aleo stack every day. I write a lot of zero knowledge programs, experiment with Leo, and build SDK integrations. One thing every Aleo developer eventually needs is a clear, reliable path to deploy a program. It looks simple on the surface, but behind the scenes are key generation, proving, verification, and strict network rules.
This guide is written for developers who want a step by step process with full code examples. I cover everything from writing a Leo program to deploying it with the Provable SDK and verifying the resulting transaction on chain.
Writing the program in Leo. Let’s start with a realistic Leo program. Below is a simple example, but formatted the way you will see real Leo code used in production.
program calculator.aleo {
transition add(public a: u32, public b: u32) -> u32 {
let result: u32 = a + b;
return result;
}
transition multiply(public a: u32, b: u32) -> u32 {
let temp: u32 = a * b;
return temp;
}
transition encrypted_add(a: u32.private, b: u32.private) -> u32.private {
let sum: u32 = a + b;
return sum;
}
}
Before deploying, this program must be compiled to Aleo Instructions.
In your project directory:
This produces:
./build/calculator.aleo
This file is the source you will load into your JavaScript or TypeScript deployment script.
Importing dependencies and initializing WebAssembly. You must always initialize the threadpool before using any Provable SDK features.
import {
Account,
AleoNetworkClient,
ProgramManager,
AleoKeyProvider,
initThreadPool
} from "@provablehq/sdk";
// Initialize WASM worker threads
await initThreadPool();
Creating the Account
const account = new Account({
privateKey: "APrivateKey1abcdefghijklmnopqrstuvw"
});
console.log("Using address:", account.address());
Connecting to the Aleo Network. You can use Testnet or Mainnet. Here we use the official public Testnet endpoint.
const networkClient = new AleoNetworkClient(
"https://api.explorer.provable.com/v1"
);
Setting up the AleoKeyProvider. KeyProvider handles proving and verifying keys for every transition.
Caching keys dramatically improves performance.
const keyProvider = new AleoKeyProvider();
keyProvider.useCache(true);
You can also point it to a custom CDN:
keyProvider.useRemote("https://my-cdn.example.com/keys");
Initializing ProgramManager
const programManager = new ProgramManager(networkClient, keyProvider);
programManager.setAccount(account);
Loading the program as a string. If the program was compiled by Leo:
import fs from "fs";
const program = fs.readFileSync(
"./build/calculator.aleo",
"utf8"
);
Or you can inline it:
const program = `
program calculator.aleo;
function add:
input r0 as u32.public;
input r1 as u32.public;
add r0 r1 into r2;
output r2 as u32.public;
`;
Estimating deployment fee. This is very useful before deployment.
const estimatedFee = await ProgramManager.estimateDeploymentFee(program);
console.log("Estimated fee in microcredits:", estimatedFee);
If you need to convert microcredits to credits:
const credits = estimatedFee / 1_000_000;
console.log("Estimated fee in credits:", credits);
Building a deployment transaction
const fee = 3.8; // pay in Aleo credits
const privateFee = false;
const deploymentTx = await programManager.buildDeploymentTransaction(
program,
fee,
privateFee
);
console.log("Deployment transaction built:");
console.log(deploymentTx);
Submitting the transaction
const txId = await programManager.networkClient.submitTransaction(deploymentTx);
console.log("Submitted deployment tx:", txId);
Checking the deployment status
const txInfo = await programManager.networkClient.getTransaction(txId);
if (txInfo.execution.success) {
console.log("Deployment successful");
} else {
console.log("Deployment failed");
console.log(txInfo);
}
You can also poll until the transaction finalizes:
async function waitForFinalization(id) {
while (true) {
const tx = await networkClient.getTransaction(id);
if (tx.finalized) return tx;
await new Promise(r => setTimeout(r, 4000));
}
}
const finalized = await waitForFinalization(txId);
console.log("Finalized deployment:", finalized);
Deploying in one step:
const txId = await programManager.deploy(program, fee, false);
console.log("Deployment submitted:", txId);
const result = await programManager.networkClient.getTransaction(txId);
console.log(result);
Calling a function after deployment. Example: calling the add transition in calculator.aleo.
const response = await programManager.execute(
"calculator.aleo",
"add",
["5u32", "7u32"],
0.1,
false
);
console.log("Execution result:", response);
Encrypted example:
const response = await programManager.execute(
"calculator.aleo",
"encrypted_add",
["3u32", "2u32"],
0.1,
false
);
Deploying programs privately. You can pay deployment fees using private credits.
You must provide a private fee record:
const record = "{
owner: aleo1abc...,
microcredits: 10000000u64,
_nonce: 123scalar
}";
const tx = await programManager.buildDeploymentTransaction(
program,
0.2,
true,
record
);
Full deployment script example. A complete script:
import fs from "fs";
import {
Account,
AleoNetworkClient,
ProgramManager,
AleoKeyProvider,
initThreadPool
} from "@provablehq/sdk";
async function main() {
await initThreadPool();
const privateKey = "APrivateKey1...";
const account = new Account({ privateKey });
const program = fs.readFileSync("./build/calculator.aleo", "utf8");
const networkClient = new AleoNetworkClient("https://api.explorer.provable.com/v1");
const keyProvider = new AleoKeyProvider();
keyProvider.useCache(true);
const pm = new ProgramManager(networkClient, keyProvider);
pm.setAccount(account);
const fee = 3.8;
const tx = await pm.deploy(program, fee, false);
console.log("Deployment submitted:", tx);
const result = await pm.networkClient.getTransaction(tx);
console.log("Deployment result:", result);
}
main();
Troubleshooting tips:
• If deployment fails with an insufficient fee error, raise the fee value
• If proving gets stuck, ensure await initThreadPool() is called
• If a transition cannot find keys, set keyProvider.useCache(true)
• If deployment is rejected, check for syntax errors in Aleo Instructions
• If program name already exists, rename your program
More info you can find here:
Final thoughts. Deploying a program on Aleo can look complex at first because the platform performs real zero knowledge proving during deployment. After you understand how ProgramManager, AleoNetworkClient, and AleoKeyProvider work together, the workflow becomes predictable and comfortable.
With Leo, you write expressive zero knowledge logic.
With the Provable SDK, you ship it to the network.
With the explorer, you verify it live.
To know more about Aleo, join now!
Aleo Twitter
Aleo Discord
Aleo Website
List of Aleo and Leo code and resourses
Prepared by Colliseum
Share Dialog
Share Dialog
No activity yet