Skip to content

Commit 60a579f

Browse files
commiting restructure
1 parent 633bd14 commit 60a579f

27 files changed

+33
-33
lines changed

docs/miden/architecture/accounts.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ An account vault can be reduced to a single hash which is the root of the sparse
5151

5252
Interface for accounts. In Miden every account is a smart contract. It has an interface that exposes functions that can be called by note scripts. Functions exposed by the account have the following properties:
5353

54-
* Functions are actually roots of [Miden program MASTs](https://0xpolygonmiden.github.io/miden-vm/user-docs/assembly/main.html) (i.e., a 32-byte hash). Thus, function identifier is a commitment to the code which is executed when a function is invoked.
54+
* Functions are actually roots of [Miden program MASTs](https://0xpolygonmiden.github.io/miden-vm/specification/assembly/main.html) (i.e., a 32-byte hash). Thus, function identifier is a commitment to the code which is executed when a function is invoked.
5555
* Only account functions have mutable access to an account's storage and vault. Therefore, the only way to modify an account's internal state is through one of the account's functions.
5656
* Account functions can take parameters and can create new notes.
5757

docs/miden/architecture/notes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Asset container for a note. A note vault can contain up to `255` assets stored i
2121

2222
### Script
2323

24-
Unlike an account, a note has a single executable script. This script will be executed in a [transaction](transactions.md). This script is also the root of a [Miden program MAST](https://0xpolygonmiden.github.io/miden-vm/user-docs/assembly/main.html). A script is always executed in the context of a single account, and thus, may invoke account's functions. A note's script can call zero or more of an account's function.
24+
Unlike an account, a note has a single executable script. This script will be executed in a [transaction](transactions.md). This script is also the root of a [Miden program MAST](https://0xpolygonmiden.github.io/miden-vm/specification/assembly/main.html). A script is always executed in the context of a single account, and thus, may invoke account's functions. A note's script can call zero or more of an account's function.
2525

2626
!!! note
2727
Since code in Miden is expressed as MAST, every function is a commitment to the underlying code. The code cannot change unnoticed to the user because its hash would change.*

docs/miden/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ hide:
7575
</a>
7676
</div>
7777
<div class="grid-item">
78-
<a href="https://0xpolygonmiden.github.io/miden-vm/intro/main.html">
78+
<a href="./vm/intro/">
7979
<div class="product-list-item-header">
8080
<div class="feature-card-heading">Miden VM</div>
8181
</div>

docs/miden/vm/architecture/chiplets/kernel_rom.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
The kernel ROM enables executing predefined kernel procedures. These procedures are always executed in the root context and can only be accessed by a `SYSCALL` operation. The chiplet tracks and enforces correctness of all kernel procedure calls as well as maintaining a list of all the procedures defined for the kernel, whether they are executed or not. More background about Miden VM execution contexts can be found [here](../../user-docs/assembly/execution-contexts.md).
1+
The kernel ROM enables executing predefined kernel procedures. These procedures are always executed in the root context and can only be accessed by a `SYSCALL` operation. The chiplet tracks and enforces correctness of all kernel procedure calls as well as maintaining a list of all the procedures defined for the kernel, whether they are executed or not. More background about Miden VM execution contexts can be found [here](../../specification/assembly/execution-contexts.md).
22

33
## Kernel ROM trace
44

docs/miden/vm/architecture/programs.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ A *dyn* block must always have one (dynamically-specified) child. Thus, it canno
3535

3636
### Call block
3737

38-
A **call** block is used to describe a function call which is executed in a [user context](../user-docs/assembly/execution-contexts.md). When the VM encounters a *call* block, it creates a new user context, then executes a program which hashes to the target specified by the *call* block in the new context. Thus, in order to execute a *call* block, the VM must be aware of a program with the specified hash. Otherwise, the execution fails. At the end of the *call* block, execution returns to the previous context.
38+
A **call** block is used to describe a function call which is executed in a [user context](../specification/assembly/execution-contexts.md). When the VM encounters a *call* block, it creates a new user context, then executes a program which hashes to the target specified by the *call* block in the new context. Thus, in order to execute a *call* block, the VM must be aware of a program with the specified hash. Otherwise, the execution fails. At the end of the *call* block, execution returns to the previous context.
3939

4040

4141
When executing a *call* block, the VM does the following:
@@ -49,7 +49,7 @@ A *call* block does not have any children. Thus, it must be leaf node in the tre
4949

5050
### Syscall block
5151

52-
A **syscall** block is used to describe a function call which is executed in the [root context](../user-docs/assembly/execution-contexts.md). When the VM encounters a *syscall* block, it returns to the root context, then executes a program which hashes to the target specified by the *syscall* block. Thus, in order to execute a *syscall* block, the VM must be aware of a program with the specified hash, and that program must belong to the kernel against which the code is compiled. Otherwise, the execution fails. At the end of the *syscall* block, execution returns to the previous context.
52+
A **syscall** block is used to describe a function call which is executed in the [root context](../specification/assembly/execution-contexts.md). When the VM encounters a *syscall* block, it returns to the root context, then executes a program which hashes to the target specified by the *syscall* block. Thus, in order to execute a *syscall* block, the VM must be aware of a program with the specified hash, and that program must belong to the kernel against which the code is compiled. Otherwise, the execution fails. At the end of the *syscall* block, execution returns to the previous context.
5353

5454
When executing a *syscall* block, the VM does the following:
5555
1. Checks if a *syscall* is already being executed and fails if so.

docs/miden/vm/intro/overview.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Miden VM comes with a default implementation of the host interface (with an in-m
1515

1616
## Writing programs
1717

18-
Our goal is to make Miden VM an easy compilation target for high-level languages such as Rust, Move, Sway, and others. We believe it is important to let people write programs in the languages of their choice. However, compilers to help with this have not been developed yet. Thus, for now, the primary way to write programs for Miden VM is to use [Miden assembly](../user-docs/assembly/index.md).
18+
Our goal is to make Miden VM an easy compilation target for high-level languages such as Rust, Move, Sway, and others. We believe it is important to let people write programs in the languages of their choice. However, compilers to help with this have not been developed yet. Thus, for now, the primary way to write programs for Miden VM is to use [Miden assembly](../specification/assembly/index.md).
1919

2020
While writing programs in assembly is far from ideal, Miden assembly does make this task a little bit easier by supporting high-level flow control structures and named procedures.
2121

@@ -26,11 +26,11 @@ External inputs can be provided to Miden VM in two ways:
2626
1. Public inputs can be supplied to the VM by initializing the stack with desired values before a program starts executing. Any number of stack items can be initialized in this way, but providing a large number of public inputs will increase the cost for the verifier.
2727
2. Secret (or nondeterministic) inputs can be supplied to the VM via the [*advice provider*](#nondeterministic-inputs). There is no limit on how much data the advice provider can hold.
2828

29-
After a program finishes executing, the elements remaining on the stack become the outputs of the program. Since these outputs will be public inputs for the verifier, having a large stack at the end of execution will increase cost to the verifier. Therefore, it's best to drop unneeded output values. We've provided the [`truncate_stack`](../user-docs/stdlib/sys.md) utility function in the standard library for this purpose.
29+
After a program finishes executing, the elements remaining on the stack become the outputs of the program. Since these outputs will be public inputs for the verifier, having a large stack at the end of execution will increase cost to the verifier. Therefore, it's best to drop unneeded output values. We've provided the [`truncate_stack`](../specification/stdlib/sys.md) utility function in the standard library for this purpose.
3030

3131
The number of public inputs and outputs of a program can be reduced by making use of the advice stack and Merkle trees. Just 4 elements are sufficient to represent a root of a Merkle tree, which can be expanded into an arbitrary number of values.
3232

33-
For example, if we wanted to provide a thousand public input values to the VM, we could put these values into a Merkle tree, initialize the stack with the root of this tree, initialize the advice provider with the tree itself, and then retrieve values from the tree during program execution using `mtree_get` instruction (described [here](../user-docs/assembly/cryptographic-operations.md#hashing-and-merkle-trees)).
33+
For example, if we wanted to provide a thousand public input values to the VM, we could put these values into a Merkle tree, initialize the stack with the root of this tree, initialize the advice provider with the tree itself, and then retrieve values from the tree during program execution using `mtree_get` instruction (described [here](../specification/assembly/cryptographic-operations.md#hashing-and-merkle-trees)).
3434

3535
### Stack depth restrictions
3636

docs/miden/vm/user-docs/assembly/code-organization.md renamed to docs/miden/vm/specification/assembly/code-organization.md

File renamed without changes.

docs/miden/vm/user-docs/assembly/cryptographic-operations.md renamed to docs/miden/vm/specification/assembly/cryptographic-operations.md

File renamed without changes.
File renamed without changes.

docs/miden/vm/user-docs/assembly/execution-contexts.md renamed to docs/miden/vm/specification/assembly/execution-contexts.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ All programs start executing in a *root* context. Thus, the main procedure of a
55
While executing in a user context, we can request to execute some procedures in the root context. This can be done via the `syscall` instruction. The set of procedures which can be invoked via the `syscall` instruction is limited by the [kernel](#kernels) against which a program is compiled. Once the procedure called via `syscall` returns, the execution moves back to the user context from which it was invoked. The diagram below illustrates this graphically:
66

77
<center>
8-
![context transitions](../../../../img/miden/vm/user-docs/assembly/execution_contexts/context_transitions.png)
8+
![context transitions](../../../../img/miden/vm/specification/assembly/execution_contexts/context_transitions.png)
99
</center>
1010

1111
## Procedure invocation semantics
@@ -52,7 +52,7 @@ For user contexts we have the following:
5252
- The next $2^{30}$ words are reserved for memory locals of procedures executed in the same context (i.e., via the `exec` instruction).
5353
- The remaining address space has no special meaning.
5454

55-
![user memory layout](../../../../img/miden/vm/user-docs/assembly/execution_contexts/user_mem_layout.png)
55+
![user memory layout](../../../../img/miden/vm/specification/assembly/execution_contexts/user_mem_layout.png)
5656

5757
For the root context we have the following:
5858

@@ -61,7 +61,7 @@ For the root context we have the following:
6161
- The next $2^{30}$ words are reserved for memory locals of procedures executed from within a `syscall`.
6262
- The remaining address space has no special meaning.
6363

64-
![root memory layout](../../../../img/miden/vm/user-docs/assembly/execution_contexts/root_mem_layout.png)
64+
![root memory layout](../../../../img/miden/vm/specification/assembly/execution_contexts/root_mem_layout.png)
6565

6666
For both types of contexts, writing directly into regions of memory reserved for procedure locals is not advisable. Instead, `loc_load`, `loc_store` and other similar dedicated instructions should be used to access procedure locals.
6767

0 commit comments

Comments
 (0)