Aleo Introduces Private Application Development for Blockchain

Aleo is a first layer blockchain using zero knowledge so all transactions on the blockchain have the benefit of maintaining a level of privacy.

post image

Zero-knowledge proofs (zk) are gaining momentum in the blockchain space as a solution to a number of different problems. This concept has been around in cryptography for quite some time, originating in 1985 with The Knowledge Complexity of Interactive Proof Systems. Until recently, practical application has been limited due to computational complexity.

Zcash created a digital currency and transaction protocol using zk proofs as a means of keeping transaction details private when two parties are involved in commerce. This solves one of the problems of using blockchain for transactions where you don’t want everyone on the planet to know who and how much you transferred – just like most people would not publicly share such information from their bank account.

Ethereum virtual machine compatible second layer blockchains such as Polygon implement zk-Rollups, which are essentially a large batch of transactions aggregated by the second layer blockchain and presented to the Ethereum blockchain with zero knowledge proof to verify their authenticity. This results in fewer transactions on Ethereum, which in turn enables higher throughput and lower fees for interacting with the Ethereum blockchain.

Aleo, the first-tier blockchain, expands on these concepts to create an ecosystem for building decentralized applications for use cases where you might want some performance benefits from zk rollups, combined with the notion that certain aspects of blockchain transactions benefit from maintaining a level of privacy.

Why dApps Need Privacy

One of the frequently mentioned aspects of blockchain technology is the public nature of all transactions. There are use cases, such as zcash's example of maintaining some level of bank privacy, where completely open transaction data is not ideal.

Howard Wu, co-founder and CEO of Aleo, said: “There is a wide range of verticals where Web3 lacks privacy. It's not because we need to screw it up, but because many applications require some kind of information asymmetry or data hiding in order to function correctly.”

Wu cited the use of blockchain to play poker as an example. “The dealer can deal cards to seven or eight other players and ask each player for a check or bet. Each player can create a zero-knowledge proof that follows each previous player and weave it into a single transaction that is then passed down the chain, playing one round of the game and then moving on to the next round.” All this happens without the individual players knowing who has which cards.

Other real world applications rely on a combination of public and private state. Aleo gives developers the ability to make decisions about what information to make public and what to keep private. Voting is another practical use case that requires this kind of flexibility. Wu said, “In elections, people want to vote, but they don't want to show other people how they voted. The vote count must be public in order to understand the result. Having closed votes and open totals ends up being a useful feature in apps.”

From a developer implementation standpoint, any items that are marked private are encrypted. Zero knowledge proof is used to verify that the user is encrypting data with their public address, i.e. it can be verified that the person doing the action is who they say they are, but the public address is encrypted so it is not visible on the chain. A zero-knowledge proof is ultimately what proves the encryption algorithm, the decryption algorithm, and the logic that is done “under the hood”.

Writing Aleo dApps with Leo

One of the unique aspects of Aleo's approach to dApp development is the accompanying Leo programming language. “When we first started development, we wanted to tie it to Rust or Typescript, so as not to reinvent the wheel. It turned out to be very difficult to do this, because things that you think are cheap in one programming model are very expensive in this model. We ended up creating a new language because under the hood what the compiler does is very different from the traditional architecture.”

What exactly makes Leo different from Rust or Typescript? Aleo has a high-level language that compiles to polynomials that run inside the proof system. The proof system works on polynomials to get the final result. The end result looks the same as that of a regular processor, but it is accompanied by a zero-knowledge proof that can confirm the fact that the calculations were performed by a particular program on some hidden input that can be exposed at the user's discretion. This is a fundamental difference in architecture.

If you're using LLVM for Rust or C++, you basically need to break away from the LLVM architecture and come up with a new architecture. The problem is that the syntax that you would normally think is simple in a high-level language turns out to be very complex.

An example of the syntax for determining which values are public or private can be found in Leo below.

post image

One way Aleo is trying to overcome the challenges of adopting a new programming language is to make Aleo Package Manager a core part of the Aleo ecosystem vision. When developers create a package for Ethereum, every time an ERC-20 token is deployed, the SafeMath contract is also deployed. Aleo allows you to refer to packages instead of reusing them each time in your code. According to Wu, "The goal is to create an ecosystem of packages where you can start writing 'glue code' rather than reinventing features that have been written before."

Aleo also makes development possible with existing tools. “Most of the users interacting with the blockchain access the existing SDKs from their respective dApps. From our perspective, we are adding support for JavaScript, Wasm and Rust to interact with Leo and Aleo programs from day one to make it as easy as possible to interact with applications that have already been deployed using the traditional software stacks you are already familiar with.”

Aleo is currently in its third testnet, with a mainnet release following the completion of the final testnet phase in October. Howard Wu also recently posted a list of additional Aleo resources on GitHub. Whether or not zk proofs will revolutionize blockchain technology, they are finding their way into non-blockchain applications as well. Back in May 2021, Cloudflare implemented zk proofs into its Privacy Pass to reduce the number of times a person might need to complete a captcha.

https://www.aleo.org/ https://twitter.com/AleoHQ https://github.com/AleoHQ