Meet AO: The Hyper-Parallel Computer

The ao hyper-parallel computer hit the scene in February 2024 and is already making waves among developers worldwide. This innovative system takes inspiration from the actor model, enabling processes to run concurrently and communicate seamlessly without waiting for each other. Each processing unit within ao adheres to a core data protocol that runs on Arweave blockchain-like decentralized storage solution. This distributed network of nodes creates a unified experience for users, presenting ao as a Single System Image (SSI).

1 — The actor model

The network of independent processors, called actors, collaborate by sending messages to each other. This eliminates the need for shared memory, making the AO computer incredibly scalable and efficient. Its asynchronous approach allows tasks to run simultaneously without waiting for each other to finish, significantly speeding up complex computations.

Actor model architecture
Actor model architecture

The network of nodes creates a Single Image System (SSI), making them virtually look like a single giant operating machine. This unified environment is powered by Arweave blockchain-like protocol which leverages the true power of the computer.

2 — The key elements and characteristics

The ao computer is made of the following key components:

  • Processes: the unit of computation in ao. They are represented by a log of interacting messages which are stored on Arweave. Similar to actors, processes hold a state, that can be calculated by the computing units (CUs). In addition, processes exchange messages between them.

  • Messages: all interactions between processes are called messages. And they are transferred between units via scheduler units (SUs).

  • Scheduler Units (SUs): these are in charge of assigning a slot numbering to the messages that are sent between processes. They also ensure that the data is stored on Arweave for permanent access

  • Compute Units (CUs): as mentioned before, the state of a process is calculated using Compute Units nodes, which compete to resolve the state. Once completed, the unit returns logs, outboxes and requests to start other processes.

  • Messenger Units (MUs): these units relay the messages around the ao network and they are responsible for sending the messages to the SU unit.

In summary, when a process sends a message, it first goes to the Messenger Unit. The user pays the MU in tokens or other assets to give it the task of finding the right Scheduler Unit in the distributed scheduler network, which can take any form, decentralized, state or even other blockchains. The SU is in charge of giving a sequence number to the message and uploading it to Arweave. Once uploaded, the SU will request the Compute Unit to fetch that same number from Arweave and resolve the state of the process, if another message is found, the process repeats.

ao computation flow
ao computation flow

The ao computation flow aims at eliminating the scalability issue around blockchains with the following characteristics:

  • Parallel processing: the actor model architecture allows units to process information independently, which does not apply to blockchains like Ethereum and Bitcoin.

  • No size limitation: processes efficiently handle massive datasets because they load data directly from Arweave and process it in-memory, before writing it back to the network. This makes them ideal for demanding computational tasks like artificial intelligence and machine learning.

  • Smart Contracts Automation: In other blockchains, the smart contracts are activated only when the user makes a request. In ao, smart contracts can be scheduled, and perform their functions at specific times

  • Modular architecture: A flexible computing environment with interchangeable parts like schedulers, message systems, and virtual machines. This lets existing smart contract platforms like Warp join the network seamlessly. They can all work together for a smoother and more unified user experience.

The ao computer surges as a real competitor to Ethereum and other smart contract-powered blockchains. It enables collaborative computing, which opens the doors for new developers to build on it without scalability constraints.

3 —Set up AOS

The ao team has built very clear documentation on how to start your AOS process. My role here is to share the key commands for beginners and incentivize developers to explore the easiness of building in this new ecosystem. Before getting into the setup it is worth mentioning the following benefits of the AOS process:

  • Resilient: your server has no single location, eliminating vulnerability to physical attacks.

  • Permanent: your process will not disappear, it will save its holographic state on Arweave, which makes it ready to be picked and played with later. Besides there are no maintenance fees associated with it.

  • Permissionless: no need for registration. Arweave guarantees your right to use it.

  • Trustless: the state of the process is saved on Arweave, without having to trust the hardware it runs on. Allowing to build trustless services on top.

The AOS client runs on NodeJS, so you need to have version 20+ installed on your machine. You can find it here.

Once done, you can install AOS with a straightforward command:

npm i -g https://get_ao.g8way.io

You should see something like this:

AOS opening
AOS opening

In the printcreen above you can see my aos process ID. Everyone using the ao computer will be assigned an ID, which is used to send messages between processes.

The AOS accepts commands in the Lua programming language which is relatively simple to learn, fast and lightweight. In the command line, we can assign a variable, just like we do in Python for instance:

my_process_id = "6uIxNRwXF9j1cunledXk1TUsxqNlwreD2g6e2k4Plb4"

If you call it, you get something like this:

Creating a variable
Creating a variable

This is a very basic command, however, under the hood, we’ve just created a permanent variable stored on Arweave. Every time you connect to your process, you can simply call the variables you’ve created beforehand.

4- Learn how to message

Messages are the interactions between components, making them the core components for communication inside the ao computer. These are built using Lua tables, which are data structures that hold multiple values. The Data is the field you’ll see in all messages because it contains the content/payload.

We can start with the Send function, that takes a Target and the Data. Let’s for instance send a message to the following process ID:

Trinity = "6JYFAOkRBMPhnuWSu1meAfui6wA2zJqPzcajImveXuQ"

To send a message we just need the following command:

Send({Target = Trinity, Data = "Hi Trinity, nice to meet you!"})

Most likely you’ll receive a message in return. To check your messages you can open your inbox. With #Inbox you can see how many messages you have. To open one, you can do:

Inbox[<index_of_message>].Data

You can also access other fields from the received message such as: EpochFrom, and Nonce. Messages can also have tags, which are used in the field Action of the message. For instance, if I create a chatroom with the tags Register and Broadcasting. I can send messages as follows:

Send({ Target = ao.id, Action = "Register", Data = "I'm adding myself as a member to this chatroom!"})

or

Send({ Target = ao.id, Action = "Broadcasting", Data = "Sharing my message to anyone in this room"})

To learn how to create a chatroom with Lua, head to the following tutorial:

You can also learn how to make a token with its tags for people to handle it. Learn how here:

Conclusion

In this piece, we have covered the ao computer’s architecture and how its groundbreaking technology can be a competitor to other smart contract-powered blockchains that do not meet yet the required scalability, to thrive in the long term.

You’ve learned how to set up the AOS in your machine and understood how messages work on the ao computer. The Lua programming language is key to creating more advanced use cases, however, interacting with AOS is easy and does not require extensive software knowledge.

The ecosystem is growing fast, with very little life there is already a decentralized exchange, where you can SWAP tokens called Bark. A stablecoin for the ao computer an oracle and a block explorer.

I believe that in 2024 many applications will surge using ao and Arweave, with the potential to be game changers in the web3 ecosystem. For now, you can join ao’s Discord channel, follow the tutorials and start developing.

Subscribe to Marco Rodrigues
Receive the latest updates directly to your inbox.
Mint this entry as an NFT to add it to your collection.
Verification
This entry has been permanently stored onchain and signed by its creator.