July 20, 2023

Arbitrum's Stylus: Empowering the Future of Web3 - Part 1

The Balance Ecosystem encompasses a wide range of innovative products and developments in various DeFi and Web3 technology areas.
Balance is poised to build bridges between the theoretical and practical sides of finance so that there is a means in which we can provide real-world solutions and create value driven products within the web3 space.

Balance Capital

In the ever-evolving world of blockchain technology, developers are constantly seeking ways to enhance the capabilities and performance of smart contracts. Arbitrum, with its EVM-equivalent rollup technology, has been at the forefront of providing secure and efficient Layer 2 solutions for Ethereum. 

Now, with the announcement of Stylus, Arbitrum is taking a significant leap forward by introducing a general-purpose programming environment and WebAssembly (WASM) virtual machine. In Part 1 of this article, we will explore the features and advantages of Stylus, and how it aims to revolutionize decentralized application development.

Beyond EVM Equivalence

Stylus breaks new ground by enabling users to deploy programs written in popular programming languages such as Rust, C, and C++ alongside existing Solidity dApps on the Arbitrum blockchain. This paradigm shift makes it easier for developers to transition to Web3 without the need to learn a new programming language. Whether they are experienced Web3 developers or newcomers to the space, Stylus offers a welcoming environment where they can build their projects using familiar tooling and coding preferences.

The seamless composability of contracts written in different languages is a hallmark of Stylus. A contract doesn't need to know what language another contract uses, ensuring smooth interoperability and user experience. This opens up exciting possibilities for cross-language collaboration and innovation within the blockchain ecosystem.

Faster Dapps, Lower Fees

In addition to expanding the programming languages available, Stylus brings significant performance improvements to Arbitrum dApps. With the Nitro upgrade last year, Arbitrum witnessed a 10x performance boost, and now, Stylus takes it even further. Applications written in languages like Rust enjoy an order-of-magnitude increase in speed compared to their Solidity and Vyper counterparts. These performance gains, coupled with the data-saving benefits of Arbitrum Nova, create an ideal environment for decentralized gaming, DeFi applications, DAOs, and other high-compute use-cases.

New Horizons: Creating Custom Precompiles

Stylus empowers developers to create their own precompiles, specialized smart contracts that efficiently perform specific tasks like computing hashes. This capability provides a wealth of possibilities, from novel pairing curves for zero-knowledge proofs to unique hashing algorithms for L1 bridges. The ability to deploy custom precompiles enhances flexibility and allows for more advanced cryptography and layer 3 solutions, as well as potential applications in machine learning.

Ethereum researchers will also benefit from Stylus, as they can design and iterate on EIP precompiles without setting up their own testnets. This accelerates development and fosters innovation within the Ethereum community.

How Stylus Works

Stylus builds upon the Nitro upgrade, which introduced WASM support for fraud proofs in Arbitrum. With Stylus, users compile their programs into WASM, which are then transformed on-chain into a format that enforces execution bounds and safety. Through WASM sandboxing, user programs can run at near-native speeds with the added security guarantees similar to those used by web browsers.

It's essential to note that Stylus does not replace the Ethereum Virtual Machine (EVM). Instead, it augments the EVM's functionality, resulting in an additive approach called EVM+. 

When a transaction involves an EVM contract, Geth executes and returns the result. If the EVM contract makes a subcall to a WASM program, Stylus comes into play and computes that part of the result. This integration ensures that everything remains compatible with the existing Ethereum ecosystem.

Stay tuned for Part 2 of this article, where we will delve deeper into the technical aspects and anticipated impact of Stylus, as well as its potential implications for the future of Web3.