Skip to main content
Version: 0.15 (unstable)

MASM Smart Contracts

This section is the practical guide to authoring Miden smart contracts directly in Miden Assembly (MASM) — the path Miden mainnet supports for production deployments today. The Rust SDK is in active development and will become the default authoring path once it ships v1; until then, MASM is what you ship with.

You're here because you want to deploy a contract to Miden mainnet. MASM is a small, stack-based assembly language — closer to assembly than Rust or Solidity, but it gives you direct, predictable control over the VM and is what the mainnet kernel verifies. The Reference → Miden VM → Assembly section is the full language reference; this section is the Builder-side cookbook for using it.

When to use MASM vs. the Rust SDK

ConcernMASMRust SDK
Mainnet productionSupported todayIn active development
Performance / cycle controlDirect control over emitted instructionsCompiles via Wasm → MASM; less predictable
Learning curveSmall instruction set, explicit stack semanticsFamiliar Rust ergonomics
Miden StandardsStandards modules callable directlySame standards via Rust bindings
Long-term directionLong-lived for system-level / performance-critical codeWill become the default authoring path once mature

For mainnet shipping today, the choice is straightforward: write MASM. Most production patterns — account components, note scripts, transaction scripts, P2ID and P2IDE flows, faucet policies — are already covered by Miden Standards, so most contracts compose existing standards rather than rolling everything from scratch.

Where the language reference lives

The full Miden Assembly reference — every instruction, the stack semantics, control flow, cryptographic operations, debugging instructions — lives in Reference → Miden VM → Assembly. Treat that as the dictionary. This Builder section is the cookbook: how to structure a project, conventions for accounts, notes, and transactions, deployment, testing, and debugging in the context of building a Miden app.

Tutorials

Practical, end-to-end tutorials are in progress in the Miden tutorials repository and will land in this section as they ship:

TutorialStatus
Project setup and first MASM contractIn progress
MASM account componentsIn progress
MASM note scriptsIn progress
MASM transaction scriptsIn progress
Testing with MockChainIn progress
Debugging MASM contractsIn progress

In the meantime, the existing Rust-based Miden Bank tutorial is useful for understanding the overall transaction lifecycle and the patterns that translate to MASM. The Reference assembly section covers the language itself.

See also