Skip to content

Commit 7dbda58

Browse files
authored
Merge pull request #184 from 0xMiden/brian/psm-docs
Add PSM and Private Multisig documentation under Solutions
2 parents e0d8265 + a146e99 commit 7dbda58

File tree

29 files changed

+1369
-13
lines changed

29 files changed

+1369
-13
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
22
"label": "Develop on Miden",
3-
"position": 4
3+
"position": 5
44
}

docs/builder/glossary.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,18 @@ A Batch allows multiple transactions to be grouped together, these batches will
4444

4545
A Block is a fundamental data structure which groups multiple batches together and forms the blockchain's state.
4646

47+
## Canonicalization
48+
49+
The background process by which [Miden Guardian](./solutions/miden-guardian/) promotes candidate deltas to canonical status by verifying them against the Miden network.
50+
4751
## Delta
4852

4953
A Delta represents the changes between two states `s` and `s'`. Applying a Delta `d` to `s` would result in `s'`.
5054

55+
## Delta Proposal
56+
57+
A coordination mechanism in [Miden Guardian](./solutions/miden-guardian/) that allows multiple signers to propose, review, and co-sign state changes before they are promoted to a canonical delta.
58+
5159
## Felt
5260

5361
A Felt or Field Element is a data type used for cryptographic operations. It represents an element in the finite field used in Miden.
@@ -60,6 +68,14 @@ A fundamental module of the MidenVM that acts as a base layer by providing core
6068

6169
An assembly language specifically designed for the Miden VM. It's a low-level programming language with specialized instructions optimized for zero-knowledge proof generation.
6270

71+
## Miden Guardian
72+
73+
Infrastructure built by OpenZeppelin for managing private account state on Miden. Guardian provides a server and client SDKs for backing up, syncing, and coordinating state across devices and parties without trust assumptions. See the [Miden Guardian documentation](./solutions/miden-guardian/).
74+
75+
## MultiSig
76+
77+
A multi-signature account on Miden that requires a configurable threshold (N-of-M) of authorized signers to approve transactions before execution. MultiSig workflows are coordinated through [Miden Guardian](./solutions/miden-guardian/).
78+
6379
## Note
6480

6581
A Note is a fundamental data structure that represents an offchain asset or a piece of information that can be transferred between accounts. Miden's UTXO-like (Unspent Transaction Output) model is designed around the concept of notes. There are output notes which are new notes created by the transaction and input notes which are consumed (spent) by the transaction.
@@ -84,6 +100,10 @@ A nullifier is a cryptographic commitment that marks a note as spent, preventing
84100

85101
A Prover is responsible for generating zero-knowledge proofs that attest to the correctness of the execution of a program without revealing the underlying data.
86102

103+
## Threshold Signature
104+
105+
A cryptographic scheme where a minimum number of signers (the threshold) out of a total group must sign for a transaction to be valid. Used in Miden's MultiSig accounts.
106+
87107
## Word
88108

89109
A Word is a data structure that represents the basic unit of computation and storage in Miden, it is composed or four Felt's.

docs/builder/index.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,29 @@ import DocCard from '@theme/DocCard';
7878
</div>
7979
</div>
8080

81+
<div className="row">
82+
<div className="col col--6">
83+
<DocCard
84+
item={{
85+
type: 'link',
86+
href: './solutions/miden-guardian',
87+
label: 'Miden Guardian',
88+
description: 'Backup, sync, and coordinate private account state with Guardian.',
89+
}}
90+
/>
91+
</div>
92+
<div className="col col--6">
93+
<DocCard
94+
item={{
95+
type: 'link',
96+
href: './solutions/private-multisig',
97+
label: 'Private Multisig',
98+
description: 'Multi-party threshold signature workflows on Miden.',
99+
}}
100+
/>
101+
</div>
102+
</div>
103+
81104
<div className="row">
82105
<div className="col col--6">
83106
<DocCard

docs/builder/migration/_category_.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"label": "Migration",
3-
"position": 6,
3+
"position": 7,
44
"link": {
55
"type": "doc",
66
"id": "builder/migration/index"

docs/builder/quick-start/accounts.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ npm run dev
158158
```
159159

160160
:::tip
161-
For detailed frontend setup guidance, see the [Web Client tutorial](/miden-tutorials/web-client/create_deploy_tutorial#step-2-set-up-the-webclient).
161+
For detailed frontend setup guidance, see the [Tutorials section](../develop/tutorials/rust-compiler/).
162162
:::
163163

164164
## Creating Accounts Programmatically

docs/builder/quick-start/your-first-smart-contract/test.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ Congratulations! You've successfully completed the Miden smart contract quick st
299299

300300
To deepen your knowledge, we recommend exploring the following resources:
301301

302-
- Visit the [Tutorials section](/miden-tutorials) for detailed, hands-on guides on topics such as contract interactions, advanced storage, custom note scripting, and integrating with external applications via the Miden Web Client.
303-
- For in-depth technical explanations of core concepts, consult the [Protocol section](/miden-base) of the documentation. Here you'll find comprehensive information on Miden's architecture, account model, transaction lifecycle, and the underlying zero-knowledge technology that powers the network.
302+
- Visit the [Tutorials section](../../develop/tutorials/rust-compiler/) for detailed, hands-on guides on topics such as contract interactions, advanced storage, custom note scripting, and integrating with external applications.
303+
- For in-depth technical explanations of core concepts, consult the [Core Concepts section](../../../core-concepts/) of the documentation. Here you'll find comprehensive information on Miden's architecture, account model, transaction lifecycle, and the underlying zero-knowledge technology that powers the network.
304304

305305
The foundational patterns and concepts you've practiced in this Quick Start will enable you to build complex, privacy-preserving applications on the Miden network. Continue with the resources above to take your development further!
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"label": "Solutions",
3+
"position": 4
4+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"label": "Miden Guardian",
3+
"position": 4
4+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"label": "Core Concepts",
3+
"position": 1
4+
}
Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
---
2+
title: Architecture
3+
sidebar_position: 1
4+
---
5+
6+
# Architecture
7+
8+
Guardian sits between Miden clients and the Miden network, providing an off-chain coordination layer for private account state.
9+
10+
## System overview
11+
12+
```mermaid
13+
graph LR
14+
A["Miden Client A<br/>(Desktop)"] <-->|"gRPC / HTTP"| Guardian["Guardian Server"]
15+
B["Miden Client B<br/>(Mobile)"] <-->|"gRPC / HTTP"| Guardian
16+
Guardian <-->|"Validates state"| Node["Miden Node"]
17+
```
18+
19+
- **Miden Client** handles transaction execution, proving, and local state management.
20+
- **Guardian Server** stores state snapshots and deltas, authenticates requests, validates changes against the network, and coordinates multi-party workflows.
21+
- **Miden Node** is the network's RPC endpoint that Guardian validates state against.
22+
23+
Each account is independently configured on Guardian with its own authentication policy and storage. Clients interact with Guardian through either gRPC or HTTP — both interfaces expose the same semantics.
24+
25+
## End-to-end transaction flow
26+
27+
Transactions proceed through a step-by-step process to ensure consistency and verifiability:
28+
29+
```mermaid
30+
sequenceDiagram
31+
participant Client as Miden Client
32+
participant Guardian as Guardian Server
33+
participant Chain as Miden Network
34+
35+
Client->>Client: 1. Execute transaction locally<br/>Generate delta
36+
Client->>Guardian: 2. Submit delta for acknowledgment
37+
Guardian->>Guardian: 3. Validate delta against policies
38+
Guardian->>Guardian: Co-sign as "candidate"
39+
Guardian-->>Client: Return ack signature
40+
Client->>Chain: 4. Submit ZK proof + state update
41+
Chain-->>Guardian: 5. Guardian monitors on-chain commitment
42+
alt Commitment matches candidate
43+
Guardian->>Guardian: Promote to "canonical"
44+
Guardian-->>Client: Propagate confirmed delta
45+
else Commitment mismatch
46+
Guardian->>Guardian: Mark as "discarded"
47+
Guardian-->>Client: Signal resync needed
48+
end
49+
```
50+
51+
1. **Local execution**: The user computes a transaction locally, generating a delta (state change).
52+
2. **Delta submission**: The user sends the delta to Guardian for acknowledgment.
53+
3. **Guardian acknowledgment**: Guardian validates the delta and co-signs it, designating it as a "candidate" state.
54+
4. **Proof submission**: The user generates the ZK proof and submits it to the chain.
55+
5. **Canonical confirmation**: Guardian monitors the chain. If the on-chain commitment matches the candidate, the state becomes "canonical" and is propagated to other devices or signers.
56+
57+
## Multi-device sync
58+
59+
For users with multiple devices, Guardian keeps state synchronized seamlessly:
60+
61+
```mermaid
62+
sequenceDiagram
63+
participant Desktop as Desktop
64+
participant Guardian as Guardian Server
65+
participant Mobile as Mobile
66+
67+
Desktop->>Desktop: Execute transaction
68+
Desktop->>Guardian: Push delta
69+
Guardian->>Guardian: Validate & acknowledge
70+
Desktop->>Desktop: Submit proof to chain
71+
Guardian->>Guardian: Confirm canonical
72+
Mobile->>Guardian: Get state
73+
Guardian-->>Mobile: Return latest state
74+
Mobile->>Mobile: Replay delta locally
75+
Note over Mobile: State now matches Desktop
76+
```
77+
78+
The desktop executes a transaction and pushes the delta to Guardian. After on-chain confirmation, Guardian propagates the canonical delta to the mobile device, which replays it locally — all without querying the chain directly.
79+
80+
## Account management
81+
82+
Accounts are configured with per-account authentication based on public keys (commitments). During setup, Guardian records which keys are authorized to manage the account.
83+
84+
For each request, the client signs a payload with one of those keys and the server verifies the signature against the account's authorized keys. See [Components](./components.md) for details on the auth model.
85+
86+
## Canonicalization
87+
88+
Canonicalization is the process of validating that a state transition (delta) is valid against the on-chain commitment. It is optional and mainly used in multi-user setups.
89+
90+
```mermaid
91+
stateDiagram-v2
92+
[*] --> candidate : push_delta
93+
candidate --> canonical : On-chain commitment matches
94+
candidate --> discarded : On-chain commitment mismatch
95+
canonical --> [*]
96+
discarded --> [*]
97+
```
98+
99+
- **Candidate mode** (default): A background worker promotes or discards deltas after a configurable delay and network verification.
100+
- **Optimistic mode**: Deltas become canonical immediately, skipping the verification window.
101+
102+
| Parameter | Default | Description |
103+
|---|---|---|
104+
| `delay_seconds` | 900 (15 min) | How long a candidate waits before the worker checks it. |
105+
| `check_interval_seconds` | 60 (1 min) | How often the worker runs. |
106+
107+
## Common use cases
108+
109+
- **Single-user accounts**: Back up and sync state securely. If a device is lost, recover state from Guardian.
110+
- **Multi-user accounts**: Coordinate state and transactions between participants. Guardian helps keep everyone on the latest canonical state.

0 commit comments

Comments
 (0)