Async Transactions on Rialo

Published on
March 9, 2026

Traditional blockchains execute transactions synchronously. Users submit transactions to perform a specific onchain action, such as transferring tokens, and validators include those transactions in blocks before executing the requested operation. This model is the default for most blockchains and requires onchain execution to be synchronous and atomic:


Synchronous execution is straightforward to implement and easy to reason about. It also works well for common user flows, many of which involve simple state updates that can execute in a single atomic step. Basic transfers and swaps are good examples, as they rarely depend on external input and typically require only a single execution step.

But many applications implement complex workflows that may not always fit within the synchronous execution model. Completing a workflow within a single block may be difficult (or even impossible) if it involves multiple dependent execution steps or relies on results from external processes. In such cases, the blockchain must be able to pause a transaction's execution while the invoked program waits for an external operation to complete and return a result. Execution can then resume once the external operation completes and the required data becomes available.

Traditional blockchains lack native asynchronous execution, forcing developers to implement workarounds to run logic that requires it. A common workaround involves breaking asynchronous workflows into separate transactions and relying on offchain infrastructure to coordinate execution:

Although practical, this arrangement increases complexity and introduces additional failure points. It also expands the attack surface by requiring integration with multiple offchain components with different security properties and trust assumptions. 

Rialo makes asynchronous execution seamless, reliable, and secure by embedding the functionality directly into the protocol. Users can create async transactions that start executing, pause while an external operation runs, and resume later once the required results become available.


We explore Rialo’s approach to native asynchronous execution in the next section.

More of a visual learner? See the full async transactions tutorial on Rialo Learn for step-by-step explanations and interactive demos. ↗️

Understanding Rialo's approach to native async execution

Rialo's async execution model follows the familiar async/await pattern from traditional software programming. In Rialo programs, this pattern is expressed using the AFTER wait until instruction. It allows developers to write program logic that pauses execution until an external operation completes and returns a result.

When a program reaches an AFTER wait until instruction, the chain records that the workflow is waiting for an external operation to complete. Execution pauses at that point and resumes only once the result is available. From the developer’s perspective, the workflow behaves like an asynchronous function: it begins executing, pauses while an external task runs, and continues once the result is returned.



We'll walk through a real-world example of asynchronous execution in the next section.

A real-world example of asynchronous execution

Most DeFi lending today is overcollateralized: borrowers must deposit collateral that exceeds the loan amount. Real-world lending works differently. Loans are often undercollateralized or uncollateralized, meaning the collateral value is lower than the loan value, or no collateral is required from borrowers.

This system works because (a) loan underwriters can assess creditworthiness using credit scores, and (b) borrowers risk reducing their credit scores (which reduces loan opportunities) if they fail to repay loans on agreed timelines.

What if DeFi protocols could issue undercollateralized or uncollateralized loans by evaluating creditworthiness using real-world credit data such as FICO scores? This change would transform DeFi lending and deliver tangible benefits to real-world users. But it is currently impractical for existing blockchains.

To illustrate, here's what a potential implementation using existing blockchain infrastructure would look like:

  1. The user submits a loan request
  2. The contract emits an event requesting the user's credit score and pauses execution
  3. A relay service detects the event, queries the external API, and returns the requested data
  4. A keeper triggers a callback in the loan contract
  5. The application resumes execution and processes the loan request using the returned data


Implementing this async workflow of this form normally requires several layers of infrastructure. Developers must write contracts that emit requests, deploy relay services to observe events, integrate external APIs, implement callback logic to handle returned data, and pay keepers to trigger callback logic at the right time. Each component introduces additional operational overhead and potential failure modes.

Token management becomes more complicated as well. Suppose the relay service and keeper network require payment in separate tokens. Executing a single loan request may therefore require three tokens: the chain’s native token for gas and additional tokens to compensate relays and keepers.

In Rialo, asynchronous execution is part of the protocol itself. Developers write their workflow logic once, deploy the contract, and let the chain handle scheduling and execution. There is no need to manage multiple tokens or rely on multiple offchain actors to coordinate execution. The chain itself oversees async workflows for applications.

We'll see why this feature is valuable in the next section, which focuses on the applications of async transactions.

What are the applications of async transactions?

Async transactions expand the design space of onchain applications and increase the usefulness of crypto-native systems for different users, businesses, and institutions. For example, financial applications can run asynchronous workflows where they retrieve external credit data, risk metrics, or identity data before executing financial logic. The ability to pull real-world data and use it to inform onchain execution without the overhead of integrating offchain infrastructure becomes a powerful capability for DeFi applications.

Consider the previous example of a DeFi application that issues uncollateralized loans after evaluating a user's FICO score. This application is difficult to build today due to the limitations of conventional blockchains, but it is straightforward to implement with async transactions on Rialo.

The logic for fetching and handling credit scores is the most important part. That step can be expressed as an asynchronous workflow spanning multiple blocks. The workflow requests a user's credit score, pauses while the external operation runs, and resumes automatically once the requested data is returned by the offchain process.

Here's a potential implementation:


The workflow’s execution begins when a user submits a loan request. The transaction is added to a block, after which the application starts executing the request_fico_score function.

When the program reaches the AFTER wait until get_fico instruction, the chain records that the workflow is waiting for the get_fico operation to complete. Execution pauses while the credit score check runs offchain.

The application resumes execution after the credit check completes and processes the returned data using the handle_score callback function. The application may confirm the credit score meets a particular threshold (e.g., user credit score > 700) before proceeding to process the loan request.

The same asynchronous workflow model is preserved in this implementation of the lending application. However, using Rialo’s async execution functionality provides specific benefits:


Async execution can be applied to other financial applications as well. For instance, onchain payment applications can integrate with traditional finance to offer additional functionality. A payment app can allow users to deposit funds into a bank account and use those deposits to cover onchain transfers. The payment application receives the payment request, pauses while the bank transfer is verified, and resumes once the deposit is confirmed. Overall, the user experience improves, as users can send money onchain without first acquiring crypto tokens.

Async transactions also make it possible to build applications that enforce compliance policies and operate in regulated contexts. Compliance workflows frequently require verification from external identity providers or regulatory services. Async execution allows applications to request verification data and automatically continue execution once the provider returns a result.

Conclusion

Rialo's native async execution functionality fills an important gap in blockchain design. It allows applications to interact with external systems while retaining the determinism and reliability of onchain execution. These interactions unfold asynchronously without relying on offchain actors such as keepers and relays, enabling developers to build sophisticated applications that rely on asynchronous execution patterns.

Check out the full async transactions tutorial on Rialo Learn to see how these workflows are implemented in practice. The tutorial walks through async execution step by step, compares Rialo's approach with other chains, and includes interactive demos illustrating different async execution models.