Hello, Stylus

Offchain Labs
Offchain Labs
Published in
5 min readFeb 7, 2023

--

tl;dr: Today we’re announcing Stylus, our next-gen programming environment upgrade for Arbitrum One and Arbitrum Nova. Through the power of WebAssembly smart contracts, users will be able to deploy programs written in their favorite programming languages, including Rust, C, and C++, to run alongside EVM programs on Arbitrum. It’s over an order-of-magnitude faster, slashes fees, and is fully interoperable with the Ethereum Virtual Machine.

With its mainnet release in August of 2021, Arbitrum One became the only EVM-equivalent rollup with working fraud proofs. What users could do on L1, they could now do securely on L2, only faster and with lower fees. EVM equivalence is a necessity for any general-purpose rollup technology, and it empowers our vibrant ecosystem of dapps and protocols on Arbitrum One and Arbitrum Nova.

But EVM equivalence is not the final destination; it’s only the starting point. Arbitrum technologies will always remain EVM equivalent, but soon they’ll do so much more. We call this paradigm EVM+ and have begun building out this vision. Today we reveal the next phase in Arbitrum’s evolution: Stylus, our general purpose programming environment and WASM virtual machine.

Stylus: Beyond EVM Equivalence

Stylus will enable users to deploy programs written in popular programming languages to Arbitrum One and Arbitrum Nova. That’s right: Rust, C, C++, and more, side-by-side with existing Solidity dApps on the same Arbitrum blockchain.

A Rust program

From game development to social media, Stylus makes the transition to Web3 easier than ever. You won’t have to know Solidity to build on Arbitrum. Engineers can use the tooling they already know and love, regardless of their coding preferences.

Experienced Web3 developers will no longer have to choose between Ethereum and alt L1’s. Whether it’s a traditional Solidity DeFi application looking for a 1-to-1 experience with Ethereum, or a next-gen zk team verifying zero-knowledge proofs in Rust, Arbitrum can be your home.

That’s because programs written in different languages are seamlessly composable. A contract will never have to know what language another uses. Neither will users. Everything. Just. Works.

Faster Dapps, Lower Fees

Stylus doesn’t just expand the ways people can write decentralized programs; it also makes them faster. With last year’s Nitro upgrade we saw a 10x performance boost. With Stylus, we’re proud to announce that we’ve done it again.

Arbitrum dapps written in languages like Rust are over an order of magnitude faster than their Solidity and Vyper counterparts. Stylus slashes fees, enabling a new era of high-compute blockchain applications in a wide range of fields.

When paired with the data-saving costs of Arbitrum Nova, decentralized gaming has never been more viable. DeFi, DAOs, and other crypto use-cases will enjoy similar efficiencies on Arbitrum One as Stylus is fully integrated into both chains.

New Horizons

With cheap computation comes the freedom to write powerful programs, which is why the Ethereum community is always working to speed up the EVM. This includes occasionally adding special smart contracts, known as precompiles, that efficiently do specific tasks like computing hashes. With Stylus, users will be able to create their own precompiles.

A C precompile

If a zk team needs a novel pairing curve, or an alt-L1 bridge needs an unusual hashing algorithm, they can simply deploy their cryptography libraries as custom precompiles. Any cryptosystem, any reference implementation, as if it were the EVM’s native SHA2. Layer 3s and even machine learning applications have never felt closer.

This will be of particular value to Ethereum researchers, who will be able to use Stylus to design and iterate on EIP precompiles without having to set up their own testnets. We believe in the EVM and are excited to see Arbitrum play a pivotal role in its development. Many of our breakthroughs align with eWASM too, an L1 initiative to add WASM to the EVM that we’re excited to help make possible.

How It Works

Last August, the Nitro Upgrade changed L2 forever. Arbitrum validators began running Geth, Ethereum’s most popular execution client, and proving fraud in WebAssembly. For the first time ever L2 could run at native speeds, switching to slower WASM proving only occasionally when it’s time to defeat would-be attackers. We saw this happen in the wild after the Merge.

Stylus is the natural next step. With Nitro, our fraud proofs can enforce trusted WASMs. Validators have to agree that Geth is an honest program and that it behaves appropriately. Although this is a sufficient foundation for a permissionless EVM network, and something Ethereum and all geth-based L2s are doing right now, achieving scale requires making the next leap: proving fraud over untrusted WASMs.

In the Stylus model, users compile their programs into WASM, which are then transformed on-chain into a format where execution is bounded and safety is enforced. Through WASM sandboxing, we can run user programs at near-native speeds with the same security guarantees web browsers rely on to render web pages. Malicious programs are terminated in a way we can prove on chain without ever having to invoke the EVM.

The EVM is still there though and acts exactly as before. When a transaction calls out to an EVM contract, Geth executes and returns a result. If that EVM contract happens to make a subcall to a WASM program, then Stylus kicks in and computes that part of the result. Stylus doesn’t replace the EVM; it augments it. Everything we are doing is entirely additive, which is why we call it EVM+.

Wen Stylus

Stylus will go live in 2023, but until it does, we’ll be sharing updates along the way. There are some other major developments we’ll be announcing soon, so join us on Twitter and Discord for more!

Want to be among the first to try Stylus when we upgrade our testnet? Sign up here!

--

--

Offchain Labs
Offchain Labs

We’re Building Arbitrum, a scaling solution for Ethereum. Learn more at https://offchainlabs.com/ and http://arbitrum.io/.