Avail Ecosystem Series: Building on the OP Stack

With Avail quickly approaching mainnet, this series explores potential integrations between Avail and leading scaling solutions to show how developers could integrate with Avail, leveraging its secure, decentralized and low-cost data availability blockchain.

Avail Ecosystem Series: Building on the OP Stack

TL;DR

  • Avail is extending the capabilities of the OP Stack.
  • OP stack developers could reduce their data availability costs by ~90% with Avail.
  • L2s built with the OP Stack can leverage Avail for secure, low-cost and decentralized data availability.
  • Avail is on the road to mainnet and recently announced an incentivized testnet.
  • See the Avail Ecosystem Series for more.

OP Stack with Avail

The OP stack has become a popular choice for communities and companies looking to build their own L2 rollups. It’s used by OP Mainnet and is maintained by the Optimism Collective. It’s also a stack which developers have begun to extend and modify. One such modification is using a purpose-built data availability layer like Avail. In this post, we discuss how you could use the OP Stack with Avail as your data availability provider and significantly reduce your Ethereum transaction fees. 

How does the OP Stack Manage Data Availability today?

The default DA layer supported by the OP stack is Ethereum. L2 transactions get submitted to the sequencer which is responsible for ordering transactions and creating L2 blocks. Batches of transactions are sent by the sequencer to Ethereum which submits transaction data as calldata.

The advantage of using Ethereum as a DA layer, is that developers using the OP stack can inherit Ethereum’s security guarantees. Anyone can access the L2s transaction data posted on Ethereum and use it to derive the correct chain state of the L2. 

This benefit however comes with a significant cost. Ethereum was not meant to be used as a DA solution and is not optimized for this use case. While work is being done to improve this, at the time of writing up to 90% of the costs paid by L2s to Ethereum is for managing data availability. High volume use cases processing a lot of transaction data, can bring these costs down significantly by using a purpose built data availability solution like Avail.

How does Avail work with the OP Stack?

The Avail team built the Avail OP Stack which is a modified version of the OP Stack that sends transaction data to Avail instead of Ethereum, lowering transaction fees by up to 90%. 

Transactions are submitted to the sequencer node in the Avail OP Stack. The op-batcher then submits a transaction batch to a module called op-avail that has been added to submit data to Avail. 

The transaction data is then added to the Avail blockchain and a transaction reference is returned to op-avail which is passed to the op-batcher and submitted to Ethereum as calldata. The transaction reference posted on Ethereum contains the Avail block hash, sender’s address and nonce of the extrinsic. 

Chains built with the Avail OP Stack inherit the security guarantees of Avail’s nominated proof-of-stake blockchain network. Avail’s blockchain was built using the Polkadot SDK to reduce the risk of validator centralization, and is working towards supporting 1,000 external validators. Data published on Avail’s blocks is validated by the Avail network, but not executed. L2s could use the OP Stack with Avail and pay a fraction of the cost of today’s implementations, which post transaction data to Ethereum. 

To get a more detailed view of how the Avail OP Stack works for both the sequencer and verifier nodes, you can see a more detailed drawing in the Avail OP Stack repo.

Future Improvements

Optimism’s fault proof system, used to verify transaction correctness on Ethereum, is still under development at the time of writing. The OP Stack sequencer also remains centralized with plans for it to be decentralized. As these improvements are shipped by the Optimism Collective, the Avail OP Stack will be updated to incorporate these changes.

Some improvements to the Avail OP Stack are already known and will be getting implemented soon. The Avail dataroot will be posted to Ethereum via the Vector data attestation bridge. The dataroot is the root of the Merkle tree whose leaves are the data blobs submitted to Avail. This would enable the sequencer and other L2 nodes to verify on Ethereum that Avail’s validators have reached consensus on the data’s availability.

Once the OP Stack has implemented working fault proofs, a DA inclusion proof can be sent along with the batch hash from Avail and used in the OP Stack’s fault proof interactive dispute game

The Optimism Collective has also announced plans for an interoperable network of L2 chains built with the OP Stack called Superchains. All these future improvements are still under development and will be implemented into the Avail OP stack as and when possible.

Start Experimenting with the Avail OP Stack today

Check out this getting started guide in the Avail OP Stack repo to begin experimenting today. If you have any questions or recommendations on how we can improve this construct, get in touch with the team on the Avail Forum or Discord

Avail is on the road to mainnet and has recently announced the release of an incentivized testnet. To learn more about Avail check out the Avail Documentation and follow us on X.

The OP Stack is one of many blockchain’s that can leverage Avail’s secure, general purpose DA layer. To learn more about integrating Avail with other leading L2s and blockchain ecosystems, take a look at the Avail Ecosystem Series and subscribe to our newsletter.

About Avail: Avail began as a project inside Polygon in 2020 and became a separate entity in 2023. The team is led by Polygon’s co-founder Anurag Arjun and former Polygon research lead Prabal Banerjee, and is set up to provide an industry leading data availability solution.