Skip to main content
Version: 0.13 (unstable)

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

Reference Documentation

These guides provide detailed reference information for Rust compiler development:

GuideDescription
Testing with MockChainLearn to test your contracts using MockChain for local blockchain simulation
Debugging GuideInterpret errors and debug common issues
Common PitfallsAvoid 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)