Miden Protocol

website·Indexed 33 days ago

https://docs.miden.xyz

Documentation covering the Miden Protocol, including its architecture, SDK, and version awareness.

Tokens
850
Snippets
0
Records
5
Agent score
15%

What's inside Miden

  1. Understand the Miden Protocol architectural model

    Miden is a privacy-preserving blockchain where accounts are programmable smart contracts and users execute and prove transactions locally. Key architectural shifts include:

    • Account-Centric State: Accounts own their storage, vault assets, code, and nonce. Updates are processed independently.
    • Programmable Notes: Notes are messages carrying assets and script logic that control how they are consumed. They act as the primary communication mechanism between accounts.
    • Local Execution: Clients execute transactions and produce proofs locally, submitting only the proven state transitions to the network.
    • Privacy by Default: Private accounts and notes reveal only commitments on-chain, keeping full state with the client.
    • Single-Account Transactions: A transaction typically involves only one account. For example, sending assets requires one transaction to create a note and another to consume it.
  2. Navigate Miden Protocol documentation and versions

    Miden maintains two primary documentation tracks:

    • Latest Stable (v0.16): Found at https://docs.miden.xyz/. Use this for released behavior.
    • Next/Unstable (v0.17): Found under https://docs.miden.xyz/next/.... Use this for current development and upcoming features.

    Key Documentation Paths:

    • Builder Guides: https://docs.miden.xyz/builder/ (includes get-started, smart-contracts, and tools).
    • Technical Reference: https://docs.miden.xyz/reference/ (covers Protocol, Miden VM, Compiler, and Node RPC).
  3. Avoid common Miden development pitfalls

    When developing for Miden, be aware of the following:

    • Source Location: Do not use miden-base paths; the current protocol source is in 0xMiden/protocol.
    • Doc Paths: Avoid old builder/develop paths. Use builder/get-started, builder/smart-contracts, builder/tutorials, and builder/tools.
    • Version Mismatch: Do not assume /next/* behavior is released. Always verify against the stable docs for production behavior.
    • SDK Types: For Web and React SDKs, verify method and type names against the shipped npm packages.
    • MASM: Rust smart contracts compile to Miden Assembly (MASM). For low-level logic, refer to both the miden-vm and protocol library documentation.
  4. Identify Miden Protocol core building blocks

    The Miden Protocol consists of several primary components:

    • Accounts: Smart contracts containing an ID, code, storage, vault, and nonce. They can be private or public.
    • Components: Reusable modules for accounts that handle storage, authentication, and application logic.
    • Notes: Programmable asset containers (private or public) consumed by account transactions.
    • Transactions: State transitions for a single account, including note processing and proof generation.
    • Assets: Fungible and non-fungible assets, defined and minted via Faucets.
    • Client State: Local data (account state, notes, nullifiers) required for proving and debugging.
    • Node Services: Infrastructure (RPC, block producer, store) for synchronization and transaction submission.
  5. Locate Miden Protocol source repositories

    Official source code for the Miden ecosystem is hosted on GitHub:

    • Protocol: https://github.com/0xMiden/protocol
    • Miden VM & Assembler: https://github.com/0xMiden/miden-vm
    • Rust SDK & CLI: https://github.com/0xMiden/rust-sdk
    • Web & React SDKs: https://github.com/0xMiden/web-sdk
    • Node: https://github.com/0xMiden/node
    • Compiler: https://github.com/0xMiden/compiler
    • Documentation: https://github.com/0xMiden/docs