How does Arbitrum Stylus let me write smart contracts in Rust?
Stylus runs WASM contracts beside the EVM on Arbitrum. Write Rust with stylus-sdk, deploy and activate via cargo stylus, and call Solidity through a shared ABI. Compute is far cheaper; storage costs the same.
Arbitrum Stylus adds a second virtual machine to Arbitrum chains: alongside the EVM, nodes can run smart contracts compiled to WebAssembly (WASM). You write the contract in Rust with the stylus-sdk crate, compile it to WASM, deploy the bytecode like any contract, and then activate it through the ArbWasm precompile, which checks and pre-compiles it for the node. Stylus and Solidity contracts share the same state, accounts and ABI, so they can call each other freely. Computation and memory are priced in ink (a finer unit of gas) and are usually much cheaper than equivalent EVM code, while storage costs the same. One status note: since 2 October 2026, new activations on Arbitrum One and Nova have been paused by the Security Council, so check the current status before planning a mainnet deployment.
How Stylus fits into Arbitrum
Arbitrum is an optimistic rollup: its node software, Nitro, executes transactions off Ethereum and posts data and state claims to L1, as described in how optimistic and ZK rollups work. Nitro already compiles its own state transition function to WASM for fraud proofs, so supporting user-supplied WASM was a natural extension rather than a new chain.
Stylus is often described as MultiVM. The EVM and the WASM VM sit side by side in the same state machine:
A Stylus contract has a normal 20-byte address, balance and storage.
It exposes a Solidity-compatible ABI, so a Solidity contract calls it with an ordinary interface, and it calls Solidity contracts the same way.
Wallets, ethers, viem, Foundry's cast and block explorers treat it like any other contract.
The difference is what runs inside. Stylus code is native WASM, so you get Rust's type system, crates from the ecosystem (as long as they work in no_std), and a cost model that rewards compute-heavy work.
What does a Stylus contract look like?
The SDK uses macros to map Rust structs onto Solidity-style storage and to generate the ABI. This contract keeps a global tally and a per-user count:
Rollups execute off-chain and post data to Ethereum. Optimistic rollups like Arbitrum assume validity unless a fault proof wins during a challenge window; ZK rollups post a validity proof per batch.
external/public functions; &self is view, &mut self writes
#[payable] on a method
payable
self.vm().msg_sender()
msg.sender
A panic, or returning Err(...)
revert
Function names are converted to camelCase in the ABI, so count_of becomes countOf(address). Running cargo stylus export-abi prints the Solidity interface for your contract, which other contracts and frontends can use directly.
Note the checked_add. Solidity 0.8 checks arithmetic for overflow automatically; Rust's U256 operators don't give you the same guarantee in release builds, so be explicit about overflow behaviour.
How do I build, deploy and activate it?
The toolchain is cargo-stylus, plus Docker for reproducible checks and a local Nitro devnode for testing:
rustup update # recent stable Rust
cargo install --force cargo-stylus
git clone https://github.com/OffchainLabs/nitro-devnode.git
(cd nitro-devnode && ./run-dev-node.sh) # local chain on http://localhost:8547
cargo stylus new tally && cd tally
# replace src/lib.rs with your contract
cargo stylus check --endpoint http://localhost:8547
cargo stylus deploy --endpoint http://localhost:8547 --private-key "$DEV_KEY" --estimate-gas
cargo stylus deploy --endpoint http://localhost:8547 --private-key "$DEV_KEY"
cargo stylus export-abi > ITally.sol
check compiles the contract and asks the node whether it would pass activation, without spending gas. deploy sends two transactions: one that deploys the WASM (compressed) as contract code, and one that activates it.
Activation is the step unique to Stylus. The ArbWasm precompile at address 0x71 validates the WASM, instruments it for gas metering, and compiles it to a form the node can execute quickly. You pay a one-off data fee for this. An activated program doesn't stay activated forever: it expires after about a year, or when a Stylus upgrade requires it, and must be reactivated (anyone can pay to do so). The latest docs also note that newer ArbOS versions allow contracts larger than the old 24 KB compressed limit by splitting them into fragments, but smaller binaries remain cheaper to deploy and activate, so keep the release profile's opt-level = "s" or "z" in mind.
Once deployed, interact with it exactly as you would a Solidity contract:
The SDK includes a test VM, so unit tests run with plain cargo test and no chain:
#[cfg(test)]mod test {
use super::*;
use stylus_sdk::testing::*;
#[test]fnbump_counts_per_user() {
letvm = TestVM::default();
letuser = Address::repeat_byte(0x11);
vm.set_sender(user);
letmut c = Tally::from(&vm);
c.bump();
c.bump();
assert_eq!(c.total(), U256::from(2));
assert_eq!(c.count_of(user), U256::from(2));
}
}
For integration tests, run against the devnode with Foundry or a TypeScript client, using the ABI from export-abi. If you're choosing a framework for the Solidity side of a mixed project, the trade-offs in Hardhat versus Foundry still apply.
What changes compared with Solidity?
Gas. Stylus meters execution in ink, where one unit of gas is 10,000 ink, so very cheap WASM instructions can be priced precisely. Compute and memory are typically far cheaper than in the EVM. Offchain Labs cites large savings for compute-heavy code, but measure your own workload: storage reads and writes, calls and logs cost the same as their EVM equivalents, so a contract that mostly moves tokens gains little. The usual Solidity gas-saving habits around storage still matter.
Good fits. Signature schemes and cryptography not available as precompiles, on-chain verification of proofs, heavy maths (pricing curves, fixed-point libraries), parsing, and porting existing Rust libraries.
Reentrancy is off by default. A Stylus contract can't be reentered unless you enable the SDK's reentrant feature. If you do, the same reentrancy defences used in Solidity apply.
Tooling is younger. Slither, most fuzzers and many audit firms are built around Solidity. OpenZeppelin maintains Rust contracts for Stylus (ERC-20, ERC-721, access control and more), and you should prefer them over writing standards from scratch. Plan your audit around the Rust code and the generated ABI.
Verification is different. Explorers can't recompile WASM with solc. cargo stylus verify and Docker-based reproducible builds are used instead; pin your Rust toolchain in rust-toolchain.toml so the build is reproducible. The same discipline as verifying a Solidity contract on Etherscan applies: identical inputs, identical output.
It only runs on Arbitrum chains with Stylus. The WASM isn't portable to Ethereum or other L2s. If you need the same contract everywhere, Solidity is still the portable choice. This is a different trade-off from chains like ZKsync Era, where Solidity compiles to a different VM with its own quirks: on Stylus your Solidity stays plain EVM, and only the Rust contracts are different.
The activation pause on Arbitrum One and Nova
On 2 October 2026 the Arbitrum Security Council used its emergency powers to make new Stylus activations on Arbitrum One and Nova effectively impossible, by raising the activation cost far beyond any block's gas. It was described as a precaution against a potential attack on Stylus's WASM handling; reports said no route to stealing user funds had been identified. As of late October 2026:
Already activated Stylus contracts keep running and can be renewed.
Solidity contracts are unaffected.
No reopening date has been announced; the Arbitrum Foundation has said it will work with the DAO on when and how to restore activations.
You can still build and test against a local devnode. Check the Arbitrum docs for the current position on mainnet, Arbitrum Sepolia and Orbit chains before you schedule a launch that depends on a new activation.
Checklist
Install cargo-stylus, Docker and a Nitro devnode; start from cargo stylus new.
Model storage with sol_storage!, expose methods with #[public], read context with self.vm().
Use checked arithmetic and return errors deliberately; a panic reverts.
Run cargo stylus check, unit-test with TestVM, integration-test on the devnode.
Deploy and activate with cargo stylus deploy; plan for reactivation roughly yearly.
Benchmark gas: expect big wins for compute, none for storage.
Use audited OpenZeppelin Stylus contracts for standards, and verify with reproducible builds.
Check the current activation status on your target network before relying on mainnet deployment.