The Orchestration API is designed to make it easy for developers to build and manage intricate workflows for users by leveraging Agoric long lived smart contracts–the missing ingredient to addressing key blockchain UX challenges. Web 3 users and developers alike demand fluidity and simplicity, especially when interacting across multiple chains. The surge of support for chain abstraction clearly supports this observation. People want seamless, efficient experiences; they don’t want to get bogged down by all the intricacies under the hood. But Web3 isn’t there yet. Web3 still requires a layer (or more!) of abstraction before it can deliver an optimal user experience.
What’s going on under the hood is both the innovation and the problem. What may seem to the user like a single, straightforward transaction often involves a series of asynchronous processes working together in carefully choreographed harmony, all in order to provide the semblance of efficiency that users (and developers) have come to expect from modern consumer software. This is where Agoric’s long lived contracts and Orchestration API come in.
The Growing Complexity of Web3
Web3 principles emphasize transparency, giving users the power to see every transaction and smart contract interaction. However, as the ecosystem continues to expand—with multiple chains, Layer 2 solutions (L2s), rollups, and appchains—the complexity for both users and developers has grown exponentially. Most users can no longer manage every moving part without becoming overwhelmed, and developers are left grappling with how to provide smooth, user-friendly experiences due to the underlying complexity.
Here’s a common example: if a user wants to move an asset from one chain to another, they often need to manually navigate multiple wallets, applications, and transaction processes. This cumbersome experience leaves both users and developers searching for a solution that maintains transparency without sacrificing simplicity. The answer lies in asynchronous workflows: by abstracting away the convoluted processes under the surface, developers can deliver streamlined, intuitive experiences while preserving the transparency Web3 is known for. This benefit is exactly what Agoric’s Orchestration API enables: simplifying the management of complex multi-chain operations, and thus allowing developers to coordinate cross-chain workflows effortlessly.
The Limitations of Single-Block Smart Contracts
Most blockchain platforms rely on synchronous execution models, where smart contracts run and complete within a single block. This model works well for simple transactions, such as transferring tokens or interacting with a contract on one chain. However, in a multi-chain environment, this synchronous model quickly exposes its limitations.
For instance, when a user holds assets on several chains or interacts with applications across different ecosystems, operations span beyond a single block’s execution time. Let’s say you need to transfer assets from Ethereum to Cosmos. The process requires multiple blocks: one to send the transaction on Ethereum and another to receive it on Cosmos. These inherently asynchronous actions require coordination across multiple chains.
This scenario is where Agoric’s Orchestration API shines, by abstracting away the complexities of these asynchronous steps. The API allows developers to build cross-chain applications with seamless user experiences without getting bogged down in the technical details.
Asynchronous Superpowers: Agoric Smart Contracts in Action
Agoric’s Orchestration API enables developers to manage complex asynchronous cross-chain workflows with ease, streamlining interactions between blockchains in the Cosmos ecosystem. Key tasks like creating accounts on remote chains or querying balances become straightforward API calls in the place of cumbersome manual processes.
Let’s take a closer look at some of the operations that give Agoric long-lived contracts their unique properties:
Retrieving a Remote Chain Object:
const chain = await orch.getChain(chainName);
The
orch.getChain(chainName)
function is the entry point. It retrieves the object representing a remote chain, enabling asynchronous communication between the Agoric platform and another blockchain (such as Osmosis or Cosmos Hub).Programmatic Creation of an Interchain Account (ICA):
const remoteAccount = await chain.makeAccount();
This function, which is unique to Agoric, creates an Interchain Account (ICA) on the remote chain programmatically. ICAs allow a smart contract on one chain to control an account on another, automating a process that traditionally required manual command-line interface (CLI) commands. This feature drastically reduces developer complexity.
IBC Transfer to a Remote ICA
await localAccount.transfer({ denom: 'ubld', value: amt.value }, remoteAccount.getAddress());
This operation initiates an IBC (Inter-Blockchain Communication) transfer to a remote ICA, allowing the contract to asynchronously send assets across chains. This aspect of the API abstracts away the technical steps, freeing developers to focus on higher-level application logic.
Fetching Remote Chain Balances
const remoteChainBalance = await remoteAccount.getBalance('uosmo');
After transferring assets, querying the balance on the remote chain is another asynchronous interaction made simple. This functionality enables cross-chain state verification with minimal effort.
Automating Myriad Steps with the Orchestration API
Without the Agoric Orchestration API, handling these kinds of cross-chain operations would require developers to manually coordinate every step—tracking transactions, managing failures, handling retries, and verifying states across multiple chains. Such manual processes introduce significant complexity and friction.
Agoric’s Orchestration API simplifies all of this activity by treating multi-chain interactions as if they were single, straightforward transactions. By abstracting asynchronous workflows, the API enables developers to offer sophisticated functionality, such as:
Transferring assets across chains: e.g., moving USDC from Ethereum to Osmosis.
Cross-chain asset swaps: e.g., swapping USDC for TIA on Osmosis, then sending TIA to Celestia for staking.
Managing cross-chain staking: Automating processes like unbonding, liquid staking, and reward withdrawals across multiple blockchains.
Each of these operations involves multiple asynchronous steps across different chains and blocks. The beauty of the Orchestration API is how it abstracts away these complexities, allowing developers to focus on delivering an optimal user experience.
Long Live and Prosper!
As Web3 continues to evolve and further embraces multiple blockchains, L2s, and rollups, additional complexity is inevitable. However, Agoric’s Orchestration API turns this complexity into an advantage by providing a powerful abstraction layer that handles asynchronous workflows across chains. While blockchains remain transparent at their core, the nuts and bolts of cross-chain coordination is tucked away under the hood, enabling developers to build the next generation of decentralized applications with ease. The result? Smooth, multi-chain experiences for users, and simplified development processes for teams.
By leveraging Agoric’s Orchestration API, developers can confidently step into the future of blockchain, where the boundaries between chains blur, and the focus shifts back to what truly matters—building applications that redefine user experiences.
Getting Started with the API
Getting started with the Orchestration API is straightforward and involves three main steps:
Master the key concepts that give Orchestration its super powers!
Play with the Orchestration Basics Dapp to see how orchestration can improve cross-chain functionality and enhance the user experience.
Fork the Dapp to customize the code, giving you the freedom to experiment and tailor the orchestration features to your specific needs.
Trying out the API? Join the conversation on Discord to share your experience!