Stylus introduces a second virtual machine to the Arbitrum Nitro stack, allowing developers to write smart contracts in languages that compile to WASM, such as Rust and C. This multi-VM architecture is not a siloed environment; Stylus contracts and traditional EVM contracts coexist within the same state trie, sharing the same address space and block context. The core interoperability primitive is the ability for a contract in one VM to call a contract in the other, a mechanism that is essential for building hybrid applications but introduces a new class of cross-VM interaction patterns that integration architects must understand.

Stylus and EVM Interoperability Patterns
Introduction
A technical analysis of the interoperability model between Stylus WASM contracts and the EVM on Arbitrum, focusing on the ABI, gas, and security patterns that govern atomic cross-VM calls.
The foundation of this interoperability is a unified ABI encoding and decoding layer. When a Solidity contract calls a Stylus contract, the calldata is standard ABI-encoded, and the Stylus SDK is responsible for decoding it into the expected Rust types. The reverse is also true: a Stylus contract calling a Solidity contract must ABI-encode its call data. However, the operational impact lies in the nuances. Gas metering is fundamentally different between the two VMs, with Stylus contracts using an ink-based pricing model for computation that is distinct from the EVM's opcode-based gas schedule. An atomic call chain that spans both VMs will have its total cost determined by a composite of these two models, which can lead to unexpected gas estimation failures if not properly accounted for in client tooling.
The security model for cross-VM calls demands careful review. A reentrancy attack initiated from a Stylus contract against an EVM contract, or vice versa, is a novel attack surface that inherits the trust assumptions of both execution environments. The Stylus SDK provides guards, but the responsibility for safe cross-VM state management falls on the developer. For protocols deploying hybrid architectures, a specialized review of the cross-VM call graph is necessary to identify atomicity violations, storage collision risks, and gas griefing vectors that do not exist in single-VM deployments. Chainscore Labs can perform this cross-VM security review, modeling the composite failure modes to ensure the integrity of hybrid applications.
Quick Facts
Key operational and security facts for teams building hybrid applications where Stylus and Solidity contracts interact.
| Area | What changes | Who is affected | Action |
|---|---|---|---|
Cross-VM ABI Handling | Stylus contracts use a Rust SDK to encode/decode Solidity ABI. Incorrect implementation can lead to silent data corruption. | Protocol architects, smart contract developers | Review all cross-VM call paths for correct ABI encoding/decoding. A specialized review can prevent data corruption. |
Gas Accounting | Gas metering differs between VMs. Stylus operations have different costs than EVM opcodes, affecting cross-VM call budgets. | Application developers, wallet teams | Profile gas usage of cross-VM call chains. Ensure wallets provide accurate gas estimates for hybrid transactions. |
Atomicity Guarantees | Calls spanning Stylus and EVM contracts are not inherently atomic. A revert in one VM may not roll back state in the other. | DeFi protocol teams, integration architects | Design explicit commit/reveal or two-phase patterns for cross-VM state changes. A failure-mode analysis is critical. |
Storage Layout | Stylus storage is managed via Rust structs. Manual mapping to EVM storage slots is error-prone and can cause slot collisions. | Developers writing Stylus contracts | Use the SDK's storage derive macros. Do not manually calculate storage slots. A design review can catch layout errors. |
Precompile Compatibility | Arbitrum precompiles (e.g., ArbSys) are accessible from Stylus but may require specific SDK wrappers for correct gas and return handling. | Teams using Arbitrum-specific features | Verify precompile integration works identically from both VMs. Test edge cases for gas forwarding and return data. |
Security Model | Stylus introduces Rust-specific attack surfaces (e.g., integer overflow, unsafe blocks) that are not present in Solidity. | Security auditors, protocol risk teams | Engage a Stylus-aware security review. Standard Solidity audits will miss Rust-specific vulnerabilities. |
Upgradeability | The pattern for upgradeable Stylus contracts differs from Solidity proxy patterns. Delegatecall semantics do not apply. | Protocol teams deploying upgradeable contracts | Adopt the canonical Stylus upgrade pattern. Do not port Solidity proxy patterns directly. A migration review is recommended. |
Cross-VM Execution Architecture
The architectural model for atomic, synchronous calls between Stylus WASM contracts and EVM Solidity contracts within Arbitrum's Nitro execution environment.
Arbitrum's Stylus upgrade introduces a multi-VM execution environment where WebAssembly (WASM) contracts run alongside the existing Ethereum Virtual Machine (EVM) within the same Nitro chain. This architecture is not a sidechain or a separate execution zone; both VMs share a single global state, a unified gas accounting framework, and the same block production pipeline. A Solidity contract can call a Stylus contract and vice versa through a synchronous, atomic call path that is resolved entirely within the sequencer's execution context before a block is produced. This tight coupling means that cross-VM calls do not introduce new finality or messaging latency assumptions, but they do create a new class of interface and resource accounting risks that integration architects must model.
The interoperability mechanism relies on the Arbitrum stylus host to marshal calls between the EVM interpreter and the WASM runtime. When a cross-VM call occurs, the Nitro execution layer performs ABI encoding and decoding at the boundary, translating Solidity's calldata conventions into the Stylus SDK's input format and back. The critical operational detail is that gas metering is unified: the L2 gas schedule applies to both VMs, but the resource consumption profile of a WASM contract can differ significantly from an equivalent EVM contract for the same operation. A Stylus contract performing heavy cryptographic work may consume far less gas than a Solidity precompile call, while a memory-intensive operation could exhibit the opposite profile. Teams building hybrid applications must validate that their gas assumptions hold across both execution contexts to avoid out-of-gas reversions at the VM boundary.
The security model for cross-VM calls inherits the synchronous trust assumptions of the Nitro sequencer. A reentrancy attack initiated in a Stylus contract can traverse into an EVM contract and back within a single transaction, making the combined call graph the relevant security perimeter. Auditing a hybrid application requires tracing execution paths that cross the WASM-EVM boundary, where a vulnerability in a Rust contract's #[payable] logic can be exploited by a malicious Solidity fallback function. Chainscore Labs performs cross-VM protocol impact assessments that map the full call graph, validate ABI compatibility at every boundary, and model worst-case gas consumption to ensure that atomic cross-VM interactions do not introduce unaccounted failure modes.
Affected Actors
Builders of Hybrid Stylus/Solidity Applications
Developers writing contracts that span both VMs must handle ABI encoding and decoding at the boundary. Stylus contracts use the Stylus SDK's #[external] macros and sol_interface! to generate ABI-compatible entry points, but manual byte manipulation may be needed for complex types.
Key actions:
- Audit all cross-VM call paths for correct ABI encoding of tuples, arrays, and nested structs.
- Verify that
staticcallvsdelegatecallsemantics are preserved when a Solidity contract invokes a Stylus contract. - Test revert propagation: a panic in Rust must bubble up as a recognizable EVM revert reason.
- Review storage layout assumptions if contracts in both VMs share state via
delegatecallpatterns.
A cross-VM integration review can catch subtle encoding mismatches before they become exploits.
Implementation Patterns and Impact
Practical patterns for building hybrid applications where Stylus and Solidity contracts interact, with a focus on ABI encoding, gas accounting, and atomic call security.
Cross-VM Integration Risk Matrix
A risk assessment framework for hybrid applications where Stylus (WASM) and Solidity (EVM) contracts interact. Identifies failure modes, affected parties, and required actions for secure cross-VM execution.
| Risk Area | Failure Mode | Who is affected | Severity | Mitigation and Action |
|---|---|---|---|---|
ABI Encoding/Decoding | Mismatched data encoding between Rust structs and Solidity ABI types causes silent data corruption or revert. | Protocol developers, wallets, indexers | High | Verify encoding compatibility with property-based tests. Commission a cross-VM ABI review for all public interfaces. |
Gas Accounting | Incorrect gas metering or unexpected costs for Stylus opcodes lead to out-of-gas reverts or DoS vectors. | Application users, relayers, protocol treasuries | High | Profile gas usage under varied state conditions. Audit Stylus-specific gas schedules and fallback logic. |
Atomic Call Reversion | Partial state changes in a cross-VM call are not atomically reverted, breaking composability. | DeFi protocols, aggregators, cross-VM vaults | Critical | Design explicit commit-reveal or lock-release patterns. Do not assume EVM atomicity across VM boundaries. |
Storage Collision | Stylus and Solidity contracts share storage slots via delegatecall or precompile, causing state corruption. | Protocol developers, upgrade managers | Critical | Enforce strict storage layout separation. Audit storage pointer arithmetic in Rust code. |
Precompile Compatibility | A Stylus contract calls an EVM precompile with incompatible input format or gas assumptions. | Protocol developers, node operators | Medium | Test all precompile interactions with fuzzed inputs. Monitor precompile gas schedule changes in ArbOS upgrades. |
Reentrancy Across VMs | A cross-VM callback creates a novel reentrancy path not guarded by standard EVM mutexes. | Lending protocols, AMMs, bridges | Critical | Apply reentrancy guards at the cross-VM boundary. Model call graphs that span both execution environments. |
Event Emission and Indexing | Stylus events are not correctly indexed by EVM-compatible subgraphs or analytics tools. | Data teams, indexers, frontend developers | Low | Validate event signatures and topic hashes against subgraph schemas. Test indexing pipelines with Stylus-emitted events. |
Upgradeability Proxy | A proxy pattern designed for EVM bytecode does not correctly delegate to a Stylus WASM blob. | Protocol developers, multisig signers | High | Do not use standard EVM proxies for Stylus contracts. Use native Stylus upgrade patterns and verify storage compatibility. |
Integration Readiness Checklist
A practical checklist for engineering teams preparing to deploy hybrid applications where Stylus (WASM) contracts and Solidity (EVM) contracts interact. Each item identifies a critical integration surface, explains why it matters, and specifies the signal that confirms readiness.
Verify that all cross-VM calls use canonical ABI encoding and decoding. Stylus contracts must serialize and deserialize calldata exactly as the Solidity ABI specifies, including correct handling of dynamic types, tuples, and nested arrays.
Why it matters: A single byte mismatch in encoding will cause calls to revert or, worse, silently corrupt state. The Stylus SDK provides helpers, but custom serialization logic is a common source of critical vulnerabilities.
Readiness signal: A full integration test suite passes where every cross-VM function selector is exercised with edge-case inputs (zero values, maximum-length arrays, empty strings). Fuzz testing confirms that no malformed calldata can cause unexpected state transitions.
Canonical Resources
Use these sources to verify the current Stylus execution model, SDK behavior, deployment tooling, and ABI compatibility assumptions before shipping hybrid Stylus and Solidity systems.
Looking to build on a specific blockchain?
We build smart contracts, DeFi applications, wallets, tokenization platforms, and blockchain infrastructure across the major ecosystems teams choose today. That includes Ethereum, Arbitrum, Optimism, Polygon, Avalanche, Solana, Sui, Aptos, Hedera, Stellar, and NEAR, with support for additional EVM and non-EVM networks based on your product requirements.
EVM ecosystems
- Ethereum
- Arbitrum
- Optimism
- Polygon
- Avalanche
- Cronos

Non-EVM ecosystems
- Solana
- Sui
- Aptos
- Hedera
- Stellar
- NEAR
Additional ecosystems
- Polkadot
- Cosmos
- TON
- Cardano
- Algorand
- Tempo
Also available for Base, appchains, custom EVM networks, and cross-chain product architecture.
Frequently Asked Questions
Answers to common questions from integration architects and senior engineers building hybrid applications that span Stylus and Solidity execution environments on Arbitrum.
Stylus contracts expose a Solidity ABI-compatible interface. The Stylus SDK handles the encoding and decoding of calldata and return data according to the standard ABI specification.
What to verify:
- The Stylus contract's public interface is exported with the correct Solidity types using the
#[solidity_interface]macro or manual selector routing. - Complex types (structs, dynamic arrays) are correctly encoded. A mismatch here will cause silent decoding failures or panics.
- The Stylus contract's
#[entrypoint]correctly routes selectors to handler functions.
Why it matters: Incorrect ABI encoding is the most common source of cross-VM call failures. A review of the Stylus contract's public interface against its intended Solidity ABI is essential.
Delivering blockchain solutions for 5+ years.
We have partnered with 50+ leading DeFi protocols, NFT ecosystems, and fintech innovators to build secure, scalable, and capital-efficient blockchain products.
Selected Partners & Clients
“I've been working with Chainscore Labs for last 3+ years, they've consistently delivered with strong ownership across multiple projects. The team is reliable and detail-oriented.”
How to get started?
If you're looking for blockchain integration, ChainScore Labs has 5+ years of experience helping teams build and integrate exchanges, wallets, smart contracts, tokenization solutions, and protocol-connected products, we can help you choose the right path, integrate securely, and get to production faster. Our team consists of experienced blockchain developers and architects who can help you with your blockchain integration needs.
Exploration & Strategy
Define your product goals and choose the right blockchain architecture for your use case.
Architecture & Design
Design the smart contracts, tokenomics, and security parameters of your system.
Development & Integration
Build and integrate with wallets, oracles, and front-end dApps for a seamless experience.
Security & Launch
Comprehensive audits followed by a risk-managed mainnet deployment to protect your users.
Discover our
blockchain development services.
We build production-grade blockchain solutions for top-tier projects across DeFi and Web3.
Need a blockchain engineering team?
Send the project context and we will respond with next steps, scope questions, and a practical path to delivery.


