Unraveling Stylus (EVM+): Arbitrum's New Launch

6 min read

Learn about Stylus from Arbitrum, a powerful runtime environment and an upgrade to EVM.

One of the key takeaways from EthCC 2023 was that the emphasis in the Ethereum community has shifted from "refining the infrastructure" to building the dApps and tools that will drive adoption for end users. The event allowed thousands of Ethereum developers and enthusiasts to come together for a packed schedule of talks and practical sessions.

Arbitrum hosted its own side-event and showcased its forthcoming Stylus programming environment.

Arbitrum's Stylus programming environment is their way of empowering developers by letting them write dApps on more than just EVM and EVM-based languages such as Solidity.

But what exactly is Stylus, and why should Ethereum developers adopt it? Let’s find out from this blog post.

Going beyond the EVM#

When Arbitrum One launched two years ago, it was the first EVM-equivalent rollup that offered working fraud proofs. EVM equivalence meant developers could use the power of the Ethereum Virtual Machine to offer dApps on Arbitrum while giving users the convenience of faster transactions and lower fees.

The issue with the EVM is that there are only a few languages that compile to EVM bytecode. The language of choice is Solidity. While there are others, such as Vyper and Flint, the options are limited. There's a huge pool of developers out there that find it difficult to write dApps because they can't easily code in their language of choice, and they find coding for the base layer challenging due to the constraints of coding in an environment where gas fees are high.

In theory, the EVM is Turing complete. However, gas fees put a practical limit on the complexity of code that can run on the EVM, to the extent that many consider it to be "quasi-Turing-complete".

Layer 2 solutions offer lower gas fees and faster transaction times. Other projects, such as Optimism offer similar benefits and are eager to attract developers by offering easy ways to start building on their platform.

Arbitrum is far from the only Layer 2 on Ethereum. It is aiming to differentiate itself from the competition with Stylus. It’s not only beneficial regarding gas fees, but also provides freedom and flexibility to developers regarding their smart contract language of choice.

What Is Stylus?#

Arbitrum describes Stylus as "EVM+". It's a new programming environment for Arbitrum that allows developers to deploy code written in Rust, C, or C++ to Arbitrum Layer 2. It's based on WebAssembly (WASM) and opens up Layer 2 to a huge number of developers from other parts of the cryptocurrency world and from more traditional programming backgrounds, making it much easier for them to develop applications.

Not only that, but the developers also have the flexibility to use multiple programming languages when creating a single smart contract. They can segment a contract into several parts and choose different languages for each part based on their convenience.

Developers can now transition to Web3 without having to take the time to learn a new programming language. Stylus also makes it easy for developers to work together without having to agree on a language. Contracts are seamlessly composable, being able to interact with each other without having to care what language they were originally written in.

Why Choose Stylus#

For developers who're already fluent in Solidity, it's easy to make the mistake of thinking of Stylus as just "a Rust compiler for the EVM". There's far more to it than this, however. Stylus offers:

  • Support for robust, popular programming languages
  • A way to bring more developers to Web3/DeFi
  • Faster dApps thanks to Arbitrum's Nitro Upgrade
  • Lower gas fees than the base layer
  • Custom precompiles (opening up the potential for Layer 3 solutions and even higher performance)
  • Ability to switch between different languages within a smart contract

Adding to the EVM, Not Replacing It#

Stylus brings additional features for executing smart contracts, but it doesn't replace the EVM. If a transaction involves an EVM contract, Geth (Go Ethereum) will execute it and return the result. Geth is one of the original Ethereum clients that handles transactions and smart contract execution.

Any parts of an EVM contract that make a subcall to a WASM program will be handled by Stylus. This ensures Arbitrum remains fully compatible with the wider Ethereum ecosystem while still bringing performance improvements and flexibility to those who wish to take advantage of Stylus. It's this approach that's earned it the nickname EVM+.

Nitro allows many portions of the code in dApps to run at near-native speeds, thanks to WASM, and it does so while maintaining security. WASM sandboxing uses the same security systems that browsers use to safely render web pages. If a program is found to be malicious, it can be terminated in a way that's provable on-chain without having to invoke the EVM.

Create Your Own Precompiles#

A precompile is a specialized, predefined smart contract that is built into EVM to perform complex tasks. They have been in use since the start ofEthereum, but Stylus offers even more flexibility and convenience using precompiles.

With Stylus, developers can make their own precompiles for important tasks such as hashing algorithms or zero-knowledge proofs. Not only are these precompiles useful for Web3 developers, but they're also useful for those who are trying to innovate within the Ethereum ecosystem. Stylus makes it possible for researchers to iterate on existing EIP precompiles without having to set up their own testnet.

While Arbitrum is a Layer 2 solution, they're passionate about seeing improvements in L1. A lot of the work they've done on precompiles is in alignment with eWASM, an initiative to bring WASM to the EVM. When everyone is working together and pooling their knowledge, the whole cryptocurrency ecosystem wins.

Get Started With Stylus#

The Arbitrum Foundation is inviting developers to apply to get started with Stylus on Testnet. The environment is still in development, but it's already mature enough that the Arbitrum Foundation has been able to write a complete, working fraud prover for Stylus. The team is now focusing on adding more language support and improving the tools.

The news about Stylus was just one of the fascinating things to come from EthCC. It's an exciting time to be a developer in the Web3 space. Be sure to check out other innovative project announcements such as Chainlink’s CCIP launch, the Appchain launch from Starknet, and Vitalik’s speech on Account Abstraction (AA) and how it can attract more users to Web3.

We understood that Stylus is not a replacement but an upgrade to the EVM. Users can always rely on Stylus to create their projects, as the whole thing is built on the secure Ethereum layer.

At Neptune Mutual, DeFi protocols can secure their projects and protect their community from threats in the DeFi space. We help projects create cover pools in our cover marketplace for their users to purchase cover and receive payouts in case incidents occur. We have our marketplace on the chains EthereumArbitrum, and BNB Smart Chain.

By

Tags