Aleo development quick start. Part 1: overview and environment setup

Loggy
3 min readAug 26, 2022

Aleo is not just a zkRollup or anonymous blockchain. It’s a set of tools to run applications based on ZK proofs and keep an updated state on the L1 blockchain solution. And the most significant thing is that these tools allow you to create zk Applications without any knowledge about zk, cryptography and it even doesn’t require any understanding of blockchain development. In this series we’ll build simple Aleo program and walk through its components, deployment process, and usage.

A brief overview of Aleo toolset

  1. snarkOS — A Decentralized Operating System for Zero-Knowledge Applications
  2. snarkVM — A Virtual Machine for Zero-Knowledge Executions
  3. aleo — A Software Development Kit (SDK) for Zero-Knowledge Transactions
  4. leo — The Leo Programming Language. A Functional, Statically-Typed Language for Zero-Knowledge Applications

As you see, all these tools are aimed to assist you in developing and running ZK-powered applications. And this is not it! You can build applications using Aleo Studio — IDE for ZK proofs or you’re always welcome to install the extension for VSCode or Sublime Text(IntelliJ support is on the way).

Environment setup

Important notion: as Aleo stack is under active development at the moment I’d recommend you to build all tools from source code.

  1. First of all, we need Rust and Cargo installed.

Let’s install them:

  • macOS or Linux:

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

  • Windows:

Download the Windows 64-bit executable or the Windows 32-bit executable and follow on-screen instructions.

Please, be sure that you have latest stable version of Rust (at least 1.62.0 at the moment article’s published)

2. Next we install the aleo SDK. It will help us to generate aleo accounts and run a local node for development purposes:

# Download the source code
git clone https://github.com/AleoHQ/aleo && cd aleo
# Build in release mode
$ cargo build --release

3. Finally we need to install the leo:

# Move up from aleo folder
cd ..
# Download the source code
git clone https://github.com/AleoHQ/leo
cd leo

# Build in release mode
$ cargo build --release

Leo is a high-level language helping you easily write applications for Aleo. I would say it looks like a simple version of Rust.

4. Let’s add our leo and aleo release folders to PATH variable:

# open bashrc
nano ~/.bashrc
# put this two lines to the end of the file:
export PATH="$HOME/leo/target/release:$PATH"
export PATH="$HOME/aleo/target/release:$PATH"
#save changes and update current shell:
source ~/.bashrc
# check leo availablity:
leo
leo
The Aleo Team <hello@aleo.org>
CLI Arguments entry point - includes global parameters and subcommands
# <...>
#check aleo availablity:
aleo
aleo
The Aleo Team <hello@aleo.org>
# <...>

During the leo building it installs all other required tools so after the build is completed we are ready to write some code.

Hello, world!

Aleo team provided convenient leo-cli commands to create an application scaffold including a very basic and working example. Let’s create and run this example:

# Move up from leo folder
cd ..
# generate new leo project
leo new hello
New ✅ Created an Aleo program 'hello' (in "/my_lovely_machine/hello")

Great! Now we have our first zk Application. Take your time to discover its components: src , program.json , Leo.toml — it feels like home! Yep, we have some strange folders like input and output that we’ll discuss later. But no hardcore cryptographic stuff anywhere.

Let’s run and see if it works:

leo run
# fetching required parameters
# end of running output:
🚀 Executing 'hello.aleo/main'...• Executing 'hello.aleo/main'...
• Executed 'main' (in 5280 ms)
➡️ Outputs• 3u32

The very first application building and running will take some time as it needs to download some parameters. Please wait for a while and be sure that you have a stable internet connection. Next time it’d be way faster.

Well done! I think we can have a break at this moment. Next time we’ll write some code and discuss input/output files and the deployment process.

P.S. If your setup experience was smooth and you feel yourself ready to go further, you’re welcome to proceed with the second part, it’s already posted.

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

No responses yet

Write a response