What makes Stylus different

Arbitrum Stylus is a parallel execution environment that runs alongside the existing Ethereum Virtual Machine (EVM). It enables developers to write smart contracts in languages that compile to WebAssembly (WASM), such as Rust, C, and C++. Rather than replacing the EVM, Stylus extends Arbitrum’s capabilities, allowing you to choose the right tool for the job.

This architecture creates a hybrid environment. The EVM remains the default for Solidity and Vyper contracts, ensuring broad compatibility with existing tools and libraries. Stylus operates independently, executing WASM binaries with near-native speed. This separation means you can run high-performance Rust logic for complex computations while keeping simple token transfers on the EVM, all within the same chain.

For Web2 developers, this removes the friction of learning Solidity’s unique syntax and gas model. You can leverage familiar ecosystems like Rust’s Cargo or C++’s build systems. The result is a flexible development stack where performance-critical modules can be written in WASM-compatible languages without sacrificing the security and interoperability of the EVM.

FeatureEVMStylus
LanguagesSolidity, VyperRust, C, C++
Execution ModelEVM bytecodeWASM binaries
PerformanceOptimized for gas limitsNear-native speed
CompatibilityFull EVM compatibilityEVM-compatible via precompiles

Performance and cost choices that change the plan

EVM execution relies on a stack-based architecture that is inherently less efficient for complex logic. Every operation in Solidity or Vyper incurs gas costs proportional to the computational steps, making heavy calculations expensive. Arbitrum Stylus changes this by supporting WebAssembly (WASM), which allows developers to write in Rust or C++. This shift moves the execution model from a generic stack to a more optimized, linear memory layout, significantly reducing the overhead for non-trivial algorithms.

The primary advantage of WASM is its ability to handle complex data structures and logic with far fewer gas units than EVM equivalents. In the EVM, managing large arrays or performing cryptographic operations requires many small, discrete steps, each costing gas. WASM programs can execute these operations in bulk, leveraging native CPU instructions. This efficiency means that on-chain computations that were previously too costly to run can now be executed directly on the blockchain.

To understand the practical difference, consider how each environment handles similar tasks. The table below compares key metrics between Stylus and Standard EVM contracts.

MetricArbitrum Stylus (WASM)Standard EVM
Language SupportRust, C, C++, AssemblyScriptSolidity, Vyper
Execution ModelLinear memory, native CPU instructionsStack-based, opcode-heavy
Gas Efficiency for Complex LogicHigh (bulk operations, lower overhead)Low (many discrete steps, high overhead
Tooling & LibrariesAccess to full Rust/C++ ecosystemsEthereum-specific libraries only

This efficiency extends beyond simple arithmetic. For instance, cryptographic operations like hashing or signature verification are significantly cheaper in Stylus because they can utilize optimized, pre-compiled WASM modules. In contrast, EVM contracts must rely on precompiles that are limited in scope or implement inefficient workarounds in Solidity. This makes Stylus particularly suitable for applications requiring heavy computation, such as decentralized exchanges with complex order books or privacy-preserving protocols that rely on zero-knowledge proofs.

Rust and C++ developer experience

Arbitrum Stylus removes the barrier of learning Solidity for developers already proficient in systems programming. By supporting WebAssembly (WASM) through Rust and C++, Stylus allows you to deploy smart contracts using languages you likely already know. This means you can leverage existing libraries, tooling, and community knowledge without starting from scratch.

The official Stylus Rust SDK, available via OffchainLabs, is built on top of Alloy, a collection of crates empowering the Rust Ethereum ecosystem. This foundation provides a familiar interface for Rust developers, enabling them to write high-performance smart contracts that compile to WASM. The SDK handles the complexities of interacting with the Arbitrum chain, allowing you to focus on logic rather than low-level EVM opcodes.

For those coming from C++, the experience is equally streamlined. You can compile your C++ code to WASM and deploy it directly to Arbitrum. This flexibility means you aren't forced into a single language ecosystem. Whether you prefer the memory safety of Rust or the performance control of C++, Stylus supports both, making it easier to migrate existing Web2 applications to on-chain environments.

Testing and deployment are also simplified. Tools like Motsu, developed by OpenZeppelin, provide specialized testing frameworks for Stylus contracts. These tools help ensure your WASM-based contracts behave correctly before they go live. The combination of mature language ecosystems and dedicated testing tools lowers the risk of migration and accelerates development cycles.

The result is a developer experience that feels native to Web2 engineers. You can use standard Rust or C++ workflows, including CI/CD pipelines, local testing, and familiar debugging tools. This continuity reduces the learning curve significantly, allowing teams to deploy complex, high-throughput applications on Arbitrum with minimal friction.

When to choose Stylus over EVM

Stylus is not a replacement for the EVM; it is a specialized tool for specific computational problems. While the EVM remains the standard for general-purpose smart contracts, Stylus shines when you need performance that the EVM cannot provide at a reasonable cost. The decision to use Stylus usually comes down to one factor: gas efficiency for complex logic.

High-frequency trading and market making

In decentralized finance, speed and cost are critical. Market-making bots on the EVM often face prohibitive gas fees when executing complex strategies involving multiple swaps or liquidity adjustments. Stylus allows you to write these strategies in Rust, which compiles to WASM and executes significantly faster than EVM opcodes. For a high-frequency trading bot, this performance gap can mean the difference between profitability and loss. If your application involves rapid, iterative calculations that trigger frequent state changes, Stylus offers the throughput needed to stay competitive.

Complex cryptographic proofs

The EVM is notoriously inefficient at handling heavy cryptographic operations. Verifying zero-knowledge proofs or complex signature schemes on-chain can cost thousands of dollars in gas. Stylus changes this equation. By using Rust’s mature cryptographic libraries, you can perform these verifications locally within the WASM environment and only commit the final result to the EVM-compatible state. This approach drastically reduces on-chain computation. If your protocol relies on zk-SNARKs or other advanced cryptography, Stylus is the superior choice for keeping verification costs manageable.

Heavy data processing and indexing

Applications that require extensive data processing, such as on-chain analytics or complex data indexing, often hit a wall with the EVM. The EVM’s linear execution model and limited computational capacity make large-scale data manipulation expensive and slow. Stylus allows developers to process large datasets off-chain or in parallel within the WASM environment before committing the final, compact state to the blockchain. This is ideal for applications that need to aggregate, filter, or transform large volumes of data before storing the outcome. If your use case involves heavy data lifting, Stylus provides the computational freedom the EVM lacks.

Security and fraud proofs

Stylus contracts do not create a separate security silo. They run on the same Nitro virtual machine that powers standard EVM contracts on Arbitrum One. This means your Rust or C++ code benefits from the same optimistic rollup security model as Solidity. If a node executes a transaction incorrectly, the system detects the error and challenges it.

The verification process relies on fraud proofs. When a state transition is proposed, anyone can submit a fraud proof if they spot a discrepancy. The Nitro stack uses WASM execution to verify these proofs efficiently. This mechanism ensures that Stylus code is held to the same rigorous standards as EVM code. There is no "trust me" layer added by the new execution environment.

This architecture allows developers to use high-performance languages without sacrificing decentralization. The security guarantees remain anchored to Ethereum's base layer. You get the speed of native execution with the safety of a proven L2 system.

Frequently asked questions about Stylus