You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Address feedback from Dominik's Quick Start review (miden-devrel#126):
- Add missing `cd my-test-project` after project creation in installation guide
- Add conditional "reuse existing project" note in accounts guide
- Add core transaction principle to Two-Transaction Model section
- Fix "private asset transfers" wording to match public NoteType usage
- Add tip blocks and section markers for duplicated code in notes guide
- Add polling loop explanation comments (notes must be committed first)
- Fix "Bob's account" to "Bob's client" for technical accuracy
- Fix "Miden assembly" to "Miden package (.masp file)" in contract guides
- Add felt! macro vs Felt type explanation
- Clarify "Miden component" as "Account component" with link
- Add "in the counter contract" for clarity
- Add Miden Testnet Explorer link after deployment
Copy file name to clipboardExpand all lines: docs/builder/get-started/notes.md
+21-3Lines changed: 21 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
---
2
2
sidebar_position: 3
3
3
title: Notes & Transactions
4
-
description: Learn Miden's unique note-based transaction model for private asset transfers.
4
+
description: Learn Miden's unique note-based transaction model for asset transfers between accounts.
5
5
---
6
6
7
7
import { CodeTabs } from '@site/src/components';
@@ -30,6 +30,8 @@ Traditional blockchains move tokens directly between account balances. Miden use
30
30
31
31
## The Two-Transaction Model
32
32
33
+
A core principle of Miden is that **a transaction is the state transition of a single account**. This means each transaction only modifies one account's state, which enables parallel execution and strong privacy guarantees.
34
+
33
35
Miden uses a **two-transaction model** for asset transfers that provides enhanced privacy and scalability:
34
36
35
37
### Transaction 1: Sender Creates Note
@@ -41,7 +43,7 @@ Miden uses a **two-transaction model** for asset transfers that provides enhance
41
43
42
44
### Transaction 2: Recipient Consumes Note
43
45
44
-
-**Bob's account** discovers the note (addressed to his ID)
46
+
-**Bob's client** discovers the note (addressed to his ID)
45
47
- Bob creates a transaction to consume the note
46
48
- Tokens move from the note into Bob's vault
47
49
- Bob's balance increases, note is nullified
@@ -294,6 +296,10 @@ After minting creates a P2ID note containing tokens, the recipient must **consum
294
296
295
297
Here's how to consume notes programmatically:
296
298
299
+
:::tip
300
+
This is a complete, self-contained example that includes the setup and minting steps from the previous section. **The new consume logic starts at the `CONSUMING P2ID NOTES` comment.**
Copy file name to clipboardExpand all lines: docs/builder/get-started/setup/installation.md
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -149,9 +149,10 @@ Test by creating a new project:
149
149
150
150
```bash title=">_ Terminal"
151
151
miden new my-test-project
152
+
cd my-test-project
152
153
```
153
154
154
-
If successful, you'll see a new directory with Miden project files.
155
+
If successful, you'll see a new directory with Miden project files. The `cd` command enters the project directory, which you'll need for the following guides.
-**`component`**: Macro for defining contract components
126
+
-**`felt`**: Macro for creating `Felt` literals (e.g., `felt!(1)`)
126
127
-**`Felt`/`Word`**: Miden's native field element and word types
127
128
-**`StorageMap`**: Key-value storage within account storage slots
128
129
-**`StorageMapAccess`**: Needed for reading storage values (`get_count` function)
@@ -138,7 +139,7 @@ struct CounterContract {
138
139
}
139
140
```
140
141
141
-
The `#[component]` attribute marks this as a Miden component. The `count_map` field is a `StorageMap` stored in a named storage slot of the account. In v0.13, storage slots are identified by name rather than explicit index numbers — the slot name is derived automatically from the component's package name and field name (e.g., `miden::component::miden_counter_account::count_map`).
142
+
The `#[component]` attribute marks this as a Miden [Account component](/core-concepts/miden-base/account). The `count_map` field is a `StorageMap` stored in a named storage slot of the account. In v0.13, storage slots are identified by name rather than explicit index numbers — the slot name is derived automatically from the component's package name and field name (e.g., `miden::component::miden_counter_account::count_map`).
142
143
143
144
**Important**: Storage slots in Miden hold `Word` values, which are composed of four field elements (`Felt`). Each `Felt` is a 64-bit unsigned integer (u64). The `StorageMap` provides a key-value interface within a single storage slot, allowing you to store multiple key-value pairs within the four-element word structure.
144
145
@@ -158,7 +159,7 @@ The `CounterContract` implementation defines the external interface that other c
158
159
letkey=Word::from_u64_unchecked(0, 0, 0, 1);
159
160
```
160
161
161
-
Both functions use the same fixed key `[0, 0, 0, 1]` to store and retrieve the counter value within the storage map. The `Word::from_u64_unchecked` constructor creates a `Word` from four `u64` values. This demonstrates a simple but effective storage pattern.
162
+
Both functions in the counter contract use the same fixed key `[0, 0, 0, 1]` to store and retrieve the counter value within the storage map. The `Word::from_u64_unchecked` constructor creates a `Word` from four `u64` values. This demonstrates a simple but effective storage pattern.
Congratulations, you have successfully deployed the Counter Contract to the Miden Testnet, and incremented its count by one!
96
+
Congratulations, you have successfully deployed the Counter Contract to the Miden Testnet, and incremented its count by one! You can view your account on the [Miden Testnet Explorer](https://testnet.midenscan.com).
97
97
98
98
### What Happens During Execution
99
99
@@ -149,8 +149,8 @@ let note_package = Arc::new(
149
149
The `build_project_in_dir()` function:
150
150
151
151
- Takes the path to your contract's Rust source code
152
-
- Compiles the Rust code into Miden assembly
153
-
-Generates a package containing the compiled contract bytecode and metadata
152
+
- Compiles the Rust code into a Miden package (`.masp` file)
153
+
-The package contains the compiled contract bytecode and metadata
154
154
- This is equivalent to manually running `miden build` in each contract directory
155
155
156
156
These packages contain all the information needed to deploy and interact with your contracts on the Miden network.
Copy file name to clipboardExpand all lines: versioned_docs/version-0.13/builder/get-started/notes.md
+21-3Lines changed: 21 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
---
2
2
sidebar_position: 3
3
3
title: Notes & Transactions
4
-
description: Learn Miden's unique note-based transaction model for private asset transfers.
4
+
description: Learn Miden's unique note-based transaction model for asset transfers between accounts.
5
5
---
6
6
7
7
import { CodeTabs } from '@site/src/components';
@@ -30,6 +30,8 @@ Traditional blockchains move tokens directly between account balances. Miden use
30
30
31
31
## The Two-Transaction Model
32
32
33
+
A core principle of Miden is that **a transaction is the state transition of a single account**. This means each transaction only modifies one account's state, which enables parallel execution and strong privacy guarantees.
34
+
33
35
Miden uses a **two-transaction model** for asset transfers that provides enhanced privacy and scalability:
34
36
35
37
### Transaction 1: Sender Creates Note
@@ -41,7 +43,7 @@ Miden uses a **two-transaction model** for asset transfers that provides enhance
41
43
42
44
### Transaction 2: Recipient Consumes Note
43
45
44
-
-**Bob's account** discovers the note (addressed to his ID)
46
+
-**Bob's client** discovers the note (addressed to his ID)
45
47
- Bob creates a transaction to consume the note
46
48
- Tokens move from the note into Bob's vault
47
49
- Bob's balance increases, note is nullified
@@ -294,6 +296,10 @@ After minting creates a P2ID note containing tokens, the recipient must **consum
294
296
295
297
Here's how to consume notes programmatically:
296
298
299
+
:::tip
300
+
This is a complete, self-contained example that includes the setup and minting steps from the previous section. **The new consume logic starts at the `CONSUMING P2ID NOTES` comment.**
Copy file name to clipboardExpand all lines: versioned_docs/version-0.13/builder/get-started/setup/installation.md
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -166,9 +166,10 @@ Test by creating a new project:
166
166
167
167
```bash title=">_ Terminal"
168
168
miden new my-test-project
169
+
cd my-test-project
169
170
```
170
171
171
-
If successful, you'll see a new directory with Miden project files.
172
+
If successful, you'll see a new directory with Miden project files. The `cd` command enters the project directory, which you'll need for the following guides.
-**`component`**: Macro for defining contract components
126
+
-**`felt`**: Macro for creating `Felt` literals (e.g., `felt!(1)`)
126
127
-**`Felt`/`Word`**: Miden's native field element and word types
127
128
-**`StorageMap`**: Key-value storage within account storage slots
128
129
-**`StorageMapAccess`**: Needed for reading storage values (`get_count` function)
@@ -138,7 +139,7 @@ struct CounterContract {
138
139
}
139
140
```
140
141
141
-
The `#[component]` attribute marks this as a Miden component. The `count_map` field is a `StorageMap` stored in a named storage slot of the account. In v0.13, storage slots are identified by name rather than explicit index numbers — the slot name is derived automatically from the component's package name and field name (e.g., `miden::component::miden_counter_account::count_map`).
142
+
The `#[component]` attribute marks this as a Miden [Account component](/core-concepts/miden-base/account). The `count_map` field is a `StorageMap` stored in a named storage slot of the account. In v0.13, storage slots are identified by name rather than explicit index numbers — the slot name is derived automatically from the component's package name and field name (e.g., `miden::component::miden_counter_account::count_map`).
142
143
143
144
**Important**: Storage slots in Miden hold `Word` values, which are composed of four field elements (`Felt`). Each `Felt` is a 64-bit unsigned integer (u64). The `StorageMap` provides a key-value interface within a single storage slot, allowing you to store multiple key-value pairs within the four-element word structure.
144
145
@@ -158,7 +159,7 @@ The `CounterContract` implementation defines the external interface that other c
158
159
letkey=Word::from_u64_unchecked(0, 0, 0, 1);
159
160
```
160
161
161
-
Both functions use the same fixed key `[0, 0, 0, 1]` to store and retrieve the counter value within the storage map. The `Word::from_u64_unchecked` constructor creates a `Word` from four `u64` values. This demonstrates a simple but effective storage pattern.
162
+
Both functions in the counter contract use the same fixed key `[0, 0, 0, 1]` to store and retrieve the counter value within the storage map. The `Word::from_u64_unchecked` constructor creates a `Word` from four `u64` values. This demonstrates a simple but effective storage pattern.
Congratulations, you have successfully deployed the Counter Contract to the Miden Testnet, and incremented its count by one!
96
+
Congratulations, you have successfully deployed the Counter Contract to the Miden Testnet, and incremented its count by one! You can view your account on the [Miden Testnet Explorer](https://testnet.midenscan.com).
97
97
98
98
### What Happens During Execution
99
99
@@ -149,8 +149,8 @@ let note_package = Arc::new(
149
149
The `build_project_in_dir()` function:
150
150
151
151
- Takes the path to your contract's Rust source code
152
-
- Compiles the Rust code into Miden assembly
153
-
-Generates a package containing the compiled contract bytecode and metadata
152
+
- Compiles the Rust code into a Miden package (`.masp` file)
153
+
-The package contains the compiled contract bytecode and metadata
154
154
- This is equivalent to manually running `miden build` in each contract directory
155
155
156
156
These packages contain all the information needed to deploy and interact with your contracts on the Miden network.
0 commit comments