Skip to main content
Private by design · Verifiable by default

Build scalable, private applications.

A zero-knowledge rollup with client-side proving. Accounts and notes are private by default — only commitments go on-chain.

Start a path

Pick where you land.

Peek under the hood

A counter account, in Rust.

Smart contracts on Miden are plain Rust crates. Storage is typed, functions are `#[component]`-annotated, and state transitions are proved client-side before submission to the network.

contracts/counter/src/lib.rs
use miden::{component, Felt, StorageMap, StorageMapAccess, Word};

#[component]
struct CounterContract {
    #[storage(description = "counter contract storage map")]
    count_map: StorageMap,
}

#[component]
impl CounterContract {
    /// Increments the counter by one.
    pub fn increment_count(&mut self) -> Felt {
        let key = Word::from_u64_unchecked(0, 0, 0, 1);
        let next: Felt = self.count_map.get(&key) + Felt::from_u32(1);
        self.count_map.set(key, next);
        next
    }
}