ao
Computer.Authors (alphabetical): Tyler Hall, Vince Juliano, Ivan Morozov, Sam Williams, Tom Wilson.
Status: DRAFT-5
Network Version: ao.TN.1
ao
?The ao
computer is the actor oriented machine that emerges from the network of nodes that adhere to its core data protocol, running on the Arweave network. This document gives a brief introduction to the protocol and its functionality, as well as its technical details, such that builders can create new implementations and services that integrate with it.
The ao
computer is a single, unified computing environment (a Single System Image), hosted on a heterogenous set of nodes in a distributed network. ao
is designed to offer an environment in which an arbitrary number of paralell processes can be resident, coordinating through an open message passing layer. This message passing standard connects the machine's indepedently operating processes together into a 'web' – in the same way that websites operate on independent servers but are conjoined into a cohesive, unified experience via hyperlinks.
Unlike existing decentralized compute systems, ao
is capable of supporting the operation of computation without protocol-enforced limitations on size and form, while also maintaining the verifiability (and thus, trust minimization) of the network itself. Further, ao
's distributed and modular architecture allows existing smart contract platforms to easily 'plug in' to the network, acting as a single process which can send and recieve messages from any other process.
Instead of enforcing one set of choices upon all users of the computing environment, ao
is built in a modular form: Allowing users to choose which virtual machines, sequencing models, message passing security guarantees, and payment options work best for them. This modular environment is then unified by the eventual settlement of all messages – each sharing the same format – onto Arweave's decentralized data layer. This modularity creates a unified computing environment suiting an extremely wide set of workloads, in which every process can easily transfer messages and cooperate.
ao
's core ojective is to enable trustless and cooperating compute services without any practical bounds on scale. This allows for a radically new design space of applications that were not previously possible: Blending the benefits of smart contract applications (services without requiring trust in anything but code), and traditional compute environments (Amazon EC2, etc).
aos
– a decentralized operating system for ao
– allows developers to launch command-line processes that function like smart contracts within its decentralized network. This process is similar to starting a server on a cloud service, but with decentralization and trustless computation as key advantages. These processes operate without being confined to any particular location, enabling seamless user interactions across the network. The outcome is a 'Single System Image'—a unified, global computing platform that transcends physical and scalability limits, collectively used by all participants. Essentially, AO forms a vast, scalable computer where users can interact with any process, promoting a highly collaborative ecosystem.
For users, ao
represents a shared computer on which they can execute multiple processes. These processes are not confined to any particular servers or under the dominion of any single individual or group. Once activated, these processes deliver their services with cryptographic security, ensuring unbiased and perpetual operation. This design empowers users with the ability to rely on services that maintain their rights consistently over time, fostering a trustable environment for interaction with the system.
When compared to existing decentralized and distributed computation systems, the ao
protocol offers the following features:
ao
, applications are built of any number of communicating processes. Inspired by the original actor model (Carl Hewitt, 1973) and Erlang, ao
does not allow processes to share memory between one another, but does allow them to coordinate via a native message-passing standard. Each of these processes can then be operated at the full speed of the computing resources that are available, without interfering with one another. By focusing on message-passing ao
enables scaling mechanics that are far more similar to traditional web2/distributed systems environments, than traditional smart contracts.ao
network do not need to perform any compute at all in order to reach consensus about program state transitions. State is implied 'holographically' by the Arweave-hosted log of messages to the process. Compute costs are then delegated to users who can either calculate their own states, or request execution by nodes of their choosing.ao
processes can seamlessly load and execute data of any size directly into their memory and write back to the network. This setup eliminates the typical resource constraints and enables fully parallel execution, dramatically expanding the possibilities for application development beyond the limits of traditional smart contract platforms. Consequently, it opens the door to sophisticated applications requiring extensive data handling and computational resources, such as machine learning tasks and high-compute autonomous agents.ao
removes this limitation by allowing contracts to have scheduled 'cron' interactions that automatically wake them up and execute compute at set intervals. Any user, or indeed the process itself, can pay a node to 'subscribe' to a process in order to trigger the evaluation of the compute at the appropriate frequency.ao
's core architecture is an open data protocol that anyone can build an implementation of. Everything – from the sequencers, message passing relayers, and even the virtual machine of the system – can be swapped out and extended at will. This flexibility will allow the existing smart contracting systems in the Arweave ecosystem (Warp, Ever, Mem, et al) to plug into ao
and be able to send and receive messages from the unified network. This will also allow all of these smart contracting systems to share some of the same infrastructure and tooling, making for a more coherent experience of compute on Arweave.ao
Architecture in a NutshellThe fundamental components of ao
are as follows:
ao
is represented by a message. At their core, messages are ANS-104 compliant data items. Users and processes (via their outboxes and messenger units) can send messages to other processes on the network by way of scheduler units. Messages in ao
have semantics between that of UDP and TCP packets: Delivery is guaranteed to occur only once, but if the message is never forwarded by a messenger unit – or the recipient never actually processes it – then its delivery will not occur.ao
. While SUs are obligated to sequence the messages of processes they have accepted, no CU is required to calculate the state of a process. This creates a peer-to-peer market for computation, where CUs offer the service of resolving process state in competition with one another – trading off price, the computation requirements of the process, and other parameters. Once computation of a state is completed, the CU will return to the caller a signed attested of the output (logs, outboxes, and requests to spawn other processes) of the resolution of a specific message. CUs may also generate and publish signed state attestations that other nodes can load – optionally for a UDL specified fee.ao
network according to a process called pushing. In essence, when MUs push a message around the system they send it to the approprate SU for a process, then coordinate with a CU in order to calculate the output of the interaction, and then repeat the process recursively for any resulting outbox messages. This process continues until there are no more messages to push. Users and processes can also pay a MU to subscribe to a process, cranking any messages that result from its timed cron interactions. Processes can also optionally label a message as a cast – leading the MU to send the message to its SU, but not listen for a response. In this way, ao
is able to provide a vibrant environment that gives users and processes maximal choice – VM, payment method, scheduler type, messaging security, and more – without requiring consensus on costly computation itself.There are no direct analogies to draw upon that describe what ao
is and the experience of using it. There are, however, many adjacent projects and networks that can be used to contrast with ao
in order to elucidate its properties. In this section we discuss each in turn.
The Actor Model, introduced by Carl Hewitt, Peter Bishop, and Richard Steiger in their paper, A Universal Modular Actor Formalism for Artificial Intelligence, serves as a foundational framework for understanding and implementing concurrency in computer systems. This model posits that the fundamental unit of computation is the "actor," an entity that can make local decisions, create more actors, send messages, and determine how to respond to messages it receives. This approach to system design and programming facilitates the creation of distributed, highly concurrent, and scalable applications.
ao
is largely inspired by the Erlang computing environment and its programming language. Erlang is an implementation of the actor model which offers extremely lightweight processes, handled by schedulers in the runtime, in order to enable efficient utilization of massively parallel systems (machines and networks with many physical threads). These capabilities give rise to a 'process-oriented' form of programming, in which the developer naturally splits their computation into many cooperating and parallel components in order to achieve their goal. While Erlang is not extremely well known amongst mainstream computing circles, it is used in a significant number of environments where high performance is a necessity: Telephony switches, instant messenging services like WhatsApp, etc.
The ao
computer derives its process-oriented approach from Erlang directly. Erlang offers clue evidence that an environment in which distributed computation is achieved through processes that pass messages but do not share memory can be highly efficient. ao
applies this approach to the domain of smart contracts, while also offering a single system image for an Erlang-like environment for the first time.
Ethereum is a decentralized computing network in which all users share memory and a single thread of execution. Originally based on an idea of adding Turing Complete computation to a blockchain, Ethereum morphed into a project to build a 'world computer'. Upon launch, Ethereum was able to demonstrate the power of trustless computation of arbitrary code – without the production of an independent blockchain network – for the first time. While the network gained immense traction with users and developers, the core network's throughput has not improved since it launched in 2015.
Instead of attempting to scale the base network past the processing capacity of a single, small thread of execution, the Ethereum ecosystem has pivoted to a 'rollup-centric' roadmap. This approach to scaling focuses on supporting additional 'rollup' networks that inherit some of the properties of Ethereum, but not all of them. At the time of writing, there are 14 rollups in the Ethereum ecosystem with more than $100 million of total value represented in their programs. Each of these 14 rollups represents another single thread (a 'process' in ao
terms) of computation that can be performed in parallel. By building from the ground-up to focus on paralell execution rather than shared memory, ao
offers a completely novel architecture that supports an arbitrary number of indepedent processes, while maintaining the ability for programs to be decentralized and trustless.
In traditional smart contract platforms like Ethereum, the shared-thread architecture limits each user to executing only small computational tasks. This restriction constrains the complexity and scalability of operations on the network. This shared resource model inherently limits the scalability and efficiency of applications, impacting the potential for more computationally intensive smart contracts.
Several networks aim to facilitate large-scale computing in a decentralized context, such as Akash. Unlike platforms that prioritize verifiable and reproducible computations, Akash and similar networks provide a decentralized marketplace for container hosting services. This approach allows for the execution of traditional, non-deterministic programs on x86 architecture physical machines. However, it sacrifices the capacity to create trustless services, such as those enabled by smart contracts.
ao
allows developers to select their preferred VM, with the initial reference implementation focusing on WASM for executing processes. WASM containers in ao can manage up to 4 GB of memory, a limit set to increase with the adoption of WASM64, enabling long-duration computations. The rich compilation tools within the WASM ecosystem support a diverse array of programs. Recent examples of uses of WASM include the execution of LLM transformer models, speech recognition, and even compute-heavy image manipulation software (Photoshop) in web browsers.
Despite its significant computational capacities, ao
is able to maintain traditional smart contract execution capabilities due to its holographic state mechanism. Instead of coming to consensus about the state of the computation itself, ao
focuses on ensuring that logs of interactions are written to and available on Arweave. The combination of a deterministic metered VM, as well as the availability of all process messages on Arweave, projects a 'hologram' of the state: The state may not have actually been computed by any participant yet, but when it is computed we can guarantee that its outputs will always be the same. Additionally, the holographic state system enabled by message logs on Arweave enables ao
processes to respond to implied messages on a timed basis, waking themselves up and performing actions. Paired with its holographic state mechanism, ao
also provides a distributed network of Compute Units
that offer cryptographically signed attestations about the results of computation. These compute nodes compete with one another in a market, decreasing the cost of resolving the holographic state for users.
Urbit is a peer-to-peer computation system with some similarities to ao
. Like ao
, by focusing on the transfer and availability of a interaction logs, Urbit is able to offer a distributed compute environment in which 'servers' can be ported from one physical host to another. During the switch from one host to another, the log of interactions with the hosted computation can be executed in order to recalculate the present state. Urbit processes can also send messages to one another in order to communicate.
Unlike ao
, Urbit does not come to decentralized consensus about its interaction logs. In practice, this means that there is no canonical agreement or ensured availability of its 'rollups' – and thus, the state of its processes. In this way, Urbit can be seen as similar to Akash and other decentralized compute marketplaces, with the additional ability to migrate computation from one host to another in a verifiable fashion, if the host is amenable to the transition. ao
builds on this model by ensuring that logs of messages to a process are made available via Scheduler Units (SUs), which upload them to Arweave. By enforcing the availability of this log, user processes are decentralized – no longer resident on one specific computation node – allowing their state to be resolved by a distributed network of Compute Units (CUs) in real-time. This difference in architecture ensures that ao
processes have the necessary properties that enable the deployment of trustless smart contracts (verifiable decentralized computation), as well as the ability to host an arbitrary number of processes. This latter ability arises due to the fact that processes can still be holographically represented (their message log is permanently available) without there being any CUs presently attached to execute them.
The core ao
data protocol, as described in this document, provides a framework for secure computation but does not provide or enforce any forms of economic guarantees in itself. Instead, ao
offers a flexible system of cryptographically secured elements from which economic security mechanisms can be implemented.
In order to fulfil the role of providing users with economic security, an ao
staking contract and token are under development that is able to economically enforce the correct operation of units in the network. While the full specification of this mechanism is outside of the scope of this data protocol definition, we provide a blueprint in the following section to illustrate how such a system can be constructed on top of ao
.
Let \(P_i\) represent the \(i^{th}\) process. Define \(P_i = (Log_i, Init_i, Env_i)\), where:
Notably, as the ao data protocol focuses on providing a universal format for decentralized and verifiable computation, it does not enforce a specific virtual machine, nor any associated parameters. Subsequently, when a developer creates a new process on ao they must specify all of the parameters necessary for units in the system to deterministically execute it. These parameters are added as tags on the spawning data item and may include (but are not limited to):
The state of \(P_i\) at a given time step, \(S(P_i)\), is determined by:
\[ S(P_i) = F(Log_i, Env_i) \]
where \(F\) is a function, defined by \(Env_i\), computing the state based on the message log.
The outbox of new messages to be sent to related processes as a result of a message is described as follows:
\[ Outbox_m = F(Log_i, Env_i, m) \]
where \(m\) refers to the originating message.
Let \(M_{ij}\) represent the \(j^{th}\) message in \(P_i\). \(M_{ij}\) is represented as an ANS-104 compliant data item. The delivery status \(D(M_{ij})\) can be represented as:
\[ D(M_{ij}) = \begin{cases} 1 & \text{if delivered} \\ 0 & \text{else} \end{cases} \]
The ao data protocol employs at-most-once delivery semantics, as detailed in Correctness of at-most-once message delivery protocols, atop which additional guarantees are provided by the maintenance of message logs on Arweave through its data persistence protocol. These guarantees ensure that undelivered messages that result from \(P_i\) may always been delivered later by re-computing \(Outbox(P_i)\) from its message log on Arweave.
Let \(S_U\) denote the stake for unit \(U\), representing the value of locked tokens committed by the unit to ensure economic security for the messages it is involved in relaying. The stake is defined as:
\[ S_U = \text{tokens committed by \(U\) in a staking process} \]
Once staked, the tokens \(S_U\) for any \(U\) may be subject to slashing as a result of malicious behavior.
Upon receiving a message \(m\), an SU, denoted as \(SU_{P_i}\) for process \(P_i\), performs the following operations:
The stake associated with \(SU_{P_i}\), denoted as \(S_{SU_{P_i}}\), is subject to being slashed under the following conditions:
Compute units execute the virtual machine (defined by \(Env_i\)) function \(\lambda\) for \(P_i\) on given a message:
\[ \lambda(P_i, m_j) = \langle \Phi_{P_i}, Outbox_j, Attest_j \rangle \]
where \(\Phi_{P_i}\) is the new process state, \(Outbox_j\) is the set of any resulting outbound messages, and \(\Attest_j\) is a signed attestation of the computation.
Should \(Attest_j\) be determined to be incorrect by other parties, they have the authority to commence a slashing operation against \(S_{CU}\). Subsequently, \(MUs\) can employ the results of \(\lambda(P_i, m_j)\) from a CU, with economic guarantees bounded by \(S_{CU}\), ensuring a secure and reliable framework.
Messenger units act on behalf of the user in order to move messages between processes in the system. By performing this task, called pushing, MUs are able to orchestrate any number of processes in order to perform specific tasks for users.
The recursion ends when there are no more new messages given by \(CU_l\) for all prior messages, signifying the end of the processing cycle for the user's interaction.
\[ \text{Push}(MU_m, M) = \begin{cases} \emptyset & \text{if } M = \emptyset \\ \forall m \in M; SU_k(\sigma(MU_m, m)), Push(MU_m, CU_l(m)_{out}) & \text{Else} \end{cases} \]
Messages are propagated via \(Push(MU_m, m)\), either directly by the Messenger Unit \(MU_m\) or by external initiators. Upon receipt, processes evaluate these messages and their signatures to decide on subsequent actions: either to engage (\(\alpha\)), ignore (\(\iota\)), or request re-transmission with an augmented stake (\(\rho\)). This protocol empowers processes within the ao network to delineate their security requirements for message interaction, symbolically represented as:
\[ \text{Decision}(P_i, m, \sigma) = \begin{cases} \alpha, & \text{if security criteria are met}, \\ \iota, & \text{if the message is to be disregarded}, \\ \rho, & \text{if re-transmission with higher stake is required}. \end{cases} \]
In the event that \(MU_m\) is discovered signing an invalid message, entities within the ao protocol possess the authority to enforce a slashing operation against the stake of \(MU_m\), denoted as \(S_{MU_m}\).
\[ \neg MUm \Rightarrow \text{Slash}(S_{MU_m}) \]
Moreover, should the invalidity stem from a Compute Unit's (CU) attested result, \(\lambda(P_i, m_j)\), \(MU_m\) may assert a claim against the CU's stake, \(S_{CU}\), contingent on the staking mechanism's framework. This relationship is defined as:
\[ \neg \lambda(P_i, m_j) \Rightarrow Transfer(S_{CU}, S_{MU_m}) \]
The ao protocol fosters a decentralized market for computation and message passing, which can be modeled through a minimization function as follows in the presence of an efficient market:
\[ \min_{cu \in \mathcal{U}} \sum_{i=1}^{N \times M_i} \left( \text{Cost}(CU, P_i, M_j) - \lambda S_{P_i} \right) \]
Where:
The publication of this specification accompanies the release of ao.TN.1
. This first testnet release of the system includes fully-functional implementations of SUs, MUs, and CUs for the network. While all choices referenced in this specification are deliberately open to allow different implementations with a range of trade-offs, the initial implementations offers:
ao-lib
) that compiles to WASM, designed to allow for the easy development of processes in ao
.aos
) that lets users interact with and manipulate the system via a Lua command-line interface.Notably missing from this initial version of the testnet are:
ao
network.Implementations of both of these systems are in development.
This protocol defines the ao
computer system in terms of its message structures, types, as well as the API endpoints that services that makeup the ao network employ to communicate. This document is intended to give the reader all of the information that they need in order to build an ao
compliant service implementation. This specification is currently published in draft form. Please provide feedback to the authors if it does not provide sufficient detail or suffers other imprecisions, such that improvements can be made in future publications.
ao
Data Protocolao
Messaging StructuresAll ao
message structures are based off of ANS-104 Data-Items
A data-item is a binary specification found in the ANS-104 Bundled Data Specification. The data-item is the base structure of Arweave Transactions. The ao
Data-Protocol, uses this specification as a core primative for each type
in the ao
Data-Protocol.
Format
Field | Description | Encoding | Length (in bytes) | Optional |
---|---|---|---|---|
Signature type | Type of key format used for the signature | Binary | 2 |
Image Not Showing
Possible Reasons
|
Signature | A signature produced by owner | Binary | Depends on signature type |
Image Not Showing
Possible Reasons
|
Owner | The public key of the owner | Binary | 512 |
Image Not Showing
Possible Reasons
|
Target | An address that this DataItem is being sent to | Binary | 32 (+ presence byte) |
Image Not Showing
Possible Reasons
|
Anchor | A value to prevent replay attacks | Binary | 32 (+ presence byte) |
Image Not Showing
Possible Reasons
|
number of tags | Number of tags | Binary | 8 |
Image Not Showing
Possible Reasons
|
number of tag bytes | Number of bytes used for tags | Binary | 8 |
Image Not Showing
Possible Reasons
|
Tags | An avro array of tag objects | Binary | Variable |
Image Not Showing
Possible Reasons
|
Data | The data contents | Binary | Variable |
Image Not Showing
Possible Reasons
|
All optional fields will have a leading byte which describes whether the field is present (1
for present, 0
for not present). Any other value for this byte makes the DataItem invalid.
A tag object is an Apache Avro encoded stream representing an object { name: string, value: string }
. Prefixing the tags objects with their bytes length means decoders may skip them if they wish.
In the DataItem structure, the anchor
and target
fields are not mandatory. The anchor
serves as an arbitrary value, enabling bundling gateways to guard against replay attacks targeting them or their users. The target
field is specifically utilized in ao
Message data-items
to denote the ao
Process that the Message is aimed at.
The tags
section is the designated area where the specifications for each Data-Protocol type are defined according to the ao
Data-Protocol Standards.
NOTE: All tags names follow the ANS-116 - Arweave Tag Naming Standard
ao
Types
ao
has several message types that instruct the network how to operate, these message type structures are provided below:
The Module
type in the ao
system defines the process module, essentially representing the Web Assembly-compiled code that is executed upon the instantiation of a process.
Tag Name | Description | Requires | Tag Value |
---|---|---|---|
Data-Protocol | The name of the Data-Protocol for this data-item |
1-1 | ao |
Variant | The network version that this data-item is for | 1-1 | ao.TN.1 |
Type | Indicates the shape of this Data-Protocol data-item | 1-1 | Module |
Module-Format | Specifies the WebAssembly compilation method for module compatibility across various host environments. | 1-1 | wasm64-unknown-emscripten-draft_2024_02_15 |
Input-Encoding | Defines the message encoding format, like JSON, XML, for developer-guided data interpretation. | 1-1 | JSON-V1 |
Output-Encoding | Specifies the encoding for outgoing messages, like JSON, XML, ensuring consistent data handling." | 1-1 | JSON-V1 |
Memory-Limit | Sets the module's maximum memory, in megabytes or gigabytes, for optimal performance. | 0-1 | 16-mb |
Compute-Limit | Caps the compute cycles for a module per evaluation, ensuring efficient, controlled execution | 0-1 | 1000 |
Extension | Specifies the WASM module use cases, helping the 'Compute Unit' filter and select compatible modules. | 0-n | ? |
The Process
type in the ao
system defines the process to be instantiated.
Tag Name | Description | Requires | Tag Value |
---|---|---|---|
Data-Protocol | The name of the Data-Protocol for this data-item |
1-1 | ao |
Variant | The network version that this data-item is for | 1-1 | ao.TN.1 |
Type | Indicates the shape of this Data-Protocol data-item | 1-1 | Process |
Module | Links the process to ao module using the module's unique Transaction ID (TXID). | 1-1 | {TXID} |
Scheduler | Specifies the scheduler unit by Wallet Address or Name, and can be referenced by a recent Scheduler-Location . |
1-1 | {ADDRESS} |
Cron-Interval | An interval at which a particular Cron Message is recevied by the process, in the format X-Y , where X is a scalar value, and Y is milliseconds , seconds , minutes , hours , days , months , years , or blocks |
0-n | 1-second |
Cron-Tag-{Name} | defines tags for Cron Messages at set intervals, specifying relevant metadata. | 0-1 | |
Memory-Limit | Overrides maximum memory, in megabytes or gigabytes, set by Module, can not exceed modules setting | 0-1 | 16-mb |
Compute-Limit | Caps the compute cycles for a module per evaluation, ensuring efficient, controlled execution | 0-1 | 1000 |
Pushed-For | Message TXID that this Process is pushed as a result | 0-1 | {TXID} |
Cast | Sets message handling: 'True' for do not push, 'False' for normal pushing | 0-1 | {True or False} |
Authority | Defines a trusted wallet address which can send Messages to the Process | 0-1 | {ADDRESS} |
On-Boot | Defines a startup script to run when the process is spawned. If value "Data" it uses the Data field of the Process Data Item. If it is a TXID it will load that TX from Arweave and execute it. | 0-1 | {Data or TXID} |
{Any-Tags} | Custom Tags specific for the initial input of the Process | 0-n |
The Message
type in the ao
system defines the message to be evaluated by the ao
process.
NOTE:
target
in the ANS-104data-item
specification contains theTXID
of the process that will evaluate the message.
Tag Name | Description | Requires | Tag Value |
---|---|---|---|
Data-Protocol | The name of the Data-Protocol for this data-item |
1-1 | ao |
Variant | The network version that this data-item is for | 1-1 | ao.TN.1 |
Type | Indicates the shape of this Data-Protocol data-item | 1-1 | Message |
Read-Only | Marks message as a message that is looking for a response only and not modifying the memory of the process | 0-1 | {True or False} |
From-Process | If message is sent from a Process this tag references the Process TXID. |
0-1 | {TXID} |
From-Module | If message is sent from a Process this tag references the Module TXID of that Process |
0-1 | {TXID} |
Pushed-For | Message TXID that this message is pushed for when a MU is evaluating the result | 0-1 | {TXID} |
Cast | Sets message handling: 'True' for do not push, 'False' for normal pushing | 0-1 | {True or False} |
{Any-Tags} | Custom Tags specific to the input of the Message | 0-n | {any} |
The Assignment
type in the ao
system defines the schedule of the message. The Scheduler Unit su
creates this data-item
wihch references the Message
and Process
data-item
's. The process and all of its messages all receive an Assignment
. Also any Arweave transaction can be given an Assignment
and it will be loaded into the Process
. Because the Process
receives an Assignment
the Process
data-item
is treated as the first Message
.
Tag Name | Description | Requires | Tag Value |
---|---|---|---|
Data-Protocol | The name of the Data-Protocol for this data-item |
1-1 | ao |
Variant | The network version that this data-item is for | 1-1 | ao.TN.1 |
Type | Indicates the shape of this Data-Protocol data-item | 1-1 | Assignment |
Process | References Process via TXID |
1-1 | {TXID} |
Epoch | Scheduling event sequence, incrementing with each process-scheduler transition. | 1-1 | {Number} |
Nonce | Uniquely increments per process/message within an Epoch, ensuring sequence integrity. | 1-1 | {Number} |
Hash-Chain | Ensures data integrity by cryptographically linking messages. It's crucial for security. | 1-1 | {Hash} |
Timestamp | Records the creation time with precise NTP synchronization. | 1-1 | {UnixTimestamp} |
Message | This tag would contain the TXID of a Message or the TXID of any existing Arweave transaction | 0-1 | {TXID} |
Exclude | Fields of a data-item that will be exclude when the Assignment is loaded |
0-n | {data-item field} |
Block-Height | Records the Arweave blockchain's current block count, offering precise temporal context. | 1-1 | {Number} |
The Scheduler-Location
Data-Item in the "ao" Data-Protocol specifies the Scheduler's URL, determined by the Owner's Wallet Address, creating a secure and authenticated link between the Scheduler and its web endpoint for easy access to its services.
Tag Name | Description | Requires | Tag Value |
---|---|---|---|
Data-Protocol | The name of the Data-Protocol for this data-item |
1-1 | ao |
Variant | The network version that this data-item is for | 1-1 | ao.TN.1 |
Type | Indicates the shape of this Data-Protocol data-item | 1-1 | Scheduler-Location |
Url | Specifies a complete internet resource address, enabling accurate access to the resource. | 1-1 | {URL} |
Time-To-Live | Sets a time limit for caching data URLs, ensuring up-to-date information. | 1-1 | {Milliseconds} |
The "Scheduler-Transfer" Data-Item Type in the "ao" Data-Protocol signals a change in schedulers, ensuring a seamless transition for scheduling operations within the system.
Tag Name | Description | Requires | Tag Value |
---|---|---|---|
Data-Protocol | The name of the Data-Protocol for this data-item |
1-1 | ao |
Variant | The network version that this data-item is for | 1-1 | ao.TN.1 |
Type | Indicates the shape of this Data-Protocol data-item | 1-1 | Scheduler-Transfer |
Scheduler | Records details of the current active Scheduler, preventing confusion about which Scheduler is in control during transitions or scheduling changes within the "ao" system. | 1-1 | {WALLET_ADDRESS or NAME} |
Next-Scheduler | Identifies the upcoming Scheduler for message ordering, ensuring a smooth transition in scheduling duties for system continuity and efficiency. | 1-1 | {TXID} |
Length | Associated with an epoch, counts the total messages created in that phase, aiding in workload tracking and system performance analysis. | 1-1 | {Number} |
Process | References Process via TXID |
1-1 | {TXID} |
Hash-Chain | Ensures data integrity by cryptographically linking messages. It's crucial for security. | 1-1 | {Hash} |
Timestamp | Records the creation time with precise NTP synchronization. | 1-1 | {UnixTimestamp} |
Epoch | Marks when a data-item was created, assigning it to a specific system phase or period for organized processing and analysis within a batch of related messages. | 1-1 | {Number} |
Nonce | Indicates the last used unique number in a message series, ensuring message order, integrity, and security. | 1-1 | {Number} |
The "Snapshot" Data-Item Type in the "ao" Data-Protocol defines how to properly store checkpoint of a process on arweave. Checkpoints are the archiving of the current memory of a Process at a given Epoch
and Nonce
.
Tag Name | Description | Requires | Tag Value |
---|---|---|---|
Data-Protocol | The name of the Data-Protocol for this data-item |
1-1 | ao |
Variant | The network version that this data-item is for | 1-1 | ao.TN.1 |
Type | Indicates the shape of this Data-Protocol data-item | 1-1 | Checkpoint |
Module | Identifier of the module for the checkpoint | 1-1 | {TXID} |
Process | Identifier of the process for the checkpoint | 1-1 | {TXID} |
Epoch | Scheduling event sequence, incrementing with each process-scheduler transition. | 1-1 | {Number} |
Nonce | Uniquely increments per process/message within an Epoch, ensuring sequence integrity. | 1-1 | {Number} |
Timestamp | Records the creation time with precise NTP synchronization. | 1-1 | {UnixTimestamp} |
Block-Height | Records the creation block height. | 1-1 | {Number} |
Cron-Interval | The Cron-Interval that generated this message, identified by its value and tag index |
0-1 | {IntervalId} ie. 0-10-minutes |
Content-Type | The mime type of the data being stored in the data item | 1-1 | application/octet-stream |
Content-Encoding | the encoding of the content being stored in the data item | 0-1 | {encoding} ie. gzip |
SHA-256 | Hash of the memory | 1-1 | {hash} |
The data is stored as a binary octlet stream to arweave, you should be able to use a Compute Unit that this module is compatible with and load the Process at the specific Epoch and Nonce. The Data
may also be encoded, according to the Content-Encoding
Tag eg. gzipped, which will require unzipping before passing to Compute Unit.
ao
Node Unit APIsUnits represent the distinct operational domains within the computer, capable of scaling from 0 to multiple instances, each assigned with unique duties within the network.
The ao
Scheduler Unit is tasked with the sequential arrangement and dissemination of ao
messages to the Arweave network. Additionally, Compute Units are dependent on the Schedulers for obtaining the sequence of ao
messages required for the assessment of updates.
Endpoints
Description
Scheduler Unit Service Information, the Unit
, Address
, Timestamp
, Processes
Description
Submits an ao
DataItem to the Scheduler, the item can be a type of Process
or Message
.
Request Body
ANS-104 DataItem Binary Format See Spec, this can be empty if an Assignment
is being posted via the query parameters.
Query Params
Param | Description | Value | Optional? |
---|---|---|---|
process-id | a Process TXID to write an Assignment to |
{TXID} |
Image Not Showing
Possible Reasons
|
assign | a TXID to assign to a Process |
{TXID} |
Image Not Showing
Possible Reasons
|
base-layer | If present in the url, the su will verify this is a base layer Arweave Transaction |
{no value, present or not} |
Image Not Showing
Possible Reasons
|
Description
This endpoint is usually requested by the Compute Unit (cu)
, and the response is a JSON Array of messages for a given Process
Url Param
Param | Description | Value | Optional? |
---|---|---|---|
process-id | the process {TXID} | {TXID} |
Image Not Showing
Possible Reasons
|
Query Params
Param | Description | Value | Optional? |
---|---|---|---|
from | the Timestamp or Nonce to filter all messages after or equal to this value | {UnixTimestamp or Nonce} |
Image Not Showing
Possible Reasons
|
to | the Timestamp or Nonce to filter all messages before or equal to this value | {UnixTimestamp or Nonce} |
Image Not Showing
Possible Reasons
|
limit | the maximum number of messages to return on the request | {Integer} |
Image Not Showing
Possible Reasons
|
When receiving a 200 response, the body of the response contains a JSON document which contains 0 to many DataItems. These DataItems are structured similar to an Arweave GraphQL response to support cursors and pagination.
In the edges
array there is a node
object with the following properties:
Name | Description | Type |
---|---|---|
message | The message object containg data item fields | Object |
assignment | The assignment object containg data item fields | Object |
In each node
there is a message
object with the following properties:
Name | Description | Type |
---|---|---|
id | Message Identifier (TXID) | String |
tags | Array of (name, value) pairs | Array |
signature | Signature of message | String |
owner | Object containing message signers Address and Key | Object |
anchor | An optional String used by the process code | String |
target | The process id the message is sent to | String |
data | The string value of the data field, if data is not a UTF-8 String, this will be null | String |
In each node
there is a assignment
object with the following properties:
Name | Description | Type |
---|---|---|
id | Assignment Identifier (TXID) | String |
tags | Array of (name, value) pairs, will contain scheduling info like Epoch and Nonce | Array |
signature | Signature of assignment | String |
owner | Object containing su wallet Address and Key | Object |
anchor | An optional anchor set by the su | String |
target | An optional target set by the su | String |
Description
This endpoint is usually requested by the Compute Unit (cu)
, and the response is a single JSON message representing a single message in ao.
Url Param
Param | Description | Value | Optional? |
---|---|---|---|
message-id | the message {TXID} | {TXID} |
Image Not Showing
Possible Reasons
|
Query Params
Param | Description | Value | Optional? |
---|---|---|---|
process-id | the {TXID} of the process for this messag value | {TXID} |
Image Not Showing
Possible Reasons
|
When receiving a 200 response, the body of the response contains a JSON document which contains 1 data-item.
Description
Returns the current timestamp JSON document from the su
Format: JSON
Property | Description |
---|---|
block_height | The current height of the Arweave Network |
timestamp | The current timestamp of the Scheduler Unit |
Description
This endpoint is usually requested by the Compute Unit (cu)
and the Message Unit (mu)
, and the response is a single JSON object representing a single process in ao.
Url Param
Param | Description | Value | Optional? |
---|---|---|---|
process-id | the process {TXID} | {TXID} |
Image Not Showing
Possible Reasons
|
When receiving a 200 response, the body of the response contains a JSON document which contains 1 data-item.
The Compute Unit is tasked with the extraction, assessment, and regulation of the state of designated processes. Subsequent to the evaluation, it is accountable for conveying the outcomes of the specified message process back to the initiating Messenger Unit within the ao
network.
Endpoints
Description
The health check endpoint for the Compute Unit service provides the Wallet
address under which the Compute Unit is managed.
Property | Description |
---|---|
address | wallet address |
timestamp | current timestamp |
Description
This result
endpoint delivers the calculated outcome received as a result of evaluating the message identified by the message identifier.
The result may encompass Output
, Messages
, Assignments
, and/or Spawns
. Output
serves as a reply to the message. Messages
represent outgoing Messages, each to be transmitted to their Target
process, by an ao Messenger Unit. Spawns
represent the initiation of new ao
Processes.
Resource Path Params
Param | Description | Value | Optional? |
---|---|---|---|
message-identifier | the message {TXID} | {TXID} |
Image Not Showing
Possible Reasons
|
Query Params
Param | Description | Value | Optional? |
---|---|---|---|
process-id | the process {TXID} | {TXID} |
Image Not Showing
Possible Reasons
|
Request Body
None
Format: JSON
Property | Description |
---|---|
Messages | An array of outbox messages as a result of evaluating the message |
Assignments | An array of outbox assignments as a result of evaluating the message |
Spawns | An array of outbox spawns as a result of evaluating the message |
Output | A string or object as a result of evaluating the message |
Error? | A string or object that indicates an error occurred as a result of evaluating the message |
GasUsed? | An Integer expressing how much resources were used in the evaluation |
:
Description
Just like Scheduled Messages sequenced via ao
Schedulers, Cron Messages generated and evaluated by an ao
Compute Unit (according to Cron-Interval
tags on the ao
Process) may also produce Outboxes ie. outgoing Messages
, Output
, and/or Spawns
.
However, unlike the Outbox produced by a Scheduled Message, Outboxes produced by Cron Messages are not cycled to ao
Scheduler Units by a Messenger Units regular cycling operation. Instead these "Cron Outboxes" must be cycled separately.
The /cron
endpoint retrieves all "Cron Outboxes", within a timestamp range. This endpoint allows an ao
Messenger Unit to retrieve these Outboxes and cycle them to the corresponding ao
Scheduler Units.
Resource Path Params
Param | Description | Value | Optional? |
---|---|---|---|
process-identifier | the process {TXID} | {TXID} |
Image Not Showing
Possible Reasons
|
*_Query ParamS__
Param | Description | Value | Optional? |
---|---|---|---|
from | the left boundary timestamp (inclusive) | {TXID} |
Image Not Showing
Possible Reasons
|
to | the right boundary timestamp (exclusive) | {TXID} |
Image Not Showing
Possible Reasons
|
Request Body
None
from
and to
Format: JSON
Description
This state
endpoint delivers the process Memory
as a result of evaluating the message identified by the message identifier.
This is the raw memory of the ao Process, as binary data.
Resource Path Params
Param | Description | Value | Optional? |
---|---|---|---|
process-identifier | the process {TXID} | {TXID} |
Image Not Showing
Possible Reasons
|
Query Params
Param | Description | Value | Optional? |
---|---|---|---|
to | the timestamp of the message to evaluate up to (inclusive) | {TXID} |
Image Not Showing
Possible Reasons
|
If to
is not provided, the Compute Unit will evaluate the process up to the most recent Message.
Any Cron Messages in the range will also be generated, and merged into the evaluation stream.
Request Body
None
Format: binary (application/octet-stream
)
The Messenger Unit holds the responsibility for accepting incoming messages from clients, routing these messages to the designated Scheduler, and subsequently retrieving the outcome from the Compute Unit. Additionally, it handles the processing of any messages or spawn requests to conclude the operational cycle.
Endpoints
Description
The root endpoint offers the ability to debug the messages being managed via this unit. You can enable the debugging via the debug
param with a process
identifier or a message
identifier.
*_Query ParamS__
Param | Description | Value | Optional? |
---|---|---|---|
debug | this parameter flips on debug mode | true |
Image Not Showing
Possible Reasons
|
process | the identifier of the process to debug | {TXID} |
Image Not Showing
Possible Reasons
|
message | the identifer of the specific message to debug | {TXID} |
Image Not Showing
Possible Reasons
|
page | the page number | {Number} |
Image Not Showing
Possible Reasons
|
page-size | the amount of items per page | {Number} |
Image Not Showing
Possible Reasons
|
Format: (text/plain)
: 'ao messenger unit'
Description
When posting to the root endpoint, the request body should have a valid DataItem that is defined as an ao
Data-Protocol. This DataItem is validated and routed to a su
based on the Scheduler
tag. This data-item should be either a Message or a Process
Query parameters can also be provided to the base endpoint on the MU in order to post an Assignment. When posting an Assignment via query parameters, the request body should be empty
Request Body
Field | Description | Encoding | Length (in bytes) | Optional |
---|---|---|---|---|
signature type | Type of key format used for the signature | Binary | 2 |
Image Not Showing
Possible Reasons
|
signature | A signature produced by owner | Binary | Depends on signature type |
Image Not Showing
Possible Reasons
|
owner | The public key of the owner | Binary | 512 |
Image Not Showing
Possible Reasons
|
target | An address that this DataItem is being sent to | Binary | 32 (+ presence byte) |
Image Not Showing
Possible Reasons
|
anchor | A value to prevent replay attacks | Binary | 32 (+ presence byte) |
Image Not Showing
Possible Reasons
|
number of tags | Number of tags | Binary | 8 |
Image Not Showing
Possible Reasons
|
number of tag bytes | Number of bytes used for tags | Binary | 8 |
Image Not Showing
Possible Reasons
|
tags | An avro array of tag objects | Binary | Variable |
Image Not Showing
Possible Reasons
|
data | The data contents | Binary | Variable |
Image Not Showing
Possible Reasons
|
Query Params
Param | Description | Value | Optional? |
---|---|---|---|
process-id | a Process TXID to write an Assignment to |
{TXID} |
Image Not Showing
Possible Reasons
|
assign | a TXID to assign to a Process |
{TXID} |
Image Not Showing
Possible Reasons
|
base-layer | If present in the url, the su will verify this is a base layer Arweave Transaction |
{no value, present or not} |
Image Not Showing
Possible Reasons
|
Description
When posting to the this endpoint, the request body should have a valid DataItem that contains the process-id in the target field, that is the {TXID} of the Process DataItem. This same id should also be in the Url as shown above. The data field of this DataItem is not important here but the target and the signature are. After posting here, the MU will attempt to process scheduled messages on this processes on a timed basis with no further user interaction.
Url Param
Param | Description | Value | Optional? |
---|---|---|---|
process-id | the process {TXID} | {TXID} |
Image Not Showing
Possible Reasons
|
Request Body
Field | Description | Encoding | Length (in bytes) | Optional |
---|---|---|---|---|
signature type | Type of key format used for the signature | Binary | 2 |
Image Not Showing
Possible Reasons
|
signature | A signature produced by owner | Binary | Depends on signature type |
Image Not Showing
Possible Reasons
|
owner | The public key of the owner | Binary | 512 |
Image Not Showing
Possible Reasons
|
target | An address that this DataItem is being sent to | Binary | 32 (+ presence byte) |
Image Not Showing
Possible Reasons
|
anchor | A value to prevent replay attacks | Binary | 32 (+ presence byte) |
Image Not Showing
Possible Reasons
|
number of tags | Number of tags | Binary | 8 |
Image Not Showing
Possible Reasons
|
number of tag bytes | Number of bytes used for tags | Binary | 8 |
Image Not Showing
Possible Reasons
|
tags | An avro array of tag objects | Binary | Variable |
Image Not Showing
Possible Reasons
|
data | The data contents | Binary | Variable |
Image Not Showing
Possible Reasons
|
Description
When calling this endpoint, the request body should have a valid DataItem that contains the process-id in the target field, that is the {TXID} of the Process DataItem. This same id should also be in the Url as shown above. The data field of this DataItem is not important here but the target and the signature are. After posting here, the MU will stop attempting to crank scheduled messages for the process.
Url Param
Param | Description | Value | Optional? |
---|---|---|---|
process-id | the process {TXID} | {TXID} |
Image Not Showing
Possible Reasons
|
Request Body
Field | Description | Encoding | Length (in bytes) | Optional |
---|---|---|---|---|
signature type | Type of key format used for the signature | Binary | 2 |
Image Not Showing
Possible Reasons
|
signature | A signature produced by owner | Binary | Depends on signature type |
Image Not Showing
Possible Reasons
|
owner | The public key of the owner | Binary | 512 |
Image Not Showing
Possible Reasons
|
target | An address that this DataItem is being sent to | Binary | 32 (+ presence byte) |
Image Not Showing
Possible Reasons
|
anchor | A value to prevent replay attacks | Binary | 32 (+ presence byte) |
Image Not Showing
Possible Reasons
|
number of tags | Number of tags | Binary | 8 |
Image Not Showing
Possible Reasons
|
number of tag bytes | Number of bytes used for tags | Binary | 8 |
Image Not Showing
Possible Reasons
|
tags | An avro array of tag objects | Binary | Variable |
Image Not Showing
Possible Reasons
|
data | The data contents | Binary | Variable |
Image Not Showing
Possible Reasons
|