Rust Compiler
The Miden Rust compiler allows you to write smart contracts in Rust and compile them to Miden Assembly (MASM). This section provides tutorials and reference documentation for developing with the Rust compiler.
Getting Started
If you're new to the Miden Rust compiler, start with the Miden Bank Tutorial - a comprehensive, step-by-step guide that teaches all the core concepts through building a complete banking application.
Miden Bank Tutorial
Build a complete banking application while learning:
- Account components and storage
- Note scripts and transaction scripts
- Asset management
- Cross-component calls
- Output note creation
Rust Smart Contract Reference
For detailed reference documentation on the Miden Rust SDK — types, macros, storage, APIs, and more — see the Rust Smart Contract Reference.
Supplementary Guides
| Guide | Description |
|---|---|
| Testing with MockChain | Learn to test your contracts using MockChain for local blockchain simulation |
| Debugging Guide | Interpret errors and debug common issues |
| Common Pitfalls | Avoid known issues and limitations |
Source Code
The complete source code for the Miden Bank example is available at:
github.com/keinberger/miden-bank
Prerequisites
Before starting, ensure you have:
- Completed the Quick Start guide
- Basic familiarity with Rust programming
- Understanding of Miden concepts (accounts, notes, transactions)