What Arbitrum Stylus actually does
Arbitrum Stylus introduces a WebAssembly (WASM) execution layer to the Nitro stack, enabling smart contracts to be written in Rust, C, and C++ alongside traditional Solidity. This architecture allows developers to leverage high-performance systems languages for compute-intensive logic while maintaining full interoperability with the existing Ethereum Virtual Machine (EVM) ecosystem.
Stylus does not replace the EVM; it extends it. When a Stylus contract is deployed, it compiles to WASM. Arbitrum’s Nitro VM executes this WASM code efficiently, while the EVM continues to handle standard Solidity bytecode. Crucially, WASM programs remain fully compatible with the EVM. This means your Rust or C++ contracts can interact seamlessly with existing Ethereum infrastructure, including ERC-20 tokens and popular DeFi protocols, without requiring custom bridges or wrappers.
The primary advantage is performance. EVM bytecode is interpreted, which introduces overhead for complex computations. WASM, by contrast, is a low-level binary format that executes much closer to native machine speed. This allows developers to run intensive logic—such as zero-knowledge proof verification or complex mathematical models—that would be prohibitively expensive or slow on pure EVM.
For developers, this means access to a broader talent pool and a richer ecosystem of libraries. Instead of reinventing basic data structures or cryptographic functions in Solidity, you can leverage mature, audited crates from the Rust ecosystem or standard libraries from C++. This reduces development time and improves code reliability, making Arbitrum a more attractive platform for complex, high-throughput applications.
EVM vs Stylus: Performance and Language Support
Arbitrum Stylus introduces a fundamental shift in how developers build on Ethereum Layer 2s. While the Ethereum Virtual Machine (EVM) remains the standard for Solidity-based contracts, Stylus allows developers to write smart contracts in Rust, C, and C++. This expansion isn't just about language preference; it directly impacts computational efficiency and the types of complex logic that can be executed on-chain.
The EVM is designed for simplicity and security, interpreting bytecode in a sandboxed environment. This approach ensures broad compatibility but often comes at the cost of computational speed. For heavy mathematical operations, cryptographic hashing, or complex data structures, EVM execution can become prohibitively expensive in terms of gas. Stylus addresses this by leveraging native execution. When a contract is compiled from Rust or C++ into WebAssembly (Wasm), it runs directly on the host machine rather than through an interpreter. This native execution model can be orders of magnitude faster than EVM bytecode, significantly reducing gas costs for compute-heavy tasks.
Language flexibility is the other major differentiator. Solidity, the primary language for the EVM, is tailored specifically for smart contract development. It is relatively easy to learn but lacks the advanced features and safety guarantees found in systems languages. Rust, supported by Stylus through the stylus-sdk-rs, offers memory safety without a garbage collector and powerful concurrency features. C and C++ provide low-level control and performance, enabling developers to port existing libraries and algorithms to the blockchain with minimal modification.
This interoperability means that Stylus contracts can interact seamlessly with existing EVM contracts. You can call a Solidity contract from a Rust program and vice versa. This allows developers to mix and match: using Solidity for standard token transfers and governance, while using Rust or C++ for complex off-chain computation verification, cryptographic proofs, or high-frequency trading logic.
The choice between EVM and Stylus depends on your project's specific needs. If your application relies on standard ERC-20 or ERC-721 functionality, the EVM is likely sufficient and offers a larger ecosystem of tools and developers. However, if your project requires intensive computation, custom cryptography, or integration with existing C++/Rust codebases, Stylus provides the performance and language support necessary to build efficiently.
| Feature | EVM (Solidity) | Stylus (Rust/C++) |
|---|---|---|
| Primary Language | Solidity | Rust, C, C++ |
| Execution Model | Bytecode Interpreter | Native Wasm Execution |
| Gas Efficiency | Standard | Up to 10-100x lower for compute |
| Memory Safety | Basic | Strong (via Rust compiler) |
| Ecosystem Maturity | High | Growing |
| Best Use Case | Standard tokens, DeFi primitives | Complex logic, crypto, gaming |
When to choose Stylus over standard EVM
Arbitrum Stylus opens the door for developers to write smart contracts in Rust, C, and C++, moving beyond the Solidity and Vyper constraints of the standard EVM. This expansion allows millions of developers to bring existing libraries and tools to blockchain, but it also introduces a critical decision point: when is the performance gain worth the architectural shift?
The primary driver for choosing Stylus is computational intensity. Standard EVM execution is linear and expensive for complex logic. If your application requires heavy cryptography, such as zero-knowledge proof verification, or complex state transitions like those found in high-frequency trading bots, Stylus offers significant speed improvements. Rust and C++ allow for memory management and algorithmic optimizations that are impossible in EVM bytecode, turning operations that would take seconds into milliseconds.
However, this performance comes with a trade-off in ecosystem interoperability. Standard EVM contracts are universally recognized by wallets, explorers, and other Layer 2 chains. Stylus contracts, while fully compatible with Arbitrum Nitro, require specific tooling for interaction. You should choose Stylus when your application is compute-bound and can afford a slightly more complex deployment pipeline. If your logic is simple token transfers or basic storage, the standard EVM remains the safer, more integrated choice.
Think of the EVM as a universal translator that understands everyone but speaks slowly, while Stylus is a specialized dialect spoken fluently by a subset of developers. If you need to communicate with the entire world, stick to the universal translator. If you need to solve a complex problem quickly within your own circle, the specialized dialect is the better tool.
Interoperability between EVM and Stylus contracts
Stylus contracts do not exist in isolation. They run alongside existing EVM contracts on Arbitrum, sharing the same state and message-passing infrastructure. This design ensures that building in Rust or C++ does not cut you off from the broader Ethereum ecosystem, including established DeFi protocols, liquidity pools, and token standards.
Calling EVM from Stylus
A Stylus contract can invoke an EVM contract using the standard call instruction. The Stylus runtime translates these calls into EVM-compatible operations, allowing Rust or C++ code to interact with ERC-20 tokens, Uniswap routers, or any other deployed EVM bytecode. You pass the target address, calldata, and value just as you would in Solidity, but the execution happens within the WASM environment.
Calling Stylus from EVM
The reverse interaction is equally straightforward. An EVM contract can call a Stylus contract by treating it like any other external contract. Since Stylus contracts are deployed with a specific WASM hash and follow standard ABI conventions, EVM code can send transactions to them without modification. This bidirectional compatibility means you can gradually migrate logic or mix high-performance Rust modules with legacy Solidity infrastructure.
Shared State and Security
Both contract types share the same global state. A Stylus contract can read and write storage slots that are also accessible to EVM contracts. This shared state model simplifies integration but requires careful attention to data types and encoding. When passing complex structs between Rust and Solidity, you must ensure that memory layouts and serialization methods align perfectly to avoid data corruption or unexpected behavior.
Getting started with the Stylus Rust SDK
Arbitrum Stylus removes the EVM constraint, allowing developers to write smart contracts in Rust, C, and C++. The official Stylus Rust SDK is built on top of Alloy, a collection of crates empowering the Rust Ethereum ecosystem. This foundation provides a familiar development experience for Rust developers while ensuring full interoperability with existing Ethereum infrastructure.
To begin building, you can access the SDK directly from the OffchainLabs GitHub repository. The documentation offers a comprehensive overview of the reference materials, covering everything from basic project setup to advanced ABI integration. By leveraging Alloy, you gain access to robust tooling that simplifies interaction with Arbitrum's unique execution environment.
The SDK supports seamless integration with standard Rust workflows. You can compile your contracts using standard Cargo commands and deploy them to the Arbitrum network. This approach maintains the performance benefits of native code execution while preserving the security and compatibility that Ethereum developers expect.
Frequently asked questions about Arbitrum Stylus
What is Arbitrum Stylus?
Arbitrum Stylus allows developers to write smart contracts in Rust, C, and C++ instead of Solidity. It runs these non-EVM contracts alongside native EVM contracts, giving you access to millions of developers familiar with systems languages while maintaining full interoperability with existing Ethereum infrastructure.
How does Stylus differ from standard EVM contracts?
Standard EVM contracts rely on Solidity or Vyper and run on the Ethereum Virtual Machine. Stylus introduces a new execution environment where compiled WebAssembly (Wasm) modules execute directly on the node. This enables significantly lower latency and higher throughput for compute-heavy tasks that are inefficient or too expensive in pure EVM bytecode.
Can I use Stylus with existing Ethereum tools?
Yes. Stylus contracts are deployed on Arbitrum One and Nitro chains, which are fully compatible with Ethereum. You can interact with Stylus contracts using standard Ethereum tools like MetaMask, Ethers.js, and Viem. The contracts maintain EVM compatibility, meaning they can seamlessly call and be called by traditional Solidity contracts.
What is the main advantage of using Rust or C++ on Arbitrum?
The primary advantage is performance and developer reach. Languages like Rust and C++ offer fine-grained control over memory and execution, enabling complex logic that would be prohibitively expensive in Solidity. This opens the door for high-frequency trading, advanced cryptography, and data-heavy applications that benefit from the speed of native systems languages.


No comments yet. Be the first to share your thoughts!