Rust Smart Contracts
The Rust SDK is the long-term direction for Miden smart-contract development: define account components, note scripts, and transaction scripts in idiomatic #![no_std] Rust with typed storage, attribute macros, and client-side proving. The SDK compiles to Miden Assembly (MASM) under the hood, so the same execution model and standards library apply.
The Rust SDK is being actively developed and is not yet production-ready for mainnet. For production deployments today, write contracts in Miden Assembly (MASM) — the supported path Miden mainnet verifies. Use the Rust SDK for prototyping, experimentation, and exploration of the long-term direction.
The pages below describe the Rust SDK's current shape: how accounts and components compose, how notes are scripted, how transactions execute, and the patterns you can already build with.
Inside the Rust SDK
Accounts
Components, storage, custom types, operations, cryptography, and authentication.
Notes
Programmable UTXOs for asset transfers and cross-account interaction.
Transactions
Transaction context, scripts, and the advice provider.
Cross-component calls
Calling methods across account components and from note scripts.
Types
Core types: Felt, Word, AccountId, NoteId, and more.
Patterns
Access control, rate limiting, spending limits, and anti-patterns.
When to choose Rust vs MASM today
| Concern | Rust SDK | MASM |
|---|---|---|
| Mainnet production | In active development | Supported today |
| Ergonomics | Familiar Rust idioms, type-checked storage, attribute macros | Stack-based assembly, explicit control |
| Compilation target | Compiles via Wasm → MASM | Directly authored |
| Use case | Long-term default once mature; prototyping and exploration today | Production contracts for mainnet |
Both authoring paths share the same Miden Standards library — standard components, notes, and faucet policies are callable from either.
Related pages
- MASM Smart Contracts — the path mainnet supports today.
- Miden Standards — reusable building blocks callable from Rust or MASM.
- Smart Contracts → Overview — execution model and lifecycle (concepts apply to both authoring paths).
- API reference on docs.rs — full Rust SDK API documentation.