Pascal Barry
Pascal Barry
19 Apr 2022 · 4 min

Akord x RedStone – Improving Performance on Arweave

Akord x Redstone 1

This blog post is based on a Twitter Spaces AMA we held with RedStone. You can listen to the event here.

Context

The possibility for web3, particularly in the context of Arweave, is to take our data, application and business model completely onchain. While that’s very exciting, it presents a number of significant challenges across the developer and user experience.

At Akord, we aim to deliver a web2 user experience in the web3 paradigm. The work the RedStone team has been doing, creating the tools to improve performance, has been a great help for us in achieving this at the technical level.

RedStone’s work on Smart Weave contracts

Early on, RedStone identified certain weaknesses in SmartWeave contracts relating to performance and reliability. Specifically, every time you want the latest state of the contract you need to evaluate all the interactions on your side, which doesn’t scale when a contract has tens or hundreds of thousands of interactions and may even communicate with other contracts.

RedStone Contracts introduced a number of tools to address performance and developer experience: caching mechanisms, testing tools with a test net (including regression tests), a dedicated gateway for indexing and serving smart contracts, a smart contract explorer called SonAR, and a sequencer built in collaboration with Bundlr.

RedStone have put in a lot of effort to optimise the basic Execution Engine (the core part of the SDK), increasing the efficiency of contract evaluation thanks to extensive caching and memoization. As a result, a SmartWeave contract with over 300,000 interactions can be loaded in 2 minutes instead of several hours. And this is just the beginning, with further improvements planned for RedStone Contracts SDK and the tools around it.

RedStone itself utilises this smart contract platform for ensuring data integrity for its Oracles, which can deliver various types of data and export to any EVM compatible chain.

How Akord is moving faster with RedStone

Every action in Akord, for example, the creation of a vault, uploading of files, etc, is a user transaction that will be processed and validated through smart weave contracts.

Each vault in Akord will have its own contract instance living on the Arweave blockchain. And so each action within a vault will be a specific interaction with that contract.

This is why RedStone’s suite of tools has proved so valuable for Akord. The quicker we can process interactions with the contract at the protocol level, the better UX we can deliver through the Akord app, and any other apps that build on the Akord Vault Protocol in the future.

Specifically, we’re using RedStone’s dedicated gateway to improve performance and catch any corrupted transactions.

Another example, with context within the Akord product, is when we revoke a member from the vault. When this action is taken we need to redistribute the new encryption keys to the vault for the members who still have access while revoking the keys of the user who was removed. This requires various interactions with multiple contracts at the same time. With RedStone’s technology we can make one atomic transaction that covers all the necessary interactions at once.

We’ve also found the test net environment that RedStone have built for Arweave to be very valuable in our developer experience. And the sequencer has also proved very useful, for instance, in returning the state of an Akord vault in a very performant way.

Challenges on Arweave

Recently, we’ve had issues trying to get transactions to confirm on the network, which is in part due to the war in Ukraine. An unprecedented amount of data relating to the war is being uploaded, largely by bots. This historical preservation is an important process, and one which Arweave was designed for, but the consequence has been to stress the network.

We’ve designed Akord to be able to queue transactions until there’s availability, but it’s still not optimal. Especially as Akord sends multiple transactions linked in a sequence to one event.

For example, when we upload a file that’s one transaction, but there’s also another transaction for the metadata. Those transactions should go to the weave together, but if one is dropped that causes us problems on the backend. This is where the sequencer from RedStone is so powerful, as it ensures that we mine those transactions together.

To address some of these issues and help newcomers start with SmartWeave, the RedStone team recently launched their RedStone Academy to provide one shared point of knowledge for developers looking to create profit-sharing tokens (PSTs) on Arweave, as well as provide resources for writing SmartWeave contracts and methods for testing.

The academy already has a detailed step-by-step tutorial for writing a PST, with more resources planned for the future. Among those plans include tutorials and templates on WASM contracts, as well as real world examples of PST contracts making advanced interactions.

The RedStone implementation of WASM contracts is another resource we intend to be using at Akord. Its fully sand-boxed environment and gas metering makes it much safer than just working in Javascript or Typescript.

Overcoming growing pains

We believe to a certain extent the issues facing the Arweave ecosystem are the result of growing pains. Arweave has becomes the de facto storage layer for NFTs and now stores the blockchain history of many L1s like Solana. Events like the War in Ukraine, which present the perfect use case for Arweave at scale, are also turbo-charging usage.

This growth and the relatively early stage of the network has created some inevitable issues, something we see across almost all blockchain projects at some point in their early history.

That doesn’t mean we can just relax and assume everything will magically resolve itself. The Arweave team is an undeniable powerhouse, but every other team in the space should be thinking about how they can contribute. It’s only by partnering across projects in the ecosystem, pooling knowledge, and building shared tools and resources, that we can we come through the other side with truly solid foundations needed to scale to mass adoption.

RedStone’s work has been invaluable to Akord and the Arweave space at large, and we look forward to open sourcing the Akord Vault Protocol and evolving our own developer community to help others looking to build on Arweave.

If this inspired you to help building on Arweave or you have any questions, feel free to reach out to contact us or the RedStone team through the links below:

Contact RedStone
Oracle Website // Twitter // Discord