What Arbitrum Stylus actually is

Arbitrum Stylus is an execution layer that runs WebAssembly (WASM) code alongside the existing EVM. It does not replace the EVM; instead, it sits next to it, allowing developers to write smart contracts in languages like Rust, C, and C++. This dual-execution model is the foundation of the Stylus architecture, preserving the security and compatibility of Ethereum while expanding the toolkit available to builders.

For Rust developers, this is a significant shift. Previously, blockchain development was largely confined to Solidity or Vyper. Stylus allows you to compile high-performance code into WASM and deploy it directly to Arbitrum. The WASM module runs in a sandboxed environment, isolated from the EVM but interacting with it through established interfaces. This means you can leverage Rust’s safety features, concurrency models, and extensive ecosystem of crates without sacrificing the ability to interact with the broader Ethereum infrastructure.

The technical foundation relies on the fact that WASM is a binary instruction format for a stack-based virtual machine. Arbitrum’s sequencer and validators execute these WASM modules in parallel with EVM precompiles. This parallelism is what delivers the substantial performance gains often cited by early adopters. You get the speed of a native execution environment with the trust assumptions of the underlying L2.

This approach avoids the "build it from scratch" trap of many new L1s. Instead of forcing developers to learn a new VM specification from the ground up, Stylus leverages the maturity of the EVM for state management and compatibility, while offloading heavy computation to the more efficient WASM runtime. It’s a pragmatic layering that respects the existing ecosystem while pushing the boundaries of what’s possible on-chain.

Side-by-side: Stylus vs EVM smart contracts

Comparing Arbitrum Stylus with traditional EVM smart contracts reveals distinct architectural differences that influence developer choice. While EVM contracts rely on Solidity or Yul compiled to EVM bytecode, Arbitrum Stylus allows developers to write contracts in Rust or C++ that compile to WebAssembly (WASM). This fundamental shift changes how code is executed, optimized, and integrated into the broader Ethereum ecosystem.

The table below outlines the primary technical distinctions between the two approaches across language support, compilation targets, and gas mechanics.

FeatureEVM (Solidity/Yul)Arbitrum Stylus
Primary LanguageSolidity, YulRust, C, C++
Compilation TargetEVM BytecodeWebAssembly (WASM)
Execution EnvironmentEVM InterpreterWASM Virtual Machine
Gas ModelStandard EVM GasOptimized WASM Gas
Ecosystem CompatibilityFull Ethereum EVMABI-compatible with EVM

Language choice is the most immediate differentiator. Solidity has a steep learning curve for developers coming from general-purpose languages, whereas Rust offers memory safety and performance benefits that appeal to systems programmers. Stylus compiles to WASM, which runs in a sandboxed environment on Arbitrum. This allows for more complex logic and faster execution times compared to the linear instruction set of the EVM.

Despite these differences, Arbitrum Stylus maintains full ABI compatibility with existing EVM contracts. This means that frontend applications and other smart contracts interacting with Stylus contracts do not need to be rewritten. The primary keyword anchor, Arbitrum Stylus, ensures that while the underlying technology shifts to WASM, the integration layer remains consistent with the Ethereum standard, reducing friction for adoption.

Performance gains and gas efficiency

Arbitrum Stylus shifts the execution model away from the EVM's stack-based architecture toward a WebAssembly (Wasm) environment. This architectural change allows Rust, C, and C++ code to run significantly faster than traditional Solidity bytecode. For CPU-intensive logic, such as complex mathematical operations or heavy data processing, Stylus reduces execution time from minutes to seconds.

The gas efficiency gains are most pronounced in specific use cases. In the EVM, every operation requires explicit gas accounting for memory access and stack manipulation, which becomes expensive for complex algorithms. Stylus leverages the native efficiency of Wasm and the host machine's CPU, bypassing much of this overhead. This means developers can deploy logic that would be prohibitively expensive on pure EVM chains at a fraction of the cost.

Consider a DeFi protocol requiring real-time price aggregation from multiple sources. On EVM, this might involve multiple storage writes and complex loops, draining gas reserves. With Stylus, the same logic runs in a single, optimized Wasm execution context. The gas savings aren't just linear; they are structural, allowing for more sophisticated on-chain computations without breaking the bank.

However, the tradeoff lies in complexity. While Stylus offers raw performance, it requires a different development mindset than Solidity. Developers must manage memory manually in Rust or C++, which increases the risk of bugs if not handled carefully. The EVM's simplicity remains its strength for straightforward transactions. Stylus shines when the problem space demands computational heavy lifting that the EVM simply cannot handle efficiently.

FeatureEVM (Solidity)Stylus (Rust/C++)
Execution ModelStack-based, interpretedWasm, native CPU execution
Best ForSimple transactions, token transfersComplex math, data processing
Gas CostHigh for complex logicSignificantly lower for CPU-heavy tasks
DevelopmentHigh-level, memory safeLower-level, manual memory management

Arbitrum Stylus inherits the same fraud proof security model

Arbitrum Stylus is secured by the same fraud proof mechanism as native EVM contracts. This design choice means that non-Solidity code does not introduce new attack vectors or trust assumptions. When a transaction is proposed, the entire state transition—whether it involves a Rust smart contract, a C++ binary, or a Solidity contract—is subject to the same cryptographic challenge window.

The security of Stylus relies on Arbitrum’s interactive fraud proof system. As noted by OffchainLabs, the core innovation is a prover capable of executing these classic fraud proofs over WebAssembly (WASM) code [[src-serp-6]]. If a validator submits an incorrect state root, anyone can challenge it. The system then runs a step-by-step verification of the WASM execution on-chain. If the execution is found to be invalid, the malicious validator is penalized, and the correct state is restored.

This means Stylus contracts benefit from the same economic security guarantees as Ethereum L1. You do not need to worry about a "weaker" security model because the code is written in Rust instead of Solidity. The underlying logic of how the state is computed changes, but the method of verifying that computation remains identical to the EVM. For developers, this is a critical distinction: you get the performance and language flexibility of systems programming without sacrificing the decentralized security of the Arbitrum L2.

While the execution engine differs, the verification layer is unchanged. This uniformity simplifies the security audit process. Auditors familiar with Arbitrum’s fraud proof infrastructure can apply their existing knowledge to Stylus contracts. The focus shifts from verifying the consensus mechanism to verifying the logic within the WASM binaries themselves, leveraging tools like OpenZeppelin’s Motsu for testing [[src-serp-5]].

Fraud proofs work the same way for WASM as for EVM

It is helpful to think of the fraud proof system as a universal translator. Whether the input is EVM bytecode or WASM, the Arbitrum sequencer produces a state root. The fraud proof engine does not care about the source language; it only cares that the output is correct. If a challenger disputes the root, the system replays the transaction.

During this replay, the WASM interpreter runs the Stylus contract logic step-by-step. Because WASM is a standard, sandboxed environment, the execution is deterministic and verifiable. This determinism is what allows Arbitrum to prove correctness without re-executing the entire Ethereum mainnet logic for every single transaction. The fraud proof is a mathematical proof that the WASM execution led to the claimed state root.

This model ensures that Stylus contracts are not "permissioned" or "centralized" in their security. They are fully decentralized and trustless, just like any other contract on Arbitrum. The only difference is that the verification cost is slightly higher for complex WASM logic than for simple EVM opcodes, but this cost is amortized across the entire transaction batch, keeping fees low for users.

For Rust developers, this means you can deploy with confidence. The security assumptions you make when writing in Rust—memory safety, absence of race conditions—translate directly into the correctness of the state root. If your code is correct, the fraud proof will pass. If it is not, it will be caught. This alignment of developer responsibility with network security is a key advantage of the Stylus architecture.

When to choose Stylus over Solidity

Arbitrum Stylus introduces a significant shift by allowing developers to write smart contracts in Rust, C, and C++, in addition to the traditional Solidity. This flexibility means you are no longer locked into the EVM stack for every use case. The decision to adopt Stylus should depend on whether your project demands high-performance computation or specialized logic that the EVM struggles to handle efficiently.

Choose Solidity for Broad Compatibility

Stick with Solidity if your priority is maximum interoperability and access to the vast existing ecosystem. Solidity contracts benefit from mature tooling, extensive library support via OpenZeppelin, and seamless integration with the majority of decentralized applications and wallets. If your logic is standard DeFi or NFT functionality, the EVM’s established infrastructure reduces development friction and deployment risk. Arbitrum fully supports Solidity, ensuring your contracts remain compatible with the broader Ethereum ecosystem while benefiting from L2 speed.

Choose Stylus for Performance-Critical Logic

Switch to Stylus when your project requires complex calculations, heavy data processing, or integration with existing Rust codebases. Writing in Rust allows you to leverage its performance benefits and memory safety without the gas overhead associated with EVM opcode execution. This is particularly valuable for applications involving game logic, advanced cryptographic proofs, or high-frequency trading strategies where computational efficiency directly impacts user experience and cost. The Stylus SDK enables these high-performance contracts while maintaining full compatibility with Arbitrum’s security model.

Frequently asked questions about Stylus