LayerZero Labs

Posted on Oct 05, 2023Read on Mirror.xyz

Stylus Now Live — One Chain, Many Languages

subscriber-edition://0x1eD3dbBBD5f6A020cb9dD73B3ab7F2Be91AEA3a7?tokenId=0

TL;DR: Today we released the code and public testnet for Arbitrum Stylus, allowing developers to use both traditional EVM tools and WASM-compatible languages like Rust, C, and C++ to build applications on Arbitrum Nitro chains. In addition, by improving computational, storage, and memory efficiency, Stylus dramatically lowers gas costs and enables new resource-intensive blockchain use cases like alternative signature schemes, larger generative art libraries, C++ based gaming, and compute-heavy AI models that were previously impractical. The open source SDK is available now, and there will be a Stylus Hackathon with **$20,000 **in bounties at ETHGlobal NY.

This announcement blog will provide the announcement highlights—learn more about Stylus on the new Arbitrum website, and check out Stylus: A Gentle Introduction for a deeper technical exploration.

Why We’re Stoked About Stylus

This time last year we took a massive leap forward with the launch of Arbitrum Nitro; today we’re taking another big leap with Stylus.

At the heart of Stylus is EVM+: bringing the best of both EVM and WASM worlds. Developers still get all of the benefits of the EVM, including the ecosystem and liquidity, while getting efficiency improvements and access to existing libraries in Rust, C, and C++. All without changing anything about how the EVM works. EVM equivalence is no longer the ceiling, it’s the floor.

Comparing EVM with EVM+

With the ability to expand Arbitrum development from about 20,000 Solidity developers to millions of developers using Rust and C, while retaining full interoperability and composability with traditional EVM contracts, enabling faster execution times, lower gas, new use cases — all on the most secure, most decentralized and widely used Ethereum L2 chain — we’re excited to collaborate with the community on what comes next.

And to help kickstart the innovation, Stylus R&D grants are available from the Arbitrum Foundation.

You’re going to hear a lot from us about Stylus in the coming months, so let’s go through some highlights….

What Is Being Announced?

The availability of the live testnet for Arbitrum Stylus, a new technical implementation that allows developers to build smart contracts in Rust, C, and C++, alongside previously offered EVM languages. We’ve also made the code publicly available on our Github repositories.

Start building with Stylus now, and we invite you to join the Stylus community on Discord and share your feedback and experiences.

Who is Stylus For?

Stylus is designed for both experienced Web 3 developers interested in using additional WASM-compatible languages such as Rust, C, and C++ with Arbitrum chains and for other developers who may be new to blockchain development.

Stylus is for Solidity developers who want cheaper compute and memory for their dApp.

Stylus is for blockchain developers familiar with Rust environments such as Solana and NEAR, who want the benefits of working in the EVM.

And if you’re looking to deploy industry-standard cryptography libraries for curves like secp256r1, Stylus is for you, too.

What Are the Key Features of Stylus?

  • Use Popular Programming Languages for native Ethereum Development: Utilize popular WASM-compatible languages like Rust, C, and C++ to build your application on Arbitrum’s large ecosystem, allowing you to combine popular Web 2 programming languages with the most widely used smart contract L2.

Declare contracts just like Solidity

  • One Chain, Many Languages: Stylus lets you use one chain, with multiple programming languages. Developers no longer have to choose a blockchain that supports their preferred programming language; it all happens on one.

Create nicely-typed methods

  • Fully Composable: Solidity contracts and WASM programs are completely interoperable. If working in Solidity, a developer can call a Rust program or rely on another dependency in a different language. If working in Rust, all Solidity functionalities are accessible out of the box

  • Faster Compute, Lower Costs: With Stylus, Rust, C, and C++, WASM compute operations run much faster than their Solidity equivalents. Computation is over 10x improved. Memory is over 100x improved.

  • Enables New Use Cases: Stylus’ computational speed, improved cost efficiency, and access to the mature WASM ecosystem open up new EVM use cases that were previously impractical. Cryptography libraries can now be deployed as custom precompiles, permissionlessly. RAM-intensive generative art libraries, bringing existing games written in C++ on chain, and compute-heavy AI models all become more accessible.

Enhanced scalability for new blockchain use cases

  • Safer by Design: WASM programs written using the Stylus Rust SDK are safer with opt-in reentrancy. Reentrancy is a common vulnerability that developers can only attempt to mitigate in Solidity. In Stylus, reentrancy is disabled by default unless intentionally overridden.

What Makes Stylus Unique?

  • Built for Arbitrum: Stylus allows you to develop in WASM while still retaining the maturity, security, and scalability of Arbitrum, the largest scaling solution for Ethereum.

  • Works with Arbitrum Orbit L3 Chains: For even greater customization, Stylus can be used with the Arbitrum Orbit development framework, allowing you to support popular WASM-compatible programming languages on your dedicated Orbit chain.

  • Largest Developer and Partner Community: By supporting Arbitrum chains, Stylus is positioned to leverage the support of the largest Ethereum L2 ecosystem of protocols, communities, and partners.

  • Out-of-the-gate Blockchain and Rust Tooling Support: Stylus lets you start building right away, with the initial testnet launch including support for a block explorer and a Rust CLI tool. Stylus also includes open source SDKs for Rust, C, and C++, which can be potentially extended to other languages, such as Move, Sway, Cairo, and Go, as well.

How Does Stylus Save Money & Time?

  • Cut Your Gas Bill: Compared to using Solidity, WASM programs are much more efficient, further reducing gas costs

  • Reduces Memory and Storage Fees: In addition to more efficient compute ops leading to lower gas costs, memory is also much cheaper in Stylus. Allocating megabytes of RAM costs 100–500x less than it would in Solidity. Stylus also can automatically use Rust’s borrow checker to safely reduce storage ops, further reducing costs.

  • Use Existing Libraries: Avoid having to re-write code that achieves the same functionality as libraries that have already been written. Deploy existing libraries in Rust, C, and C++ with minimal modifications

What’s Next?

  • **Trail of Bits Audit: **Trails of Bits will be auditing the Stylus source code to ensure the safety of the contracts, as well as the Stylus SDKs.

  • DAO Vote: Since Arbitrum One and Arbitrum Nova are DAO-governed, it will be up to the DAO to vote on upgrading to include Stylus support.

  • Join our AMA: On September 7, and check out our most recent Stylus talk on YouTube and bring us questions.

  • Win a Juicy Bounty at ETHGlobal NY: We’re going to be awarding $20,000 in bounties for Stylus at ETHGlobal NY September 22–24, so come join the fun and meet the Stylus team!