Arbitrum Stylus could cut costs 100x with two virtual machines

Offchain Labs reveals testnet for Arbitrum Stylus, enabling multi-language coding for smart contract developers

article-image

Sergey Nivens/Shutterstock modified by Blockworks

share

Offchain Labs, the team behind Ethereum layer-2 scaling network Arbitrum, has launched the testnet for Arbitrum Stylus, a new programming environment that enables developers to write smart contracts in Rust, C, and C++.

The primary coding language for Ethereum smart contracts today is Solidity. 

With Arbitrum Stylus, developers can now use familiar programming languages to build on Arbitrum, Rachel Bousfield, tech lead at Offchain Labs, told Blockworks.

“If someone out there is working in Rust, or C or C++, instead of having to learn a new programming language like Solidity or Vyper, they can just use technologies they are already familiar with and write their applications and make their products in those,” Bousfield said.

If the Arbitrum DAO chooses to adopt Stylus, the tool will be available for developers on Arbitrum One, Arbitrum Nova and Arbitrum Orbit. A date for a vote has not been set, and indications are that the plan is to gather testnet feedback before submitting a proposal. 

According to a Statista report, which surveyed 87,585 software developers, only 1.33% of respondents said they used Solidity. By comparison, 19.34% and 22.42% of respondents used C and C++, respectively, and 13.05% used Rust.  

The Stylus’ developer-friendly technology is enabled through Arbitrum Nitro, a significant tech stack upgrade to Arbitrum One that occurred in 2022. 

All fraud proofs on Arbitrum Nitro currently use the third-party open sourced software WebAssembly (Wasm), which can prove the incorrectness of arbitrary programs, Bousfield said. Wasm is today supported by nearly all web browsers, as well as programming languages, that underpin the internet. 

“What we’ve done is made it such that arbitrary programs that are untrusted can now be proven as well,” she said. “So, using that same Wasm fraud prover, with some minor modifications that don’t change the actual trust or safety of Arbitrum, we’re able to add new kinds of Wasms which include people writing their programs in Rust, C or C++.”

Interoperable coding languages

To ensure optimal performance, coding languages on Stylus will be completely interoperable, Bousfield said. 

To accomplish that, different coding languages will work in tandem. For example, if a developer is programming in Rust, they are able to import a Solidity interface or vice versa.

This is possible because Solidity contracts have a way to call each other. 

“Since everything expects to be called and call each other in the same way, it doesn’t matter what the implementation details are of the contract you’re interfacing with,” Bousfield said. 

Existing Solidity DEXes will be able to list — without any modifications — ERC-20 tokens written in Rust, for example, and those programs may call out to C programs to do cryptography.

“We don’t have to go to all these different DEXs and say, ‘Please update your code so they can have Rust tokens, the Rust tokens’ — from their perspective —  just looks like Solidity tokens, so the DEXs won’t know the difference,” Bousfield said.

Slashing fees

Beyond lowering barriers of entry, Stylus will also reduce fees. 

“For the same amount of cost it takes to do an ADD instruction in Solidity, you can execute 150 ADD instructions in Stylus,” Bousfield said. “For compute intensive work, Stylus probably cuts costs somewhere between 10, 50 or 100x, just depends very greatly on what you’re doing.”

This is because, rather than having one virtual machine, Stylus will have two virtual machines. One will be the unmodified Ethereum Virtual Machine for developers who write using a Solidity contract, then a separate Wasm virtual machine.

Source: Offchain Labs

Wasm is a standard for many companies like Google, Apple or Microsoft. 

“Web browsers use [Wasm] to generate pages. It needs to be fast, and due to all the industry support, the runtimes that actually perform Wasm execution are just way faster than that of the Ethereum virtual machine,” Bousfield said.

Another reason why Stylus will be cheaper: Developers will be able to use standard tooling for C, C++ and Rust, which produce better bytecodes than Solidity.

“They use techniques like LLVM, which have been worked on for over 50 years, there’s decades of work that has been put into making C, and now you get to inherit all of that research, development and optimizations in your code,”  Bousfield said. 

Next steps

Audits for Arbitrum Stylus testnet is underway, and the team at Offchain Labs is looking to hear back from community members following its testnet launch.

The team is also looking to add more programming languages to Stylus, and further finding ways to reduce fees.

“It’s a constant race to improving the performance of layer-2, and this is just one step in that,” Bousfield said.

Updated Aug 31, 2023 at 9:45 am ET: Added additional context.


Start your day with top crypto insights from David Canellis and Katherine Ross. Subscribe to the Empire newsletter.

Explore the growing intersection between crypto, macroeconomics, policy and finance with Ben Strack, Casey Wagner and Felix Jauvin. Subscribe to the On the Margin newsletter.

The Lightspeed newsletter is all things Solana, in your inbox, every day. Subscribe to daily Solana news from Jack Kubinec and Jeff Albus.

Tags

Upcoming Events

Salt Lake City, UT

MON - TUES, OCT. 7 - 8, 2024

Blockworks and Bankless in collaboration with buidlbox are excited to announce the second installment of the Permissionless Hackathon – taking place October 7-8 in Salt Lake City, Utah. We’ve partnered with buidlbox to bring together the brightest minds in crypto for […]

Salt Lake City, UT

WED - FRI, OCTOBER 9 - 11, 2024

Pack your bags, anon — we’re heading west! Join us in the beautiful Salt Lake City for the third installment of Permissionless. Come for the alpha, stay for the fresh air. Permissionless III promises unforgettable panels, killer networking opportunities, and mountains […]

recent research

AERODROME TEMPLATE.png

Research

Aerodrome is a "MetaDEX" that combines elements of various DEX primitives such as Uniswap V2 and V3, Curve, Convex, and Votium. Since its launch on Base, it has become the largest protocol by TVL with more than $495B in value locked, doubling Uniswap's Base deployment.

article-image

Securitize CEO Carlos Domingo thinks BUIDL will potentially hit its next $500 million milestone in just a few months

article-image

Representatives on Thursday opted to back President Biden and uphold his veto of the legislation that sought to invalidate SAB 121

article-image

The former Valkyrie CEO chats with Blockworks about what she has her eye on as Cypherpunk Holdings’ new leader

article-image

Thursday’s CPI report shows prices are coming down more quickly than analysts had anticipated, renewing hope that central bankers will cut rates in the fall

article-image

If we tokenize all assets in a speculative rush, the risk of creating illiquid markets and trapped value will manifest on a large scale

article-image

Plus, Trump is headed to the heart of Bitcoinlandia with a speaking appearance at the Bitcoin 2024 conference