Background Material
Proofs of execution generated by Miden VM are based on STARKs. A STARK is a novel proof-of-computation scheme that allows you to create an efficiently verifiable proof that a computation was executed correctly. The scheme was developed by Eli Ben-Sasson, Michael Riabzev et al. at Technion - Israel Institute of Technology. STARKs do not require an initial trusted setup, and rely on very few cryptographic assumptions.
Here are some resources to learn more about STARKs:
diff --git a/design/chiplets/bitwise.html b/design/chiplets/bitwise.html index 86e32eba82..3c7b52c6e4 100644 --- a/design/chiplets/bitwise.html +++ b/design/chiplets/bitwise.html @@ -176,7 +176,7 @@Polygon Miden VM
Bitwise chiplet
In this note we describe how to compute bitwise AND and XOR operations on 32-bit values and the constraints required for proving correct execution.
Assume that and are field elements in a 64-bit prime field. Assume also that and are known to contain values smaller than . We want to compute , where is either bitwise AND or XOR, and is a field element containing the result of the corresponding bitwise operation.
diff --git a/design/chiplets/hasher.html b/design/chiplets/hasher.html index 7d2e7436ab..80feedb095 100644 --- a/design/chiplets/hasher.html +++ b/design/chiplets/hasher.html @@ -176,7 +176,7 @@Polygon Miden VM
Hash chiplet
Miden VM "offloads" all hash-related computations to a separate hash processor. This chiplet supports executing the Rescue Prime Optimized hash function (or rather a specific instantiation of it) in the following settings:
-
diff --git a/design/chiplets/kernel_rom.html b/design/chiplets/kernel_rom.html
index 738afe1479..a0ea3e8f86 100644
--- a/design/chiplets/kernel_rom.html
+++ b/design/chiplets/kernel_rom.html
@@ -176,7 +176,7 @@
- To prove the consistency of intermediate values that must persist between different cycles of the trace without storing the full data in the execution trace (which would require adding more columns to the trace). diff --git a/design/lookups/multiset.html b/design/lookups/multiset.html index 03a24f13fc..b2dd0308dc 100644 --- a/design/lookups/multiset.html +++ b/design/lookups/multiset.html @@ -176,7 +176,7 @@
- On Apple M1/M2 platforms the built-in GPU is used for a part of proof generation process.
- On the Graviton platform, SVE vector extension is used to accelerate RPO computations. - +
- Our Scaffolded repo can be cloned for starting a new Rust project using Miden VM.
- Miden Standard Library which provides descriptions of all procedures available in Miden Standard Library.
- When
syscall.baz
is executed the second time, execution moves into the root context again. However, now, whencaller
is executed insidebaz
, the first 4 elements of the stack are populated with the hash offoo
(notbar
). This happens because this time aroundbar
does not have its own context andbaz
is invoked fromfoo
's context. - Finally, when
baz
returns, execution moves back toctx1
, and then asbar
andfoo
return, back toctx0
, and the program terminates. - at the first and at the last row of execution trace.
- at the first and at the last row of execution trace.
Polygon Miden VM
Kernel ROM chiplet
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.
Kernel ROM trace
diff --git a/design/chiplets/main.html b/design/chiplets/main.html index 2d60809cef..ab5f68fd65 100644 --- a/design/chiplets/main.html +++ b/design/chiplets/main.html @@ -176,7 +176,7 @@Polygon Miden VM
Chiplets
The Chiplets module contains specialized components dedicated to accelerating complex computations. Each chiplet specializes in executing a specific type of computation and is responsible for proving both the correctness of its computations and its own internal consistency.
Currently, Miden VM relies on 4 chiplets:
diff --git a/design/chiplets/memory.html b/design/chiplets/memory.html index b7c560095f..a41aabbfae 100644 --- a/design/chiplets/memory.html +++ b/design/chiplets/memory.html @@ -176,7 +176,7 @@Polygon Miden VM
Memory chiplet
Miden VM supports linear read-write random access memory. This memory is word-addressable, meaning, four values are located at each address, and we can read and write values to/from memory in batches of four. Each value is a field element in a -bit prime field with modulus . Memory address can be any field element.
In this note we describe the rationale for selecting the above design and describe AIR constraints needed to support it.
diff --git a/design/decoder/constraints.html b/design/decoder/constraints.html index fbcfdfbc55..3357d4ae74 100644 --- a/design/decoder/constraints.html +++ b/design/decoder/constraints.html @@ -176,7 +176,7 @@Polygon Miden VM
Miden VM decoder AIR constraints
In this section we describe AIR constraint for Miden VM program decoder. These constraints enforce that the execution trace generated by the prover when executing a particular program complies with the rules described in the previous section.
To refer to decoder execution trace columns, we use the names shown on the diagram below (these are the same names as in the previous section). Additionally, we denote the register containing the value at the top of the stack as .
diff --git a/design/decoder/main.html b/design/decoder/main.html index 2f846d9565..9008e7ae2c 100644 --- a/design/decoder/main.html +++ b/design/decoder/main.html @@ -176,7 +176,7 @@Polygon Miden VM
Miden VM Program decoder
Miden VM program decoder is responsible for ensuring that a program with a given MAST root is executed by the VM. As the VM executes a program, the decoder does the following:
-
diff --git a/design/lookups/logup.html b/design/lookups/logup.html
index 95fcfd958a..0fbec1851f 100644
--- a/design/lookups/logup.html
+++ b/design/lookups/logup.html
@@ -176,7 +176,7 @@
Polygon Miden VM
LogUp: multivariate lookups with logarithmic derivatives
The description of LogUp can be found here. In MidenVM, LogUp is used to implement efficient communication buses.
Using the LogUp construction instead of a simple multiset check with running products reduces the computational effort for the prover and the verifier. Given two columns and in the main trace where contains duplicates and does not (i.e. is part of the lookup table), LogUp allows us to compute two logarithmic derivatives and check their equality.
diff --git a/design/lookups/main.html b/design/lookups/main.html index f30b21f5f3..1739ed2900 100644 --- a/design/lookups/main.html +++ b/design/lookups/main.html @@ -176,9 +176,9 @@Polygon Miden VM
Lookup arguments in Miden VM
-Zero knowledge virtual machines frequently make use of lookup arguments to enable performance optimizations. Miden VM uses two types of arguments: multiset checks and a multivariate lookup based on logarithmic derivatives known as LogUp. A brief introduction to multiset checks can be found here. The description of LogUp can be found here.
+Zero knowledge virtual machines frequently make use of lookup arguments to enable performance optimizations. Miden VM uses two types of arguments: multiset checks and a multivariate lookup based on logarithmic derivatives known as LogUp. A brief introduction to multiset checks can be found here. The description of LogUp can be found here.
In Miden VM, lookup arguments are used for two purposes:
Polygon Miden VM
Multiset checks
A brief introduction to multiset checks can be found here. In Miden VM, multiset checks are used to implement virtual tables and efficient communication buses.
Running product columns
diff --git a/design/main.html b/design/main.html index 3fc2826844..ec3348a639 100644 --- a/design/main.html +++ b/design/main.html @@ -176,7 +176,7 @@Polygon Miden VM
Design
In the following sections, we provide in-depth descriptions of Miden VM internals, including all AIR constraints for the proving system. We also provide rationale for making specific design choices.
Throughout these sections we adopt the following notations and assumptions:
diff --git a/design/programs.html b/design/programs.html index 050c14ab20..733ba4ddc2 100644 --- a/design/programs.html +++ b/design/programs.html @@ -176,7 +176,7 @@Polygon Miden VM
Programs in Miden VM
Miden VM consumes programs in a form of a Merkelized Abstract Syntax Tree (MAST). This tree is a binary tree where each node is a code block. The VM starts execution at the root of the tree, and attempts to recursively execute each required block according to its semantics. If the execution of a code block fails, the VM halts at that point and no further blocks are executed. A set of currently available blocks and their execution semantics are described below.
Code blocks
diff --git a/design/range.html b/design/range.html index e4371a1ef8..bd5babe355 100644 --- a/design/range.html +++ b/design/range.html @@ -176,7 +176,7 @@Polygon Miden VM
Range Checker
Miden VM relies very heavily on 16-bit range-checks (checking if a value of a field element is between and ). For example, most of the u32 operations need to perform between two and four 16-bit range-checks per operation. Similarly, operations involving memory (e.g. load and store) require two 16-bit range-checks per operation.
Thus, it is very important for the VM to be able to perform a large number of 16-bit range checks very efficiently. In this note we describe how this can be achieved using the LogUp lookup argument.
diff --git a/design/stack/crypto_ops.html b/design/stack/crypto_ops.html index aca7d49124..cc631f8d72 100644 --- a/design/stack/crypto_ops.html +++ b/design/stack/crypto_ops.html @@ -176,7 +176,7 @@Polygon Miden VM
Cryptographic operations
In this section we describe the AIR constraints for Miden VM cryptographic operations.
Cryptographic operations in Miden VM are performed by the Hash chiplet. Communication between the stack and the hash chiplet is accomplished via the chiplet bus . To make requests to and to read results from the chiplet bus we need to divide its current value by the value representing the request.
diff --git a/design/stack/field_ops.html b/design/stack/field_ops.html index c0a0efcffd..40fa2d1df3 100644 --- a/design/stack/field_ops.html +++ b/design/stack/field_ops.html @@ -176,7 +176,7 @@Polygon Miden VM
Field Operations
In this section we describe the AIR constraints for Miden VM field operations (i.e., arithmetic operations over field elements).
ADD
diff --git a/design/stack/io_ops.html b/design/stack/io_ops.html index 5fb675d9b6..1298681271 100644 --- a/design/stack/io_ops.html +++ b/design/stack/io_ops.html @@ -176,7 +176,7 @@Polygon Miden VM
Input / output operations
In this section we describe the AIR constraints for Miden VM input / output operations. These operations move values between the stack and other components of the VM such as program code (i.e., decoder), memory, and advice provider.
PUSH
diff --git a/design/stack/main.html b/design/stack/main.html index 0f2800d16d..f134cd9b68 100644 --- a/design/stack/main.html +++ b/design/stack/main.html @@ -176,7 +176,7 @@Polygon Miden VM
Operand stack
Miden VM is a stack machine. The stack is a push-down stack of practically unlimited depth (in practical terms, the depth will never exceed ), but only the top items are directly accessible to the VM. Items on the stack are elements in a prime field with modulus .
To keep the constraint system for the stack manageable, we impose the following rules:
diff --git a/design/stack/op_constraints.html b/design/stack/op_constraints.html index 36cf12831d..eee0fc0540 100644 --- a/design/stack/op_constraints.html +++ b/design/stack/op_constraints.html @@ -176,7 +176,7 @@Polygon Miden VM
Stack operation constraints
In addition to the constraints described in the previous section, we need to impose constraints to check that each VM operation is executed correctly.
For this purpose the VM exposes a set of operation-specific flags. These flags are set to when a given operation is executed, and to otherwise. The naming convention for these flags is . For example, would be set to when DUP
operation is executed, and to otherwise. Operation flags are discussed in detail in the section below.
Polygon Miden VM
Stack Manipulation
In this section we describe the AIR constraints for Miden VM stack manipulation operations.
PAD
diff --git a/design/stack/system_ops.html b/design/stack/system_ops.html index a501f825a4..08543df7a1 100644 --- a/design/stack/system_ops.html +++ b/design/stack/system_ops.html @@ -176,7 +176,7 @@Polygon Miden VM
System Operations
In this section we describe the AIR constraints for Miden VM system operations.
NOOP
diff --git a/design/stack/u32_ops.html b/design/stack/u32_ops.html index 8432a13045..d9a8d58586 100644 --- a/design/stack/u32_ops.html +++ b/design/stack/u32_ops.html @@ -176,7 +176,7 @@Polygon Miden VM
u32 Operations
In this section we describe semantics and AIR constraints of operations over u32 values (i.e., 32-bit unsigned integers) as they are implemented in Miden VM.
Range checks
diff --git a/index.html b/index.html index a8f38a026d..4610d34ba8 100644 --- a/index.html +++ b/index.html @@ -176,7 +176,7 @@Polygon Miden VM
Introduction
Miden VM is a zero-knowledge virtual machine written in Rust. For any program executed on Miden VM, a STARK-based proof of execution is automatically generated. This proof can then be used by anyone to verify that the program was executed correctly without the need for re-executing the program or even knowing the contents of the program.
Status and features
diff --git a/intro/main.html b/intro/main.html index 1901a40fb4..fc428fe310 100644 --- a/intro/main.html +++ b/intro/main.html @@ -176,7 +176,7 @@Polygon Miden VM
Introduction
Miden VM is a zero-knowledge virtual machine written in Rust. For any program executed on Miden VM, a STARK-based proof of execution is automatically generated. This proof can then be used by anyone to verify that the program was executed correctly without the need for re-executing the program or even knowing the contents of the program.
Status and features
diff --git a/intro/overview.html b/intro/overview.html index 94e81b75e4..f4ed626687 100644 --- a/intro/overview.html +++ b/intro/overview.html @@ -176,7 +176,7 @@Polygon Miden VM
Miden VM overview
Miden VM is a stack machine. The base data type of the MV is a field element in a 64-bit prime field defined by modulus . This means that all values that the VM operates with are field elements in this field (i.e., values between and , both inclusive).
Miden VM consists of four high-level components as illustrated below.
diff --git a/intro/performance.html b/intro/performance.html index 59b54a0246..44dbf429ac 100644 --- a/intro/performance.html +++ b/intro/performance.html @@ -176,7 +176,7 @@Polygon Miden VM
Performance
The benchmarks below should be viewed only as a rough guide for expected future performance. The reasons for this are twofold:
-
diff --git a/intro/usage.html b/intro/usage.html
index d094eacd1a..2ae778206d 100644
--- a/intro/usage.html
+++ b/intro/usage.html
@@ -176,7 +176,7 @@
Polygon Miden VM
Usage
Before you can use Miden VM, you'll need to make sure you have Rust installed. Miden VM v0.8 requires Rust version 1.75 or later.
Miden VM consists of several crates, each of which exposes a small set of functionality. The most notable of these crates are:
diff --git a/print.html b/print.html index 4a1ee1310d..09a836939b 100644 --- a/print.html +++ b/print.html @@ -177,7 +177,7 @@Polygon Miden VM
Introduction
Miden VM is a zero-knowledge virtual machine written in Rust. For any program executed on Miden VM, a STARK-based proof of execution is automatically generated. This proof can then be used by anyone to verify that the program was executed correctly without the need for re-executing the program or even knowing the contents of the program.
Status and features
@@ -213,7 +213,7 @@License
Licensed under the MIT license.
- +Miden VM overview
Miden VM is a stack machine. The base data type of the MV is a field element in a 64-bit prime field defined by modulus . This means that all values that the VM operates with are field elements in this field (i.e., values between and , both inclusive).
Miden VM consists of four high-level components as illustrated below.
@@ -253,7 +253,7 @@Usage
Before you can use Miden VM, you'll need to make sure you have Rust installed. Miden VM v0.8 requires Rust version 1.75 or later.
Miden VM consists of several crates, each of which exposes a small set of functionality. The most notable of these crates are:
@@ -356,7 +356,7 @@Fibonacci
./target/optimized/miden run -a miden/examples/fib/fib.masm -o fib.out
This will dump the output of the program into the fib.out
file. The output file will contain the state of the stack at the end of the program execution.
-
+
Performance
The benchmarks below should be viewed only as a rough guide for expected future performance. The reasons for this are twofold:
@@ -418,7 +418,7 @@ Recursive p
Development Tools and Resources
The following tools are available for interacting with Miden VM:
@@ -440,7 +440,7 @@ Miden VM examples repo contains examples of programs written in Miden Assembly.
-
+
Miden Debugger
The Miden debugger is a command-line interface (CLI) application, inspired by GNU gdb, which allows debugging of Miden assembly (MASM) programs. The debugger allows the user to step through the execution of the program, both forward and backward, either per clock cycle tick, or via breakpoints.
The Miden debugger supports the following commands:
@@ -486,7 +486,7 @@ Miden Debugger<
exec.foo
end
-
+
Miden REPL
The Miden Read–eval–print loop (REPL) is a Miden shell that allows for quick and easy debugging of Miden assembly. After the REPL gets initialized, you can execute any Miden instruction, undo executed instructions, check the state of the stack and memory at a given point, and do many other useful things! When the REPL is exited, a history.txt
file is saved. One thing to note is that all the REPL native commands start with an !
to differentiate them from regular assembly instructions.
Miden REPL can be started via the CLI repl command like so:
@@ -601,7 +601,7 @@ !undo
>> !undo
3 2 1 0 0 0 0 0 0 0 0 0 0 0 0 0
-
+
User Documentation
In the following sections, we provide developer-focused documentation useful to those who want to develop on Miden VM or build compilers from higher-level languages to Miden VM.
This documentation consists of two high-level sections:
@@ -610,7 +610,7 @@ User Do
For info on how to run programs on Miden VM, please refer to the usage section in the introduction.
-
+
Miden Assembly
Miden assembly is a simple, low-level language for writing programs for Miden VM. It stands just above raw Miden VM instruction set, and in fact, many instructions of Miden assembly map directly to raw instructions of Miden VM.
Before Miden assembly can be executed on Miden VM, it needs to be compiled into a Program MAST (Merkelized Abstract Syntax Tree) which is a binary tree of code blocks each containing raw Miden VM instructions.
@@ -644,7 +644,7 @@ Design goalsIn order to achieve the second and third goals, Miden assembly facilitates flow control via high-level constructs like while
loops, if-else
statements, and function calls with statically defined targets. Thus, for example, there are no explicit jump
instructions.
In order to achieve the fourth goal, Miden assembly retains direct access to the VM stack rather than abstracting it away with higher-level constructs and named variables.
Lastly, in order to achieve the fifth goal, each instruction of Miden assembly can be encoded using a single byte. The resulting byte-code is simply a one-to-one mapping of instructions to their binary values.
-
+
Code organization
A Miden assembly program is just a sequence of instructions each describing a specific directive or an operation. You can use any combination of whitespace characters to separate one instruction from another.
In turn, Miden assembly instructions are just keywords which can be parameterized by zero or more parameters. The notation for specifying parameters is keyword.param1.param2 - i.e., the parameters are separated by periods. For example, push.123
instruction denotes a push
operation which is parameterized by value 123
.
@@ -782,7 +782,7 @@ Comments
end
Documentation comments must precede a procedure declaration. Using them inside a procedure body is an error.
-
+
Execution contexts
Miden assembly program execution can span multiple isolated contexts. An execution context defines its own memory space which is not accessible from other execution contexts.
All programs start executing in a root context. Thus, the main procedure of a program is always executed in the root context. To move execution into a different context, we can invoke a procedure using the call
instruction. In fact, any time we invoke a procedure using the call
instruction, the procedure is executed in a new context. We refer to all non-root contexts as user contexts.
@@ -880,7 +880,7 @@ Example
-
+
Flow control
As mentioned above, Miden assembly provides high-level constructs to facilitate flow control. These constructs are:
./target/optimized/miden run -a miden/examples/fib/fib.masm -o fib.out
fib.out
file. The output file will contain the state of the stack at the end of the program execution.Recursive p
Development Tools and Resources
The following tools are available for interacting with Miden VM:
@@ -440,7 +440,7 @@ Miden VM examples repo contains examples of programs written in Miden Assembly.
-
+
Miden Debugger
The Miden debugger is a command-line interface (CLI) application, inspired by GNU gdb, which allows debugging of Miden assembly (MASM) programs. The debugger allows the user to step through the execution of the program, both forward and backward, either per clock cycle tick, or via breakpoints.
The Miden debugger supports the following commands:
@@ -486,7 +486,7 @@ Miden Debugger<
exec.foo
end
-
+
Miden REPL
The Miden Read–eval–print loop (REPL) is a Miden shell that allows for quick and easy debugging of Miden assembly. After the REPL gets initialized, you can execute any Miden instruction, undo executed instructions, check the state of the stack and memory at a given point, and do many other useful things! When the REPL is exited, a history.txt
file is saved. One thing to note is that all the REPL native commands start with an !
to differentiate them from regular assembly instructions.
Miden REPL can be started via the CLI repl command like so:
@@ -601,7 +601,7 @@ !undo
>> !undo
3 2 1 0 0 0 0 0 0 0 0 0 0 0 0 0
-
+
User Documentation
In the following sections, we provide developer-focused documentation useful to those who want to develop on Miden VM or build compilers from higher-level languages to Miden VM.
This documentation consists of two high-level sections:
@@ -610,7 +610,7 @@ User Do
For info on how to run programs on Miden VM, please refer to the usage section in the introduction.
-
+
Miden Assembly
Miden assembly is a simple, low-level language for writing programs for Miden VM. It stands just above raw Miden VM instruction set, and in fact, many instructions of Miden assembly map directly to raw instructions of Miden VM.
Before Miden assembly can be executed on Miden VM, it needs to be compiled into a Program MAST (Merkelized Abstract Syntax Tree) which is a binary tree of code blocks each containing raw Miden VM instructions.
@@ -644,7 +644,7 @@ Design goalsIn order to achieve the second and third goals, Miden assembly facilitates flow control via high-level constructs like while
loops, if-else
statements, and function calls with statically defined targets. Thus, for example, there are no explicit jump
instructions.
In order to achieve the fourth goal, Miden assembly retains direct access to the VM stack rather than abstracting it away with higher-level constructs and named variables.
Lastly, in order to achieve the fifth goal, each instruction of Miden assembly can be encoded using a single byte. The resulting byte-code is simply a one-to-one mapping of instructions to their binary values.
-
+
Code organization
A Miden assembly program is just a sequence of instructions each describing a specific directive or an operation. You can use any combination of whitespace characters to separate one instruction from another.
In turn, Miden assembly instructions are just keywords which can be parameterized by zero or more parameters. The notation for specifying parameters is keyword.param1.param2 - i.e., the parameters are separated by periods. For example, push.123
instruction denotes a push
operation which is parameterized by value 123
.
@@ -782,7 +782,7 @@ Comments
end
Documentation comments must precede a procedure declaration. Using them inside a procedure body is an error.
-
+
Execution contexts
Miden assembly program execution can span multiple isolated contexts. An execution context defines its own memory space which is not accessible from other execution contexts.
All programs start executing in a root context. Thus, the main procedure of a program is always executed in the root context. To move execution into a different context, we can invoke a procedure using the call
instruction. In fact, any time we invoke a procedure using the call
instruction, the procedure is executed in a new context. We refer to all non-root contexts as user contexts.
@@ -880,7 +880,7 @@ Example
Miden VM examples repo contains examples of programs written in Miden Assembly.
Miden REPL
The Miden Read–eval–print loop (REPL) is a Miden shell that allows for quick and easy debugging of Miden assembly. After the REPL gets initialized, you can execute any Miden instruction, undo executed instructions, check the state of the stack and memory at a given point, and do many other useful things! When the REPL is exited, a history.txt
file is saved. One thing to note is that all the REPL native commands start with an !
to differentiate them from regular assembly instructions.
Miden REPL can be started via the CLI repl command like so:
@@ -601,7 +601,7 @@!undo
>> !undo 3 2 1 0 0 0 0 0 0 0 0 0 0 0 0 0 - +User Documentation
In the following sections, we provide developer-focused documentation useful to those who want to develop on Miden VM or build compilers from higher-level languages to Miden VM.
This documentation consists of two high-level sections:
@@ -610,7 +610,7 @@User Do
For info on how to run programs on Miden VM, please refer to the usage section in the introduction.
-
+
Miden Assembly
Miden assembly is a simple, low-level language for writing programs for Miden VM. It stands just above raw Miden VM instruction set, and in fact, many instructions of Miden assembly map directly to raw instructions of Miden VM.
Before Miden assembly can be executed on Miden VM, it needs to be compiled into a Program MAST (Merkelized Abstract Syntax Tree) which is a binary tree of code blocks each containing raw Miden VM instructions.
@@ -644,7 +644,7 @@ Design goalsIn order to achieve the second and third goals, Miden assembly facilitates flow control via high-level constructs like while
loops, if-else
statements, and function calls with statically defined targets. Thus, for example, there are no explicit jump
instructions.
In order to achieve the fourth goal, Miden assembly retains direct access to the VM stack rather than abstracting it away with higher-level constructs and named variables.
Lastly, in order to achieve the fifth goal, each instruction of Miden assembly can be encoded using a single byte. The resulting byte-code is simply a one-to-one mapping of instructions to their binary values.
-
+
Code organization
A Miden assembly program is just a sequence of instructions each describing a specific directive or an operation. You can use any combination of whitespace characters to separate one instruction from another.
In turn, Miden assembly instructions are just keywords which can be parameterized by zero or more parameters. The notation for specifying parameters is keyword.param1.param2 - i.e., the parameters are separated by periods. For example, push.123
instruction denotes a push
operation which is parameterized by value 123
.
@@ -782,7 +782,7 @@ Comments
end
Documentation comments must precede a procedure declaration. Using them inside a procedure body is an error.
-
+
Execution contexts
Miden assembly program execution can span multiple isolated contexts. An execution context defines its own memory space which is not accessible from other execution contexts.
All programs start executing in a root context. Thus, the main procedure of a program is always executed in the root context. To move execution into a different context, we can invoke a procedure using the call
instruction. In fact, any time we invoke a procedure using the call
instruction, the procedure is executed in a new context. We refer to all non-root contexts as user contexts.
@@ -880,7 +880,7 @@ Example
while
loops, if-else
statements, and function calls with statically defined targets. Thus, for example, there are no explicit jump
instructions.
push.123
instruction denotes a push
operation which is parameterized by value 123
.call
instruction. In fact, any time we invoke a procedure using the call
instruction, the procedure is executed in a new context. We refer to all non-root contexts as user contexts.Field operations
Miden assembly provides a set of instructions which can perform operations with raw field elements. These instructions are described in the tables below.
While most operations place no restrictions on inputs, some operations expect inputs to be binary values, and fail if executed with non-binary inputs.
@@ -1001,7 +1001,7 @@
Fails if
ext2div
- (11 cycles)
[b1, b0, a1, a0, ...] [c1, c0,] fails if , where multiplication and inversion are as defined by the operations above
-
- (11 cycles)
u32 operations
Miden assembly provides a set of instructions which can perform operations on regular two-complement 32-bit integers. These instructions are described in the tables below.
For instructions where one or more operands can be provided as immediate parameters (e.g., u32wrapping_add
and u32wrapping_add.b
), we provide stack transition diagrams only for the non-immediate version. For the immediate version, it can be assumed that the operand with the specified name is not present on the stack.
Undefined if
u32max
- (9 cycles) [b, a, ...] [c, ...]
Undefined if
-
- (9 cycles)
Undefined if
Stack manipulation
Miden VM stack is a push-down stack of field elements. The stack has a maximum depth of , but only the top elements are directly accessible via the instructions listed below.
In addition to the typical stack manipulation instructions such as drop
, dup
, swap
etc., Miden assembly provides several conditional instructions which can be used to manipulate the stack based on some condition - e.g., conditional swap cswap
or conditional drop cdrop
.
Fails if
cdropw
- (5 cycles) [c, B, A, ... ] [D, ... ]
Fails if
-
- (5 cycles)
Fails if
Input / output operations
Miden assembly provides a set of instructions for moving data between the operand stack and several other sources. These sources include:
-
@@ -1167,7 +1167,7 @@
Ran
Unlike regular memory, procedure locals are not guaranteed to be initialized to zeros. Thus, when working with locals, one must assume that before a local memory address has been written to, it contains "garbage".
Internally in the VM, procedure locals are stored at memory offset stating at . Thus, every procedure local has an absolute address in regular memory. The locaddr.i
instruction is provided specifically to map an index of a procedure's local to an absolute address so that it can be passed to downstream procedures, when needed.
Cryptographic operations
Miden assembly provides a set of instructions for performing common cryptographic operations. These instructions are listed in the table below.
Hashing and Merkle trees
@@ -1181,7 +1181,7 @@at depth and index . Merkle tree with root must be present in the advice provider, otherwise execution fails. - opens to node
Events
Miden assembly supports the concept of events. Events are a simple data structure with a single event_id
field. When an event is emitted by a program, it is communicated to the host. Events can be emitted at specific points of program execution with the intent of triggering some action on the host. This is useful as the program has contextual information that would be challenging for the host to infer. The emission of events allows the program to communicate this contextual information to the host. The host contains an event handler that is responsible for handling events and taking appropriate actions. The emission of events does not change the state of the VM but it can change the state of the host.
An event can be emitted via the emit.<event_id>
assembly instruction where <event_id>
can be any 32-bit value specified either directly or via a named constant. For example:
Tracing
trace.2To make use of the trace
instruction, programs should be ran with tracing flag (-t
or --tracing
), otherwise these instructions will be ignored.
Debugging
To support basic debugging capabilities, Miden assembly provides a debug
instruction. This instruction prints out the state of the VM at the time when the debug
instruction is executed. The instruction can be parameterized as follows:
-
@@ -1210,7 +1210,7 @@
Debugging
Debug instructions do not affect the VM state and do not change the program hash.
To make use of the debug
instruction, programs must be compiled with an assembler instantiated in the debug mode. Otherwise, the assembler will simply ignore the debug
instructions.
Miden Standard Library
Miden standard library provides a set of procedures which can be used by any Miden program. These procedures build on the core instruction set of Miden assembly expanding the functionality immediately available to the user.
The goals of Miden standard library are:
@@ -1241,7 +1241,7 @@Available
std::mem Contains procedures for working with random access memory.
std::sys Contains system-level utility procedures.
-
Collections
Namespace std::collections
contains modules for commonly-used authenticated data structures. This includes:
Digital signatures
Namespace std::crypto::dsa
contains a set of digital signature schemes supported by default in the Miden VM. Currently, these schemes are:
-
@@ -1278,7 +1278,7 @@
RPO Falcon512
Procedure Description
verify Verifies a signature against a public key and a message. The procedure gets as inputs the hash of the public key and the hash of the message via the operand stack. The signature is expected to be provided via the advice provider.
The signature is valid if and only if the procedure returns.
Inputs: [PK, MSG, ...]
Outputs: [...]
Where PK
is the hash of the public key and MSG
is the hash of the message. Both hashes are expected to be computed using RPO
hash function.
The procedure relies on the adv.push_sig
decorator to retrieve the signature from the host. The default host implementation assumes that the private-public key pair is loaded into the advice provider, and uses it to generate the signature. However, for production grade implementations, this functionality should be overridden to ensure more secure handling of private keys.
-
+
Procedure | Description |
---|---|
verify | Verifies a signature against a public key and a message. The procedure gets as inputs the hash of the public key and the hash of the message via the operand stack. The signature is expected to be provided via the advice provider. The signature is valid if and only if the procedure returns. Inputs: [PK, MSG, ...] Outputs: [...] Where PK is the hash of the public key and MSG is the hash of the message. Both hashes are expected to be computed using RPO hash function.The procedure relies on the adv.push_sig decorator to retrieve the signature from the host. The default host implementation assumes that the private-public key pair is loaded into the advice provider, and uses it to generate the signature. However, for production grade implementations, this functionality should be overridden to ensure more secure handling of private keys. |
FRI verification procedures
Namespace std::crypto::fri
contains modules for verifying FRI proofs.
FRI Extension 2, Fold 4
@@ -1286,7 +1286,7 @@Procedure | Description |
---|---|
verify | Verifies a FRI proof where the proof was generated over the quadratic extension of the base field and layer folding was performed using folding factor 4. Input: [query_start_ptr, query_end_ptr, layer_ptr, rem_ptr, g, ...] >Output: [...] - query_start_ptr is a pointer to a list of tuples of the form (e0, e1, p, 0) where p is a query index at the first layer and (e0, e1) is an extension field element corresponding to the value of the first layer at index p.- query_end_ptr is a pointer to the first empty memory address after the last (e0, e1, p, 0) tuple.- layer_ptr is a pointer to the first layer commitment denoted throughout the code by C. layer_ptr + 1 points to the first (alpha0, alpha1, t_depth, d_size) where d_size is the size of initial domain divided by 4, t_depth is the depth of the Merkle tree commitment to the first layer and (alpha0, alpha1) is the first challenge used in folding the first layer. Both t_depth and d_size are expected to be smaller than 2^32. Otherwise, the result of this procedure is undefined.- rem_ptr is a pointer to the first tuple of two consecutive degree 2 extension field elements making up the remainder codeword. This codeword can be of length either 32 or 64.The memory referenced above is used contiguously, as follows: [layer_ptr ... rem_ptr ... query_start_ptr ... query_end_ptr] This means for example that: 1. rem_ptr - 1 points to the last (alpha0, alpha1, t_depth, d_size) tuple.2. The length of the remainder codeword is 2 * (rem_ptr - query_start_ptr) .Cycles: for domains of size 2^n where:- n is even: 12 + 6 + num_queries * (40 + num_layers * 76 + 69) + 2626- n is odd: 12 + 6 + num_queries * (40 + num_layers * 76 + 69) + 1356 |
Cryptographic hashes
Namespace std::crypto
contains modules for commonly used cryptographic hash functions.
BLAKE3
@@ -1302,7 +1302,7 @@SHA256
Input: 32-bytes stored in the first 8 elements of the stack (32 bits per element).
Output: A 32-byte digest stored in the first 8 elements of stack (32 bits per element).
Input: 64-bytes stored in the first 16 elements of the stack (32 bits per element).
Output: A 32-byte digest stored in the first 8 elements of stack (32 bits per element).
Unsigned 64-bit integer operations
Module std::math::u64
contains a set of procedures which can be used to perform unsigned 64-bit integer operations. These operations fall into the following categories:
Memory procedures
Module std::mem
contains a set of utility procedures for working with random access memory.
System procedures
Module std::sys
contains a set of system-level utility procedures.
Procedure | Description |
---|---|
truncate_stack | Removes elements deep in the stack until the depth of the stack is exactly 16. The elements are removed in such a way that the top 16 elements of the stack remain unchanged. If the stack would otherwise contain more than 16 elements at the end of execution, then adding a call to this function at the end will reduce the size of the public inputs that are shared with the verifier. Input: Stack with 16 or more elements. Output: Stack with only the original top 16 elements. |
Design
In the following sections, we provide in-depth descriptions of Miden VM internals, including all AIR constraints for the proving system. We also provide rationale for making specific design choices.
Throughout these sections we adopt the following notations and assumptions:
@@ -1420,7 +1420,7 @@VM exec
-
+
Programs in Miden VM
Miden VM consumes programs in a form of a Merkelized Abstract Syntax Tree (MAST). This tree is a binary tree where each node is a code block. The VM starts execution at the root of the tree, and attempts to recursively execute each required block according to its semantics. If the execution of a code block fails, the VM halts at that point and no further blocks are executed. A set of currently available blocks and their execution semantics are described below.
Code blocks
@@ -1524,7 +1524,7 @@
Miden VM Program decoder
Miden VM program decoder is responsible for ensuring that a program with a given MAST root is executed by the VM. As the VM executes a program, the decoder does the following:
-
@@ -1983,7 +1983,7 @@
States of block hash and block stack tables after step 6:
- +Miden VM decoder AIR constraints
In this section we describe AIR constraint for Miden VM program decoder. These constraints enforce that the execution trace generated by the prover when executing a particular program complies with the rules described in the previous section.
To refer to decoder execution trace columns, we use the names shown on the diagram below (these are the same names as in the previous section). Additionally, we denote the register containing the value at the top of the stack as .
@@ -2335,7 +2335,7 @@In addition to the above transition constraint, we also need to impose boundary constraints against the column to make sure the first and the last value in the column is set to . This enforces that the op group table table starts and ends in an empty state.
-
+
Operand stack
Miden VM is a stack machine. The stack is a push-down stack of practically unlimited depth (in practical terms, the depth will never exceed ), but only the top items are directly accessible to the VM. Items on the stack are elements in a prime field with modulus .
To keep the constraint system for the stack manageable, we impose the following rules:
@@ -2491,7 +2491,7 @@ Bou
.
Stack operation constraints
In addition to the constraints described in the previous section, we need to impose constraints to check that each VM operation is executed correctly.
For this purpose the VM exposes a set of operation-specific flags. These flags are set to when a given operation is executed, and to otherwise. The naming convention for these flags is . For example, would be set to when DUP
operation is executed, and to otherwise. Operation flags are discussed in detail in the section below.
Control f
-
+
System Operations
In this section we describe the AIR constraints for Miden VM system operations.
NOOP
@@ -2760,7 +2760,7 @@ CLK
- Right shift starting from position .
-
+
Field Operations
In this section we describe the AIR constraints for Miden VM field operations (i.e., arithmetic operations over field elements).
ADD
@@ -2954,7 +2954,7 @@ EXT2MUL
- No change starting from position .
-
+
u32 Operations
In this section we describe semantics and AIR constraints of operations over u32 values (i.e., 32-bit unsigned integers) as they are implemented in Miden VM.
Range checks
@@ -3153,7 +3153,7 @@ U32XOR
- Left shift starting from position .
-
+
Stack Manipulation
In this section we describe the AIR constraints for Miden VM stack manipulation operations.
PAD
@@ -3325,7 +3325,7 @@ CSWAPW
- Left shift starting from position .
-
+
Input / output operations
In this section we describe the AIR constraints for Miden VM input / output operations. These operations move values between the stack and other components of the VM such as program code (i.e., decoder), memory, and advice provider.
PUSH
@@ -3468,7 +3468,7 @@ MSTREAM
- No change starting from position except position .
-
+
Cryptographic operations
In this section we describe the AIR constraints for Miden VM cryptographic operations.
Cryptographic operations in Miden VM are performed by the Hash chiplet. Communication between the stack and the hash chiplet is accomplished via the chiplet bus . To make requests to and to read results from the chiplet bus we need to divide its current value by the value representing the request.
@@ -3611,7 +3611,7 @@ RCOMBBASE
-
+
Range Checker
Miden VM relies very heavily on 16-bit range-checks (checking if a value of a field element is between and ). For example, most of the u32 operations need to perform between two and four 16-bit range-checks per operation. Similarly, operations involving memory (e.g. load and store) require two 16-bit range-checks per operation.
Thus, it is very important for the VM to be able to perform a large number of 16-bit range checks very efficiently. In this note we describe how this can be achieved using the LogUp lookup argument.
@@ -3726,7 +3726,7 @@ Communica
The value of in the first row .
The value of in the last row .
-
+
Chiplets
The Chiplets module contains specialized components dedicated to accelerating complex computations. Each chiplet specializes in executing a specific type of computation and is responsible for proving both the correctness of its computations and its own internal consistency.
Currently, Miden VM relies on 4 chiplets:
@@ -3872,7 +3872,7 @@
-
+
Hash chiplet
Miden VM "offloads" all hash-related computations to a separate hash processor. This chiplet supports executing the Rescue Prime Optimized hash function (or rather a specific instantiation of it) in the following settings:
@@ -4175,7 +4175,7 @@ as a part of computing the old Merkle root, the same node must be removed from as a part of computing the new Merkle root. These two boundary constraints are described as part of the at the first and last rows of the running product column which implements the sibling table, the above constraints ensure that if a node was included into chiplets virtual table constraints.
-
+
Bitwise chiplet
In this note we describe how to compute bitwise AND and XOR operations on 32-bit values and the constraints required for proving correct execution.
Assume that and are field elements in a 64-bit prime field. Assume also that and are known to contain values smaller than . We want to compute , where is either bitwise AND or XOR, and is a field element containing the result of the corresponding bitwise operation.
@@ -4276,7 +4276,7 @@
-
+
Memory chiplet
Miden VM supports linear read-write random access memory. This memory is word-addressable, meaning, four values are located at each address, and we can read and write values to/from memory in batches of four. Each value is a field element in a -bit prime field with modulus . Memory address can be any field element.
In this note we describe the rationale for selecting the above design and describe AIR constraints needed to support it.
@@ -4438,7 +4438,7 @@
On the stack side, for every memory access request, a corresponding value is divided out of the column. Specifics of how this is done are described here.
-
+
Kernel ROM chiplet
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.
Kernel ROM trace
@@ -4495,9 +4495,9 @@ , but when , the above becomes .
We also need to impose boundary constraints to make sure that running product column implementing the kernel procedure table is equal to when the kernel procedure table begins and to the product of all unique kernel functions when it ends. The last boundary constraint means that the verifier only needs to know which kernel was used, but doesn't need to know which functions were invoked within the kernel. These two constraints are described as part of the chiplets virtual table constraints.
-
+
Lookup arguments in Miden VM
-Zero knowledge virtual machines frequently make use of lookup arguments to enable performance optimizations. Miden VM uses two types of arguments: multiset checks and a multivariate lookup based on logarithmic derivatives known as LogUp. A brief introduction to multiset checks can be found here. The description of LogUp can be found here.
+Zero knowledge virtual machines frequently make use of lookup arguments to enable performance optimizations. Miden VM uses two types of arguments: multiset checks and a multivariate lookup based on logarithmic derivatives known as LogUp. A brief introduction to multiset checks can be found here. The description of LogUp can be found here.
In Miden VM, lookup arguments are used for two purposes:
- To prove the consistency of intermediate values that must persist between different cycles of the trace without storing the full data in the execution trace (which would require adding more columns to the trace).
@@ -4547,7 +4547,7 @@ Cost of auxiliary columns for lookup arguments
It is important to note that depending on the field in which we operate, an auxiliary column implementing a lookup argument may actually require more than one trace column. This is specifically true for small fields.
Since Miden uses a 64-bit field, each auxiliary column needs to be represented by columns to achieve ~100-bit security and by columns to achieve ~128-bit security.
-
+
Multiset checks
A brief introduction to multiset checks can be found here. In Miden VM, multiset checks are used to implement virtual tables and efficient communication buses.
Running product columns
@@ -4626,7 +4626,7 @@ Communication buses in Miden VM
In Miden VM, the specialized components are implemented as dedicated segments of the execution trace, which include the 3 chiplets in the Chiplets module (the hash chiplet, bitwise chiplet, and memory chiplet).
Miden VM currently uses multiset checks to implement the chiplets bus , which communicates with all of the chiplets (Hash, Bitwise, and Memory).
-
+
LogUp: multivariate lookups with logarithmic derivatives
The description of LogUp can be found here. In MidenVM, LogUp is used to implement efficient communication buses.
Using the LogUp construction instead of a simple multiset check with running products reduces the computational effort for the prover and the verifier. Given two columns and in the main trace where contains duplicates and does not (i.e. is part of the lookup table), LogUp allows us to compute two logarithmic derivatives and check their equality.
@@ -4667,7 +4667,7 @@
If any of these flags have degree greater than 2 then this will increase the overall degree of the constraint and reduce the number of lookup requests that can be accommodated by the bus per row.
-
+
Background Material
Proofs of execution generated by Miden VM are based on STARKs. A STARK is a novel proof-of-computation scheme that allows you to create an efficiently verifiable proof that a computation was executed correctly. The scheme was developed by Eli Ben-Sasson, Michael Riabzev et al. at Technion - Israel Institute of Technology. STARKs do not require an initial trusted setup, and rely on very few cryptographic assumptions.
Here are some resources to learn more about STARKs:
diff --git a/tools/debugger.html b/tools/debugger.html
index bc9f9b7df3..85d2c79147 100644
--- a/tools/debugger.html
+++ b/tools/debugger.html
@@ -176,7 +176,7 @@ Polygon Miden VM
-
+
Miden Debugger
The Miden debugger is a command-line interface (CLI) application, inspired by GNU gdb, which allows debugging of Miden assembly (MASM) programs. The debugger allows the user to step through the execution of the program, both forward and backward, either per clock cycle tick, or via breakpoints.
The Miden debugger supports the following commands:
diff --git a/tools/main.html b/tools/main.html
index 27352a2120..5daf47cb17 100644
--- a/tools/main.html
+++ b/tools/main.html
@@ -176,7 +176,7 @@ Polygon Miden VM
-
+
Development Tools and Resources
The following tools are available for interacting with Miden VM:
diff --git a/tools/repl.html b/tools/repl.html
index ce319fe2ca..54c2a9ce5c 100644
--- a/tools/repl.html
+++ b/tools/repl.html
@@ -176,7 +176,7 @@ Polygon Miden VM
-
+
Miden REPL
The Miden Read–eval–print loop (REPL) is a Miden shell that allows for quick and easy debugging of Miden assembly. After the REPL gets initialized, you can execute any Miden instruction, undo executed instructions, check the state of the stack and memory at a given point, and do many other useful things! When the REPL is exited, a history.txt
file is saved. One thing to note is that all the REPL native commands start with an !
to differentiate them from regular assembly instructions.
Miden REPL can be started via the CLI repl command like so:
diff --git a/user_docs/assembly/code_organization.html b/user_docs/assembly/code_organization.html
index bc1071fdeb..3bfa327deb 100644
--- a/user_docs/assembly/code_organization.html
+++ b/user_docs/assembly/code_organization.html
@@ -176,7 +176,7 @@ Polygon Miden VM
-
+
Code organization
A Miden assembly program is just a sequence of instructions each describing a specific directive or an operation. You can use any combination of whitespace characters to separate one instruction from another.
In turn, Miden assembly instructions are just keywords which can be parameterized by zero or more parameters. The notation for specifying parameters is keyword.param1.param2 - i.e., the parameters are separated by periods. For example, push.123
instruction denotes a push
operation which is parameterized by value 123
.
diff --git a/user_docs/assembly/cryptographic_operations.html b/user_docs/assembly/cryptographic_operations.html
index f7be6629a8..9c6aed8eb7 100644
--- a/user_docs/assembly/cryptographic_operations.html
+++ b/user_docs/assembly/cryptographic_operations.html
@@ -176,7 +176,7 @@ Polygon Miden VM
-
+
Cryptographic operations
Miden assembly provides a set of instructions for performing common cryptographic operations. These instructions are listed in the table below.
Hashing and Merkle trees
diff --git a/user_docs/assembly/debugging.html b/user_docs/assembly/debugging.html
index 5b66339e89..60ba96fcf6 100644
--- a/user_docs/assembly/debugging.html
+++ b/user_docs/assembly/debugging.html
@@ -176,7 +176,7 @@ Polygon Miden VM
-
+
Debugging
To support basic debugging capabilities, Miden assembly provides a debug
instruction. This instruction prints out the state of the VM at the time when the debug
instruction is executed. The instruction can be parameterized as follows:
diff --git a/user_docs/assembly/events.html b/user_docs/assembly/events.html
index d5e2942570..096987ba64 100644
--- a/user_docs/assembly/events.html
+++ b/user_docs/assembly/events.html
@@ -176,7 +176,7 @@ Polygon Miden VM
-
+
Events
Miden assembly supports the concept of events. Events are a simple data structure with a single event_id
field. When an event is emitted by a program, it is communicated to the host. Events can be emitted at specific points of program execution with the intent of triggering some action on the host. This is useful as the program has contextual information that would be challenging for the host to infer. The emission of events allows the program to communicate this contextual information to the host. The host contains an event handler that is responsible for handling events and taking appropriate actions. The emission of events does not change the state of the VM but it can change the state of the host.
An event can be emitted via the emit.<event_id>
assembly instruction where <event_id>
can be any 32-bit value specified either directly or via a named constant. For example:
diff --git a/user_docs/assembly/execution_contexts.html b/user_docs/assembly/execution_contexts.html
index 91e11eae1b..f262497b6b 100644
--- a/user_docs/assembly/execution_contexts.html
+++ b/user_docs/assembly/execution_contexts.html
@@ -176,7 +176,7 @@ Polygon Miden VM
-
+
Execution contexts
Miden assembly program execution can span multiple isolated contexts. An execution context defines its own memory space which is not accessible from other execution contexts.
All programs start executing in a root context. Thus, the main procedure of a program is always executed in the root context. To move execution into a different context, we can invoke a procedure using the call
instruction. In fact, any time we invoke a procedure using the call
instruction, the procedure is executed in a new context. We refer to all non-root contexts as user contexts.
diff --git a/user_docs/assembly/field_operations.html b/user_docs/assembly/field_operations.html
index 80836ed881..176e300a87 100644
--- a/user_docs/assembly/field_operations.html
+++ b/user_docs/assembly/field_operations.html
@@ -176,7 +176,7 @@ Polygon Miden VM
-
+
Field operations
Miden assembly provides a set of instructions which can perform operations with raw field elements. These instructions are described in the tables below.
While most operations place no restrictions on inputs, some operations expect inputs to be binary values, and fail if executed with non-binary inputs.
diff --git a/user_docs/assembly/flow_control.html b/user_docs/assembly/flow_control.html
index c6ea91a763..f72aafa86a 100644
--- a/user_docs/assembly/flow_control.html
+++ b/user_docs/assembly/flow_control.html
@@ -176,7 +176,7 @@ Polygon Miden VM
-
+
Flow control
As mentioned above, Miden assembly provides high-level constructs to facilitate flow control. These constructs are:
diff --git a/user_docs/assembly/io_operations.html b/user_docs/assembly/io_operations.html
index fc631c70e3..3d238e608f 100644
--- a/user_docs/assembly/io_operations.html
+++ b/user_docs/assembly/io_operations.html
@@ -176,7 +176,7 @@ Polygon Miden VM
-
+
Input / output operations
Miden assembly provides a set of instructions for moving data between the operand stack and several other sources. These sources include:
diff --git a/user_docs/assembly/main.html b/user_docs/assembly/main.html
index 3c895bbdab..6c0c3fbab8 100644
--- a/user_docs/assembly/main.html
+++ b/user_docs/assembly/main.html
@@ -176,7 +176,7 @@ Polygon Miden VM
-
+
Miden Assembly
Miden assembly is a simple, low-level language for writing programs for Miden VM. It stands just above raw Miden VM instruction set, and in fact, many instructions of Miden assembly map directly to raw instructions of Miden VM.
Before Miden assembly can be executed on Miden VM, it needs to be compiled into a Program MAST (Merkelized Abstract Syntax Tree) which is a binary tree of code blocks each containing raw Miden VM instructions.
diff --git a/user_docs/assembly/stack_manipulation.html b/user_docs/assembly/stack_manipulation.html
index 6730df6e7e..fa8d1e2194 100644
--- a/user_docs/assembly/stack_manipulation.html
+++ b/user_docs/assembly/stack_manipulation.html
@@ -176,7 +176,7 @@ Polygon Miden VM
-
+
Stack manipulation
Miden VM stack is a push-down stack of field elements. The stack has a maximum depth of , but only the top elements are directly accessible via the instructions listed below.
In addition to the typical stack manipulation instructions such as drop
, dup
, swap
etc., Miden assembly provides several conditional instructions which can be used to manipulate the stack based on some condition - e.g., conditional swap cswap
or conditional drop cdrop
.
diff --git a/user_docs/assembly/u32_operations.html b/user_docs/assembly/u32_operations.html
index 25834bc88e..085062e0c4 100644
--- a/user_docs/assembly/u32_operations.html
+++ b/user_docs/assembly/u32_operations.html
@@ -176,7 +176,7 @@ Polygon Miden VM
-
+
u32 operations
Miden assembly provides a set of instructions which can perform operations on regular two-complement 32-bit integers. These instructions are described in the tables below.
For instructions where one or more operands can be provided as immediate parameters (e.g., u32wrapping_add
and u32wrapping_add.b
), we provide stack transition diagrams only for the non-immediate version. For the immediate version, it can be assumed that the operand with the specified name is not present on the stack.
diff --git a/user_docs/main.html b/user_docs/main.html
index b4174bce1e..52a62075c7 100644
--- a/user_docs/main.html
+++ b/user_docs/main.html
@@ -176,7 +176,7 @@ Polygon Miden VM
-
+
User Documentation
In the following sections, we provide developer-focused documentation useful to those who want to develop on Miden VM or build compilers from higher-level languages to Miden VM.
This documentation consists of two high-level sections:
diff --git a/user_docs/stdlib/collections.html b/user_docs/stdlib/collections.html
index 1f385cce2f..e5645cf404 100644
--- a/user_docs/stdlib/collections.html
+++ b/user_docs/stdlib/collections.html
@@ -176,7 +176,7 @@ Polygon Miden VM
-
+
Collections
Namespace std::collections
contains modules for commonly-used authenticated data structures. This includes:
diff --git a/user_docs/stdlib/crypto/dsa.html b/user_docs/stdlib/crypto/dsa.html
index f8aaa1613f..0eb8bb07c7 100644
--- a/user_docs/stdlib/crypto/dsa.html
+++ b/user_docs/stdlib/crypto/dsa.html
@@ -176,7 +176,7 @@ Polygon Miden VM
-
+
Digital signatures
Namespace std::crypto::dsa
contains a set of digital signature schemes supported by default in the Miden VM. Currently, these schemes are:
diff --git a/user_docs/stdlib/crypto/fri.html b/user_docs/stdlib/crypto/fri.html
index f7aa1fb63a..296e85a1f7 100644
--- a/user_docs/stdlib/crypto/fri.html
+++ b/user_docs/stdlib/crypto/fri.html
@@ -176,7 +176,7 @@ Polygon Miden VM
-
+
FRI verification procedures
Namespace std::crypto::fri
contains modules for verifying FRI proofs.
FRI Extension 2, Fold 4
diff --git a/user_docs/stdlib/crypto/hashes.html b/user_docs/stdlib/crypto/hashes.html
index 96d3220641..ca2caa28de 100644
--- a/user_docs/stdlib/crypto/hashes.html
+++ b/user_docs/stdlib/crypto/hashes.html
@@ -176,7 +176,7 @@ Polygon Miden VM
-
+
Cryptographic hashes
Namespace std::crypto
contains modules for commonly used cryptographic hash functions.
BLAKE3
diff --git a/user_docs/stdlib/main.html b/user_docs/stdlib/main.html
index 06e32bc962..92e825b0e6 100644
--- a/user_docs/stdlib/main.html
+++ b/user_docs/stdlib/main.html
@@ -176,7 +176,7 @@ Polygon Miden VM
-
+
Miden Standard Library
Miden standard library provides a set of procedures which can be used by any Miden program. These procedures build on the core instruction set of Miden assembly expanding the functionality immediately available to the user.
The goals of Miden standard library are:
diff --git a/user_docs/stdlib/math/u64.html b/user_docs/stdlib/math/u64.html
index 0a0bc05176..20ebeeb065 100644
--- a/user_docs/stdlib/math/u64.html
+++ b/user_docs/stdlib/math/u64.html
@@ -176,7 +176,7 @@ Polygon Miden VM
-
+
Unsigned 64-bit integer operations
Module std::math::u64
contains a set of procedures which can be used to perform unsigned 64-bit integer operations. These operations fall into the following categories:
diff --git a/user_docs/stdlib/mem.html b/user_docs/stdlib/mem.html
index fe9a251350..fb84339231 100644
--- a/user_docs/stdlib/mem.html
+++ b/user_docs/stdlib/mem.html
@@ -176,7 +176,7 @@ Polygon Miden VM
-
+
Memory procedures
Module std::mem
contains a set of utility procedures for working with random access memory.
Procedure Description
diff --git a/user_docs/stdlib/sys.html b/user_docs/stdlib/sys.html
index ba5b8b6c79..a93062e703 100644
--- a/user_docs/stdlib/sys.html
+++ b/user_docs/stdlib/sys.html
@@ -176,7 +176,7 @@ Polygon Miden VM
-
+
System procedures
Module std::sys
contains a set of system-level utility procedures.
Procedure Description
, the above reduces to
Chiplets
The Chiplets module contains specialized components dedicated to accelerating complex computations. Each chiplet specializes in executing a specific type of computation and is responsible for proving both the correctness of its computations and its own internal consistency.
Currently, Miden VM relies on 4 chiplets:
@@ -3872,7 +3872,7 @@
-
+
Hash chiplet
Miden VM "offloads" all hash-related computations to a separate hash processor. This chiplet supports executing the Rescue Prime Optimized hash function (or rather a specific instantiation of it) in the following settings:
@@ -4175,7 +4175,7 @@ as a part of computing the old Merkle root, the same node must be removed from as a part of computing the new Merkle root. These two boundary constraints are described as part of the at the first and last rows of the running product column which implements the sibling table, the above constraints ensure that if a node was included into chiplets virtual table constraints.
-
+
Bitwise chiplet
In this note we describe how to compute bitwise AND and XOR operations on 32-bit values and the constraints required for proving correct execution.
Assume that and are field elements in a 64-bit prime field. Assume also that and are known to contain values smaller than . We want to compute , where is either bitwise AND or XOR, and is a field element containing the result of the corresponding bitwise operation.
@@ -4276,7 +4276,7 @@
-
+
Memory chiplet
Miden VM supports linear read-write random access memory. This memory is word-addressable, meaning, four values are located at each address, and we can read and write values to/from memory in batches of four. Each value is a field element in a -bit prime field with modulus . Memory address can be any field element.
In this note we describe the rationale for selecting the above design and describe AIR constraints needed to support it.
@@ -4438,7 +4438,7 @@
On the stack side, for every memory access request, a corresponding value is divided out of the column. Specifics of how this is done are described here.
-
+
Kernel ROM chiplet
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.
Kernel ROM trace
@@ -4495,9 +4495,9 @@ , but when , the above becomes .
We also need to impose boundary constraints to make sure that running product column implementing the kernel procedure table is equal to when the kernel procedure table begins and to the product of all unique kernel functions when it ends. The last boundary constraint means that the verifier only needs to know which kernel was used, but doesn't need to know which functions were invoked within the kernel. These two constraints are described as part of the chiplets virtual table constraints.
-
+
Lookup arguments in Miden VM
-Zero knowledge virtual machines frequently make use of lookup arguments to enable performance optimizations. Miden VM uses two types of arguments: multiset checks and a multivariate lookup based on logarithmic derivatives known as LogUp. A brief introduction to multiset checks can be found here. The description of LogUp can be found here.
+Zero knowledge virtual machines frequently make use of lookup arguments to enable performance optimizations. Miden VM uses two types of arguments: multiset checks and a multivariate lookup based on logarithmic derivatives known as LogUp. A brief introduction to multiset checks can be found here. The description of LogUp can be found here.
In Miden VM, lookup arguments are used for two purposes:
- To prove the consistency of intermediate values that must persist between different cycles of the trace without storing the full data in the execution trace (which would require adding more columns to the trace).
@@ -4547,7 +4547,7 @@ Cost of auxiliary columns for lookup arguments
It is important to note that depending on the field in which we operate, an auxiliary column implementing a lookup argument may actually require more than one trace column. This is specifically true for small fields.
Since Miden uses a 64-bit field, each auxiliary column needs to be represented by columns to achieve ~100-bit security and by columns to achieve ~128-bit security.
-
+
Multiset checks
A brief introduction to multiset checks can be found here. In Miden VM, multiset checks are used to implement virtual tables and efficient communication buses.
Running product columns
@@ -4626,7 +4626,7 @@ Communication buses in Miden VM
In Miden VM, the specialized components are implemented as dedicated segments of the execution trace, which include the 3 chiplets in the Chiplets module (the hash chiplet, bitwise chiplet, and memory chiplet).
Miden VM currently uses multiset checks to implement the chiplets bus , which communicates with all of the chiplets (Hash, Bitwise, and Memory).
-
+
LogUp: multivariate lookups with logarithmic derivatives
The description of LogUp can be found here. In MidenVM, LogUp is used to implement efficient communication buses.
Using the LogUp construction instead of a simple multiset check with running products reduces the computational effort for the prover and the verifier. Given two columns and in the main trace where contains duplicates and does not (i.e. is part of the lookup table), LogUp allows us to compute two logarithmic derivatives and check their equality.
@@ -4667,7 +4667,7 @@
If any of these flags have degree greater than 2 then this will increase the overall degree of the constraint and reduce the number of lookup requests that can be accommodated by the bus per row.
-
+
Background Material
Proofs of execution generated by Miden VM are based on STARKs. A STARK is a novel proof-of-computation scheme that allows you to create an efficiently verifiable proof that a computation was executed correctly. The scheme was developed by Eli Ben-Sasson, Michael Riabzev et al. at Technion - Israel Institute of Technology. STARKs do not require an initial trusted setup, and rely on very few cryptographic assumptions.
Here are some resources to learn more about STARKs:
diff --git a/tools/debugger.html b/tools/debugger.html
index bc9f9b7df3..85d2c79147 100644
--- a/tools/debugger.html
+++ b/tools/debugger.html
@@ -176,7 +176,7 @@ Polygon Miden VM
-
+
Miden Debugger
The Miden debugger is a command-line interface (CLI) application, inspired by GNU gdb, which allows debugging of Miden assembly (MASM) programs. The debugger allows the user to step through the execution of the program, both forward and backward, either per clock cycle tick, or via breakpoints.
The Miden debugger supports the following commands:
diff --git a/tools/main.html b/tools/main.html
index 27352a2120..5daf47cb17 100644
--- a/tools/main.html
+++ b/tools/main.html
@@ -176,7 +176,7 @@ Polygon Miden VM
-
+
Development Tools and Resources
The following tools are available for interacting with Miden VM:
diff --git a/tools/repl.html b/tools/repl.html
index ce319fe2ca..54c2a9ce5c 100644
--- a/tools/repl.html
+++ b/tools/repl.html
@@ -176,7 +176,7 @@ Polygon Miden VM
-
+
Miden REPL
The Miden Read–eval–print loop (REPL) is a Miden shell that allows for quick and easy debugging of Miden assembly. After the REPL gets initialized, you can execute any Miden instruction, undo executed instructions, check the state of the stack and memory at a given point, and do many other useful things! When the REPL is exited, a history.txt
file is saved. One thing to note is that all the REPL native commands start with an !
to differentiate them from regular assembly instructions.
Miden REPL can be started via the CLI repl command like so:
diff --git a/user_docs/assembly/code_organization.html b/user_docs/assembly/code_organization.html
index bc1071fdeb..3bfa327deb 100644
--- a/user_docs/assembly/code_organization.html
+++ b/user_docs/assembly/code_organization.html
@@ -176,7 +176,7 @@ Polygon Miden VM
-
+
Code organization
A Miden assembly program is just a sequence of instructions each describing a specific directive or an operation. You can use any combination of whitespace characters to separate one instruction from another.
In turn, Miden assembly instructions are just keywords which can be parameterized by zero or more parameters. The notation for specifying parameters is keyword.param1.param2 - i.e., the parameters are separated by periods. For example, push.123
instruction denotes a push
operation which is parameterized by value 123
.
diff --git a/user_docs/assembly/cryptographic_operations.html b/user_docs/assembly/cryptographic_operations.html
index f7be6629a8..9c6aed8eb7 100644
--- a/user_docs/assembly/cryptographic_operations.html
+++ b/user_docs/assembly/cryptographic_operations.html
@@ -176,7 +176,7 @@ Polygon Miden VM
-
+
Cryptographic operations
Miden assembly provides a set of instructions for performing common cryptographic operations. These instructions are listed in the table below.
Hashing and Merkle trees
diff --git a/user_docs/assembly/debugging.html b/user_docs/assembly/debugging.html
index 5b66339e89..60ba96fcf6 100644
--- a/user_docs/assembly/debugging.html
+++ b/user_docs/assembly/debugging.html
@@ -176,7 +176,7 @@ Polygon Miden VM
-
+
Debugging
To support basic debugging capabilities, Miden assembly provides a debug
instruction. This instruction prints out the state of the VM at the time when the debug
instruction is executed. The instruction can be parameterized as follows:
diff --git a/user_docs/assembly/events.html b/user_docs/assembly/events.html
index d5e2942570..096987ba64 100644
--- a/user_docs/assembly/events.html
+++ b/user_docs/assembly/events.html
@@ -176,7 +176,7 @@ Polygon Miden VM
-
+
Events
Miden assembly supports the concept of events. Events are a simple data structure with a single event_id
field. When an event is emitted by a program, it is communicated to the host. Events can be emitted at specific points of program execution with the intent of triggering some action on the host. This is useful as the program has contextual information that would be challenging for the host to infer. The emission of events allows the program to communicate this contextual information to the host. The host contains an event handler that is responsible for handling events and taking appropriate actions. The emission of events does not change the state of the VM but it can change the state of the host.
An event can be emitted via the emit.<event_id>
assembly instruction where <event_id>
can be any 32-bit value specified either directly or via a named constant. For example:
diff --git a/user_docs/assembly/execution_contexts.html b/user_docs/assembly/execution_contexts.html
index 91e11eae1b..f262497b6b 100644
--- a/user_docs/assembly/execution_contexts.html
+++ b/user_docs/assembly/execution_contexts.html
@@ -176,7 +176,7 @@ Polygon Miden VM
-
+
Execution contexts
Miden assembly program execution can span multiple isolated contexts. An execution context defines its own memory space which is not accessible from other execution contexts.
All programs start executing in a root context. Thus, the main procedure of a program is always executed in the root context. To move execution into a different context, we can invoke a procedure using the call
instruction. In fact, any time we invoke a procedure using the call
instruction, the procedure is executed in a new context. We refer to all non-root contexts as user contexts.
diff --git a/user_docs/assembly/field_operations.html b/user_docs/assembly/field_operations.html
index 80836ed881..176e300a87 100644
--- a/user_docs/assembly/field_operations.html
+++ b/user_docs/assembly/field_operations.html
@@ -176,7 +176,7 @@ Polygon Miden VM
-
+
Field operations
Miden assembly provides a set of instructions which can perform operations with raw field elements. These instructions are described in the tables below.
While most operations place no restrictions on inputs, some operations expect inputs to be binary values, and fail if executed with non-binary inputs.
diff --git a/user_docs/assembly/flow_control.html b/user_docs/assembly/flow_control.html
index c6ea91a763..f72aafa86a 100644
--- a/user_docs/assembly/flow_control.html
+++ b/user_docs/assembly/flow_control.html
@@ -176,7 +176,7 @@ Polygon Miden VM
-
+
Flow control
As mentioned above, Miden assembly provides high-level constructs to facilitate flow control. These constructs are:
diff --git a/user_docs/assembly/io_operations.html b/user_docs/assembly/io_operations.html
index fc631c70e3..3d238e608f 100644
--- a/user_docs/assembly/io_operations.html
+++ b/user_docs/assembly/io_operations.html
@@ -176,7 +176,7 @@ Polygon Miden VM
-
+
Input / output operations
Miden assembly provides a set of instructions for moving data between the operand stack and several other sources. These sources include:
diff --git a/user_docs/assembly/main.html b/user_docs/assembly/main.html
index 3c895bbdab..6c0c3fbab8 100644
--- a/user_docs/assembly/main.html
+++ b/user_docs/assembly/main.html
@@ -176,7 +176,7 @@ Polygon Miden VM
-
+
Miden Assembly
Miden assembly is a simple, low-level language for writing programs for Miden VM. It stands just above raw Miden VM instruction set, and in fact, many instructions of Miden assembly map directly to raw instructions of Miden VM.
Before Miden assembly can be executed on Miden VM, it needs to be compiled into a Program MAST (Merkelized Abstract Syntax Tree) which is a binary tree of code blocks each containing raw Miden VM instructions.
diff --git a/user_docs/assembly/stack_manipulation.html b/user_docs/assembly/stack_manipulation.html
index 6730df6e7e..fa8d1e2194 100644
--- a/user_docs/assembly/stack_manipulation.html
+++ b/user_docs/assembly/stack_manipulation.html
@@ -176,7 +176,7 @@ Polygon Miden VM
-
+
Stack manipulation
Miden VM stack is a push-down stack of field elements. The stack has a maximum depth of , but only the top elements are directly accessible via the instructions listed below.
In addition to the typical stack manipulation instructions such as drop
, dup
, swap
etc., Miden assembly provides several conditional instructions which can be used to manipulate the stack based on some condition - e.g., conditional swap cswap
or conditional drop cdrop
.
diff --git a/user_docs/assembly/u32_operations.html b/user_docs/assembly/u32_operations.html
index 25834bc88e..085062e0c4 100644
--- a/user_docs/assembly/u32_operations.html
+++ b/user_docs/assembly/u32_operations.html
@@ -176,7 +176,7 @@ Polygon Miden VM
-
+
u32 operations
Miden assembly provides a set of instructions which can perform operations on regular two-complement 32-bit integers. These instructions are described in the tables below.
For instructions where one or more operands can be provided as immediate parameters (e.g., u32wrapping_add
and u32wrapping_add.b
), we provide stack transition diagrams only for the non-immediate version. For the immediate version, it can be assumed that the operand with the specified name is not present on the stack.
diff --git a/user_docs/main.html b/user_docs/main.html
index b4174bce1e..52a62075c7 100644
--- a/user_docs/main.html
+++ b/user_docs/main.html
@@ -176,7 +176,7 @@ Polygon Miden VM
-
+
User Documentation
In the following sections, we provide developer-focused documentation useful to those who want to develop on Miden VM or build compilers from higher-level languages to Miden VM.
This documentation consists of two high-level sections:
diff --git a/user_docs/stdlib/collections.html b/user_docs/stdlib/collections.html
index 1f385cce2f..e5645cf404 100644
--- a/user_docs/stdlib/collections.html
+++ b/user_docs/stdlib/collections.html
@@ -176,7 +176,7 @@ Polygon Miden VM
-
+
Collections
Namespace std::collections
contains modules for commonly-used authenticated data structures. This includes:
diff --git a/user_docs/stdlib/crypto/dsa.html b/user_docs/stdlib/crypto/dsa.html
index f8aaa1613f..0eb8bb07c7 100644
--- a/user_docs/stdlib/crypto/dsa.html
+++ b/user_docs/stdlib/crypto/dsa.html
@@ -176,7 +176,7 @@ Polygon Miden VM
-
+
Digital signatures
Namespace std::crypto::dsa
contains a set of digital signature schemes supported by default in the Miden VM. Currently, these schemes are:
diff --git a/user_docs/stdlib/crypto/fri.html b/user_docs/stdlib/crypto/fri.html
index f7aa1fb63a..296e85a1f7 100644
--- a/user_docs/stdlib/crypto/fri.html
+++ b/user_docs/stdlib/crypto/fri.html
@@ -176,7 +176,7 @@ Polygon Miden VM
-
+
FRI verification procedures
Namespace std::crypto::fri
contains modules for verifying FRI proofs.
FRI Extension 2, Fold 4
diff --git a/user_docs/stdlib/crypto/hashes.html b/user_docs/stdlib/crypto/hashes.html
index 96d3220641..ca2caa28de 100644
--- a/user_docs/stdlib/crypto/hashes.html
+++ b/user_docs/stdlib/crypto/hashes.html
@@ -176,7 +176,7 @@ Polygon Miden VM
-
+
Cryptographic hashes
Namespace std::crypto
contains modules for commonly used cryptographic hash functions.
BLAKE3
diff --git a/user_docs/stdlib/main.html b/user_docs/stdlib/main.html
index 06e32bc962..92e825b0e6 100644
--- a/user_docs/stdlib/main.html
+++ b/user_docs/stdlib/main.html
@@ -176,7 +176,7 @@ Polygon Miden VM
-
+
Miden Standard Library
Miden standard library provides a set of procedures which can be used by any Miden program. These procedures build on the core instruction set of Miden assembly expanding the functionality immediately available to the user.
The goals of Miden standard library are:
diff --git a/user_docs/stdlib/math/u64.html b/user_docs/stdlib/math/u64.html
index 0a0bc05176..20ebeeb065 100644
--- a/user_docs/stdlib/math/u64.html
+++ b/user_docs/stdlib/math/u64.html
@@ -176,7 +176,7 @@ Polygon Miden VM
-
+
Unsigned 64-bit integer operations
Module std::math::u64
contains a set of procedures which can be used to perform unsigned 64-bit integer operations. These operations fall into the following categories:
diff --git a/user_docs/stdlib/mem.html b/user_docs/stdlib/mem.html
index fe9a251350..fb84339231 100644
--- a/user_docs/stdlib/mem.html
+++ b/user_docs/stdlib/mem.html
@@ -176,7 +176,7 @@ Polygon Miden VM
-
+
Memory procedures
Module std::mem
contains a set of utility procedures for working with random access memory.
Procedure Description
diff --git a/user_docs/stdlib/sys.html b/user_docs/stdlib/sys.html
index ba5b8b6c79..a93062e703 100644
--- a/user_docs/stdlib/sys.html
+++ b/user_docs/stdlib/sys.html
@@ -176,7 +176,7 @@ Polygon Miden VM
-
+
System procedures
Module std::sys
contains a set of system-level utility procedures.
Procedure Description
, the above reduces to
as a part of computing the old Merkle root, the same node must be removed from as a part of computing the new Merkle root. These two boundary constraints are described as part of the at the first and last rows of the running product column which implements the sibling table, the above constraints ensure that if a node was included into chiplets virtual table constraints.
-
+
Bitwise chiplet
In this note we describe how to compute bitwise AND and XOR operations on 32-bit values and the constraints required for proving correct execution.
Assume that and are field elements in a 64-bit prime field. Assume also that and are known to contain values smaller than . We want to compute , where is either bitwise AND or XOR, and is a field element containing the result of the corresponding bitwise operation.
@@ -4276,7 +4276,7 @@
-
+
Memory chiplet
Miden VM supports linear read-write random access memory. This memory is word-addressable, meaning, four values are located at each address, and we can read and write values to/from memory in batches of four. Each value is a field element in a -bit prime field with modulus . Memory address can be any field element.
In this note we describe the rationale for selecting the above design and describe AIR constraints needed to support it.
@@ -4438,7 +4438,7 @@
On the stack side, for every memory access request, a corresponding value is divided out of the column. Specifics of how this is done are described here.
-
+
Kernel ROM chiplet
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.
Kernel ROM trace
@@ -4495,9 +4495,9 @@ , but when , the above becomes .
We also need to impose boundary constraints to make sure that running product column implementing the kernel procedure table is equal to when the kernel procedure table begins and to the product of all unique kernel functions when it ends. The last boundary constraint means that the verifier only needs to know which kernel was used, but doesn't need to know which functions were invoked within the kernel. These two constraints are described as part of the chiplets virtual table constraints.
-
+
Lookup arguments in Miden VM
-Zero knowledge virtual machines frequently make use of lookup arguments to enable performance optimizations. Miden VM uses two types of arguments: multiset checks and a multivariate lookup based on logarithmic derivatives known as LogUp. A brief introduction to multiset checks can be found here. The description of LogUp can be found here.
+Zero knowledge virtual machines frequently make use of lookup arguments to enable performance optimizations. Miden VM uses two types of arguments: multiset checks and a multivariate lookup based on logarithmic derivatives known as LogUp. A brief introduction to multiset checks can be found here. The description of LogUp can be found here.
In Miden VM, lookup arguments are used for two purposes:
- To prove the consistency of intermediate values that must persist between different cycles of the trace without storing the full data in the execution trace (which would require adding more columns to the trace).
@@ -4547,7 +4547,7 @@ Cost of auxiliary columns for lookup arguments
It is important to note that depending on the field in which we operate, an auxiliary column implementing a lookup argument may actually require more than one trace column. This is specifically true for small fields.
Since Miden uses a 64-bit field, each auxiliary column needs to be represented by columns to achieve ~100-bit security and by columns to achieve ~128-bit security.
-
+
Multiset checks
A brief introduction to multiset checks can be found here. In Miden VM, multiset checks are used to implement virtual tables and efficient communication buses.
Running product columns
@@ -4626,7 +4626,7 @@ Communication buses in Miden VM
In Miden VM, the specialized components are implemented as dedicated segments of the execution trace, which include the 3 chiplets in the Chiplets module (the hash chiplet, bitwise chiplet, and memory chiplet).
Miden VM currently uses multiset checks to implement the chiplets bus , which communicates with all of the chiplets (Hash, Bitwise, and Memory).
-
+
LogUp: multivariate lookups with logarithmic derivatives
The description of LogUp can be found here. In MidenVM, LogUp is used to implement efficient communication buses.
Using the LogUp construction instead of a simple multiset check with running products reduces the computational effort for the prover and the verifier. Given two columns and in the main trace where contains duplicates and does not (i.e. is part of the lookup table), LogUp allows us to compute two logarithmic derivatives and check their equality.
@@ -4667,7 +4667,7 @@
If any of these flags have degree greater than 2 then this will increase the overall degree of the constraint and reduce the number of lookup requests that can be accommodated by the bus per row.
-
+
Background Material
Proofs of execution generated by Miden VM are based on STARKs. A STARK is a novel proof-of-computation scheme that allows you to create an efficiently verifiable proof that a computation was executed correctly. The scheme was developed by Eli Ben-Sasson, Michael Riabzev et al. at Technion - Israel Institute of Technology. STARKs do not require an initial trusted setup, and rely on very few cryptographic assumptions.
Here are some resources to learn more about STARKs:
diff --git a/tools/debugger.html b/tools/debugger.html
index bc9f9b7df3..85d2c79147 100644
--- a/tools/debugger.html
+++ b/tools/debugger.html
@@ -176,7 +176,7 @@ Polygon Miden VM
-
+
Miden Debugger
The Miden debugger is a command-line interface (CLI) application, inspired by GNU gdb, which allows debugging of Miden assembly (MASM) programs. The debugger allows the user to step through the execution of the program, both forward and backward, either per clock cycle tick, or via breakpoints.
The Miden debugger supports the following commands:
diff --git a/tools/main.html b/tools/main.html
index 27352a2120..5daf47cb17 100644
--- a/tools/main.html
+++ b/tools/main.html
@@ -176,7 +176,7 @@ Polygon Miden VM
-
+
Development Tools and Resources
The following tools are available for interacting with Miden VM:
diff --git a/tools/repl.html b/tools/repl.html
index ce319fe2ca..54c2a9ce5c 100644
--- a/tools/repl.html
+++ b/tools/repl.html
@@ -176,7 +176,7 @@ Polygon Miden VM
-
+
Miden REPL
The Miden Read–eval–print loop (REPL) is a Miden shell that allows for quick and easy debugging of Miden assembly. After the REPL gets initialized, you can execute any Miden instruction, undo executed instructions, check the state of the stack and memory at a given point, and do many other useful things! When the REPL is exited, a history.txt
file is saved. One thing to note is that all the REPL native commands start with an !
to differentiate them from regular assembly instructions.
Miden REPL can be started via the CLI repl command like so:
diff --git a/user_docs/assembly/code_organization.html b/user_docs/assembly/code_organization.html
index bc1071fdeb..3bfa327deb 100644
--- a/user_docs/assembly/code_organization.html
+++ b/user_docs/assembly/code_organization.html
@@ -176,7 +176,7 @@ Polygon Miden VM
-
+
Code organization
A Miden assembly program is just a sequence of instructions each describing a specific directive or an operation. You can use any combination of whitespace characters to separate one instruction from another.
In turn, Miden assembly instructions are just keywords which can be parameterized by zero or more parameters. The notation for specifying parameters is keyword.param1.param2 - i.e., the parameters are separated by periods. For example, push.123
instruction denotes a push
operation which is parameterized by value 123
.
diff --git a/user_docs/assembly/cryptographic_operations.html b/user_docs/assembly/cryptographic_operations.html
index f7be6629a8..9c6aed8eb7 100644
--- a/user_docs/assembly/cryptographic_operations.html
+++ b/user_docs/assembly/cryptographic_operations.html
@@ -176,7 +176,7 @@ Polygon Miden VM
-
+
Cryptographic operations
Miden assembly provides a set of instructions for performing common cryptographic operations. These instructions are listed in the table below.
Hashing and Merkle trees
diff --git a/user_docs/assembly/debugging.html b/user_docs/assembly/debugging.html
index 5b66339e89..60ba96fcf6 100644
--- a/user_docs/assembly/debugging.html
+++ b/user_docs/assembly/debugging.html
@@ -176,7 +176,7 @@ Polygon Miden VM
-
+
Debugging
To support basic debugging capabilities, Miden assembly provides a debug
instruction. This instruction prints out the state of the VM at the time when the debug
instruction is executed. The instruction can be parameterized as follows:
diff --git a/user_docs/assembly/events.html b/user_docs/assembly/events.html
index d5e2942570..096987ba64 100644
--- a/user_docs/assembly/events.html
+++ b/user_docs/assembly/events.html
@@ -176,7 +176,7 @@ Polygon Miden VM
-
+
Events
Miden assembly supports the concept of events. Events are a simple data structure with a single event_id
field. When an event is emitted by a program, it is communicated to the host. Events can be emitted at specific points of program execution with the intent of triggering some action on the host. This is useful as the program has contextual information that would be challenging for the host to infer. The emission of events allows the program to communicate this contextual information to the host. The host contains an event handler that is responsible for handling events and taking appropriate actions. The emission of events does not change the state of the VM but it can change the state of the host.
An event can be emitted via the emit.<event_id>
assembly instruction where <event_id>
can be any 32-bit value specified either directly or via a named constant. For example:
diff --git a/user_docs/assembly/execution_contexts.html b/user_docs/assembly/execution_contexts.html
index 91e11eae1b..f262497b6b 100644
--- a/user_docs/assembly/execution_contexts.html
+++ b/user_docs/assembly/execution_contexts.html
@@ -176,7 +176,7 @@ Polygon Miden VM
-
+
Execution contexts
Miden assembly program execution can span multiple isolated contexts. An execution context defines its own memory space which is not accessible from other execution contexts.
All programs start executing in a root context. Thus, the main procedure of a program is always executed in the root context. To move execution into a different context, we can invoke a procedure using the call
instruction. In fact, any time we invoke a procedure using the call
instruction, the procedure is executed in a new context. We refer to all non-root contexts as user contexts.
diff --git a/user_docs/assembly/field_operations.html b/user_docs/assembly/field_operations.html
index 80836ed881..176e300a87 100644
--- a/user_docs/assembly/field_operations.html
+++ b/user_docs/assembly/field_operations.html
@@ -176,7 +176,7 @@ Polygon Miden VM
-
+
Field operations
Miden assembly provides a set of instructions which can perform operations with raw field elements. These instructions are described in the tables below.
While most operations place no restrictions on inputs, some operations expect inputs to be binary values, and fail if executed with non-binary inputs.
diff --git a/user_docs/assembly/flow_control.html b/user_docs/assembly/flow_control.html
index c6ea91a763..f72aafa86a 100644
--- a/user_docs/assembly/flow_control.html
+++ b/user_docs/assembly/flow_control.html
@@ -176,7 +176,7 @@ Polygon Miden VM
-
+
Flow control
As mentioned above, Miden assembly provides high-level constructs to facilitate flow control. These constructs are:
diff --git a/user_docs/assembly/io_operations.html b/user_docs/assembly/io_operations.html
index fc631c70e3..3d238e608f 100644
--- a/user_docs/assembly/io_operations.html
+++ b/user_docs/assembly/io_operations.html
@@ -176,7 +176,7 @@ Polygon Miden VM
-
+
Input / output operations
Miden assembly provides a set of instructions for moving data between the operand stack and several other sources. These sources include:
diff --git a/user_docs/assembly/main.html b/user_docs/assembly/main.html
index 3c895bbdab..6c0c3fbab8 100644
--- a/user_docs/assembly/main.html
+++ b/user_docs/assembly/main.html
@@ -176,7 +176,7 @@ Polygon Miden VM
-
+
Miden Assembly
Miden assembly is a simple, low-level language for writing programs for Miden VM. It stands just above raw Miden VM instruction set, and in fact, many instructions of Miden assembly map directly to raw instructions of Miden VM.
Before Miden assembly can be executed on Miden VM, it needs to be compiled into a Program MAST (Merkelized Abstract Syntax Tree) which is a binary tree of code blocks each containing raw Miden VM instructions.
diff --git a/user_docs/assembly/stack_manipulation.html b/user_docs/assembly/stack_manipulation.html
index 6730df6e7e..fa8d1e2194 100644
--- a/user_docs/assembly/stack_manipulation.html
+++ b/user_docs/assembly/stack_manipulation.html
@@ -176,7 +176,7 @@ Polygon Miden VM
-
+
Stack manipulation
Miden VM stack is a push-down stack of field elements. The stack has a maximum depth of , but only the top elements are directly accessible via the instructions listed below.
In addition to the typical stack manipulation instructions such as drop
, dup
, swap
etc., Miden assembly provides several conditional instructions which can be used to manipulate the stack based on some condition - e.g., conditional swap cswap
or conditional drop cdrop
.
diff --git a/user_docs/assembly/u32_operations.html b/user_docs/assembly/u32_operations.html
index 25834bc88e..085062e0c4 100644
--- a/user_docs/assembly/u32_operations.html
+++ b/user_docs/assembly/u32_operations.html
@@ -176,7 +176,7 @@ Polygon Miden VM
-
+
u32 operations
Miden assembly provides a set of instructions which can perform operations on regular two-complement 32-bit integers. These instructions are described in the tables below.
For instructions where one or more operands can be provided as immediate parameters (e.g., u32wrapping_add
and u32wrapping_add.b
), we provide stack transition diagrams only for the non-immediate version. For the immediate version, it can be assumed that the operand with the specified name is not present on the stack.
diff --git a/user_docs/main.html b/user_docs/main.html
index b4174bce1e..52a62075c7 100644
--- a/user_docs/main.html
+++ b/user_docs/main.html
@@ -176,7 +176,7 @@ Polygon Miden VM
-
+
User Documentation
In the following sections, we provide developer-focused documentation useful to those who want to develop on Miden VM or build compilers from higher-level languages to Miden VM.
This documentation consists of two high-level sections:
diff --git a/user_docs/stdlib/collections.html b/user_docs/stdlib/collections.html
index 1f385cce2f..e5645cf404 100644
--- a/user_docs/stdlib/collections.html
+++ b/user_docs/stdlib/collections.html
@@ -176,7 +176,7 @@ Polygon Miden VM
-
+
Collections
Namespace std::collections
contains modules for commonly-used authenticated data structures. This includes:
diff --git a/user_docs/stdlib/crypto/dsa.html b/user_docs/stdlib/crypto/dsa.html
index f8aaa1613f..0eb8bb07c7 100644
--- a/user_docs/stdlib/crypto/dsa.html
+++ b/user_docs/stdlib/crypto/dsa.html
@@ -176,7 +176,7 @@ Polygon Miden VM
-
+
Digital signatures
Namespace std::crypto::dsa
contains a set of digital signature schemes supported by default in the Miden VM. Currently, these schemes are:
diff --git a/user_docs/stdlib/crypto/fri.html b/user_docs/stdlib/crypto/fri.html
index f7aa1fb63a..296e85a1f7 100644
--- a/user_docs/stdlib/crypto/fri.html
+++ b/user_docs/stdlib/crypto/fri.html
@@ -176,7 +176,7 @@ Polygon Miden VM
-
+
FRI verification procedures
Namespace std::crypto::fri
contains modules for verifying FRI proofs.
FRI Extension 2, Fold 4
diff --git a/user_docs/stdlib/crypto/hashes.html b/user_docs/stdlib/crypto/hashes.html
index 96d3220641..ca2caa28de 100644
--- a/user_docs/stdlib/crypto/hashes.html
+++ b/user_docs/stdlib/crypto/hashes.html
@@ -176,7 +176,7 @@ Polygon Miden VM
-
+
Cryptographic hashes
Namespace std::crypto
contains modules for commonly used cryptographic hash functions.
BLAKE3
diff --git a/user_docs/stdlib/main.html b/user_docs/stdlib/main.html
index 06e32bc962..92e825b0e6 100644
--- a/user_docs/stdlib/main.html
+++ b/user_docs/stdlib/main.html
@@ -176,7 +176,7 @@ Polygon Miden VM
-
+
Miden Standard Library
Miden standard library provides a set of procedures which can be used by any Miden program. These procedures build on the core instruction set of Miden assembly expanding the functionality immediately available to the user.
The goals of Miden standard library are:
diff --git a/user_docs/stdlib/math/u64.html b/user_docs/stdlib/math/u64.html
index 0a0bc05176..20ebeeb065 100644
--- a/user_docs/stdlib/math/u64.html
+++ b/user_docs/stdlib/math/u64.html
@@ -176,7 +176,7 @@ Polygon Miden VM
-
+
Unsigned 64-bit integer operations
Module std::math::u64
contains a set of procedures which can be used to perform unsigned 64-bit integer operations. These operations fall into the following categories:
diff --git a/user_docs/stdlib/mem.html b/user_docs/stdlib/mem.html
index fe9a251350..fb84339231 100644
--- a/user_docs/stdlib/mem.html
+++ b/user_docs/stdlib/mem.html
@@ -176,7 +176,7 @@ Polygon Miden VM
-
+
Memory procedures
Module std::mem
contains a set of utility procedures for working with random access memory.
Procedure Description
diff --git a/user_docs/stdlib/sys.html b/user_docs/stdlib/sys.html
index ba5b8b6c79..a93062e703 100644
--- a/user_docs/stdlib/sys.html
+++ b/user_docs/stdlib/sys.html
@@ -176,7 +176,7 @@ Polygon Miden VM
-
+
System procedures
Module std::sys
contains a set of system-level utility procedures.
Procedure Description
, the above reduces to
On the stack side, for every memory access request, a corresponding value is divided out of the column. Specifics of how this is done are described here.
- +Kernel ROM chiplet
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.
Kernel ROM trace
@@ -4495,9 +4495,9 @@, but when , the above becomes .
We also need to impose boundary constraints to make sure that running product column implementing the kernel procedure table is equal to when the kernel procedure table begins and to the product of all unique kernel functions when it ends. The last boundary constraint means that the verifier only needs to know which kernel was used, but doesn't need to know which functions were invoked within the kernel. These two constraints are described as part of the chiplets virtual table constraints.
-
+
Lookup arguments in Miden VM
-Zero knowledge virtual machines frequently make use of lookup arguments to enable performance optimizations. Miden VM uses two types of arguments: multiset checks and a multivariate lookup based on logarithmic derivatives known as LogUp. A brief introduction to multiset checks can be found here. The description of LogUp can be found here.
+Zero knowledge virtual machines frequently make use of lookup arguments to enable performance optimizations. Miden VM uses two types of arguments: multiset checks and a multivariate lookup based on logarithmic derivatives known as LogUp. A brief introduction to multiset checks can be found here. The description of LogUp can be found here.
In Miden VM, lookup arguments are used for two purposes:
- To prove the consistency of intermediate values that must persist between different cycles of the trace without storing the full data in the execution trace (which would require adding more columns to the trace).
@@ -4547,7 +4547,7 @@ Cost of auxiliary columns for lookup arguments
It is important to note that depending on the field in which we operate, an auxiliary column implementing a lookup argument may actually require more than one trace column. This is specifically true for small fields.
Since Miden uses a 64-bit field, each auxiliary column needs to be represented by columns to achieve ~100-bit security and by columns to achieve ~128-bit security.
-
+
Multiset checks
A brief introduction to multiset checks can be found here. In Miden VM, multiset checks are used to implement virtual tables and efficient communication buses.
Running product columns
@@ -4626,7 +4626,7 @@ Communication buses in Miden VM
In Miden VM, the specialized components are implemented as dedicated segments of the execution trace, which include the 3 chiplets in the Chiplets module (the hash chiplet, bitwise chiplet, and memory chiplet).
Miden VM currently uses multiset checks to implement the chiplets bus , which communicates with all of the chiplets (Hash, Bitwise, and Memory).
-
+
LogUp: multivariate lookups with logarithmic derivatives
The description of LogUp can be found here. In MidenVM, LogUp is used to implement efficient communication buses.
Using the LogUp construction instead of a simple multiset check with running products reduces the computational effort for the prover and the verifier. Given two columns and in the main trace where contains duplicates and does not (i.e. is part of the lookup table), LogUp allows us to compute two logarithmic derivatives and check their equality.
@@ -4667,7 +4667,7 @@
If any of these flags have degree greater than 2 then this will increase the overall degree of the constraint and reduce the number of lookup requests that can be accommodated by the bus per row.
-
+
Background Material
Proofs of execution generated by Miden VM are based on STARKs. A STARK is a novel proof-of-computation scheme that allows you to create an efficiently verifiable proof that a computation was executed correctly. The scheme was developed by Eli Ben-Sasson, Michael Riabzev et al. at Technion - Israel Institute of Technology. STARKs do not require an initial trusted setup, and rely on very few cryptographic assumptions.
Here are some resources to learn more about STARKs:
diff --git a/tools/debugger.html b/tools/debugger.html
index bc9f9b7df3..85d2c79147 100644
--- a/tools/debugger.html
+++ b/tools/debugger.html
@@ -176,7 +176,7 @@ Polygon Miden VM
-
+
Miden Debugger
The Miden debugger is a command-line interface (CLI) application, inspired by GNU gdb, which allows debugging of Miden assembly (MASM) programs. The debugger allows the user to step through the execution of the program, both forward and backward, either per clock cycle tick, or via breakpoints.
The Miden debugger supports the following commands:
diff --git a/tools/main.html b/tools/main.html
index 27352a2120..5daf47cb17 100644
--- a/tools/main.html
+++ b/tools/main.html
@@ -176,7 +176,7 @@ Polygon Miden VM
-
+
Development Tools and Resources
The following tools are available for interacting with Miden VM:
diff --git a/tools/repl.html b/tools/repl.html
index ce319fe2ca..54c2a9ce5c 100644
--- a/tools/repl.html
+++ b/tools/repl.html
@@ -176,7 +176,7 @@ Polygon Miden VM
-
+
Miden REPL
The Miden Read–eval–print loop (REPL) is a Miden shell that allows for quick and easy debugging of Miden assembly. After the REPL gets initialized, you can execute any Miden instruction, undo executed instructions, check the state of the stack and memory at a given point, and do many other useful things! When the REPL is exited, a history.txt
file is saved. One thing to note is that all the REPL native commands start with an !
to differentiate them from regular assembly instructions.
Miden REPL can be started via the CLI repl command like so:
diff --git a/user_docs/assembly/code_organization.html b/user_docs/assembly/code_organization.html
index bc1071fdeb..3bfa327deb 100644
--- a/user_docs/assembly/code_organization.html
+++ b/user_docs/assembly/code_organization.html
@@ -176,7 +176,7 @@ Polygon Miden VM
-
+
Code organization
A Miden assembly program is just a sequence of instructions each describing a specific directive or an operation. You can use any combination of whitespace characters to separate one instruction from another.
In turn, Miden assembly instructions are just keywords which can be parameterized by zero or more parameters. The notation for specifying parameters is keyword.param1.param2 - i.e., the parameters are separated by periods. For example, push.123
instruction denotes a push
operation which is parameterized by value 123
.
diff --git a/user_docs/assembly/cryptographic_operations.html b/user_docs/assembly/cryptographic_operations.html
index f7be6629a8..9c6aed8eb7 100644
--- a/user_docs/assembly/cryptographic_operations.html
+++ b/user_docs/assembly/cryptographic_operations.html
@@ -176,7 +176,7 @@ Polygon Miden VM
-
+
Cryptographic operations
Miden assembly provides a set of instructions for performing common cryptographic operations. These instructions are listed in the table below.
Hashing and Merkle trees
diff --git a/user_docs/assembly/debugging.html b/user_docs/assembly/debugging.html
index 5b66339e89..60ba96fcf6 100644
--- a/user_docs/assembly/debugging.html
+++ b/user_docs/assembly/debugging.html
@@ -176,7 +176,7 @@ Polygon Miden VM
-
+
Debugging
To support basic debugging capabilities, Miden assembly provides a debug
instruction. This instruction prints out the state of the VM at the time when the debug
instruction is executed. The instruction can be parameterized as follows:
diff --git a/user_docs/assembly/events.html b/user_docs/assembly/events.html
index d5e2942570..096987ba64 100644
--- a/user_docs/assembly/events.html
+++ b/user_docs/assembly/events.html
@@ -176,7 +176,7 @@ Polygon Miden VM
-
+
Events
Miden assembly supports the concept of events. Events are a simple data structure with a single event_id
field. When an event is emitted by a program, it is communicated to the host. Events can be emitted at specific points of program execution with the intent of triggering some action on the host. This is useful as the program has contextual information that would be challenging for the host to infer. The emission of events allows the program to communicate this contextual information to the host. The host contains an event handler that is responsible for handling events and taking appropriate actions. The emission of events does not change the state of the VM but it can change the state of the host.
An event can be emitted via the emit.<event_id>
assembly instruction where <event_id>
can be any 32-bit value specified either directly or via a named constant. For example:
diff --git a/user_docs/assembly/execution_contexts.html b/user_docs/assembly/execution_contexts.html
index 91e11eae1b..f262497b6b 100644
--- a/user_docs/assembly/execution_contexts.html
+++ b/user_docs/assembly/execution_contexts.html
@@ -176,7 +176,7 @@ Polygon Miden VM
-
+
Execution contexts
Miden assembly program execution can span multiple isolated contexts. An execution context defines its own memory space which is not accessible from other execution contexts.
All programs start executing in a root context. Thus, the main procedure of a program is always executed in the root context. To move execution into a different context, we can invoke a procedure using the call
instruction. In fact, any time we invoke a procedure using the call
instruction, the procedure is executed in a new context. We refer to all non-root contexts as user contexts.
diff --git a/user_docs/assembly/field_operations.html b/user_docs/assembly/field_operations.html
index 80836ed881..176e300a87 100644
--- a/user_docs/assembly/field_operations.html
+++ b/user_docs/assembly/field_operations.html
@@ -176,7 +176,7 @@ Polygon Miden VM
-
+
Field operations
Miden assembly provides a set of instructions which can perform operations with raw field elements. These instructions are described in the tables below.
While most operations place no restrictions on inputs, some operations expect inputs to be binary values, and fail if executed with non-binary inputs.
diff --git a/user_docs/assembly/flow_control.html b/user_docs/assembly/flow_control.html
index c6ea91a763..f72aafa86a 100644
--- a/user_docs/assembly/flow_control.html
+++ b/user_docs/assembly/flow_control.html
@@ -176,7 +176,7 @@ Polygon Miden VM
-
+
Flow control
As mentioned above, Miden assembly provides high-level constructs to facilitate flow control. These constructs are:
diff --git a/user_docs/assembly/io_operations.html b/user_docs/assembly/io_operations.html
index fc631c70e3..3d238e608f 100644
--- a/user_docs/assembly/io_operations.html
+++ b/user_docs/assembly/io_operations.html
@@ -176,7 +176,7 @@ Polygon Miden VM
-
+
Input / output operations
Miden assembly provides a set of instructions for moving data between the operand stack and several other sources. These sources include:
diff --git a/user_docs/assembly/main.html b/user_docs/assembly/main.html
index 3c895bbdab..6c0c3fbab8 100644
--- a/user_docs/assembly/main.html
+++ b/user_docs/assembly/main.html
@@ -176,7 +176,7 @@ Polygon Miden VM
-
+
Miden Assembly
Miden assembly is a simple, low-level language for writing programs for Miden VM. It stands just above raw Miden VM instruction set, and in fact, many instructions of Miden assembly map directly to raw instructions of Miden VM.
Before Miden assembly can be executed on Miden VM, it needs to be compiled into a Program MAST (Merkelized Abstract Syntax Tree) which is a binary tree of code blocks each containing raw Miden VM instructions.
diff --git a/user_docs/assembly/stack_manipulation.html b/user_docs/assembly/stack_manipulation.html
index 6730df6e7e..fa8d1e2194 100644
--- a/user_docs/assembly/stack_manipulation.html
+++ b/user_docs/assembly/stack_manipulation.html
@@ -176,7 +176,7 @@ Polygon Miden VM
-
+
Stack manipulation
Miden VM stack is a push-down stack of field elements. The stack has a maximum depth of , but only the top elements are directly accessible via the instructions listed below.
In addition to the typical stack manipulation instructions such as drop
, dup
, swap
etc., Miden assembly provides several conditional instructions which can be used to manipulate the stack based on some condition - e.g., conditional swap cswap
or conditional drop cdrop
.
diff --git a/user_docs/assembly/u32_operations.html b/user_docs/assembly/u32_operations.html
index 25834bc88e..085062e0c4 100644
--- a/user_docs/assembly/u32_operations.html
+++ b/user_docs/assembly/u32_operations.html
@@ -176,7 +176,7 @@ Polygon Miden VM
-
+
u32 operations
Miden assembly provides a set of instructions which can perform operations on regular two-complement 32-bit integers. These instructions are described in the tables below.
For instructions where one or more operands can be provided as immediate parameters (e.g., u32wrapping_add
and u32wrapping_add.b
), we provide stack transition diagrams only for the non-immediate version. For the immediate version, it can be assumed that the operand with the specified name is not present on the stack.
diff --git a/user_docs/main.html b/user_docs/main.html
index b4174bce1e..52a62075c7 100644
--- a/user_docs/main.html
+++ b/user_docs/main.html
@@ -176,7 +176,7 @@ Polygon Miden VM
-
+
User Documentation
In the following sections, we provide developer-focused documentation useful to those who want to develop on Miden VM or build compilers from higher-level languages to Miden VM.
This documentation consists of two high-level sections:
diff --git a/user_docs/stdlib/collections.html b/user_docs/stdlib/collections.html
index 1f385cce2f..e5645cf404 100644
--- a/user_docs/stdlib/collections.html
+++ b/user_docs/stdlib/collections.html
@@ -176,7 +176,7 @@ Polygon Miden VM
-
+
Collections
Namespace std::collections
contains modules for commonly-used authenticated data structures. This includes:
diff --git a/user_docs/stdlib/crypto/dsa.html b/user_docs/stdlib/crypto/dsa.html
index f8aaa1613f..0eb8bb07c7 100644
--- a/user_docs/stdlib/crypto/dsa.html
+++ b/user_docs/stdlib/crypto/dsa.html
@@ -176,7 +176,7 @@ Polygon Miden VM
-
+
Digital signatures
Namespace std::crypto::dsa
contains a set of digital signature schemes supported by default in the Miden VM. Currently, these schemes are:
diff --git a/user_docs/stdlib/crypto/fri.html b/user_docs/stdlib/crypto/fri.html
index f7aa1fb63a..296e85a1f7 100644
--- a/user_docs/stdlib/crypto/fri.html
+++ b/user_docs/stdlib/crypto/fri.html
@@ -176,7 +176,7 @@ Polygon Miden VM
-
+
FRI verification procedures
Namespace std::crypto::fri
contains modules for verifying FRI proofs.
FRI Extension 2, Fold 4
diff --git a/user_docs/stdlib/crypto/hashes.html b/user_docs/stdlib/crypto/hashes.html
index 96d3220641..ca2caa28de 100644
--- a/user_docs/stdlib/crypto/hashes.html
+++ b/user_docs/stdlib/crypto/hashes.html
@@ -176,7 +176,7 @@ Polygon Miden VM
-
+
Cryptographic hashes
Namespace std::crypto
contains modules for commonly used cryptographic hash functions.
BLAKE3
diff --git a/user_docs/stdlib/main.html b/user_docs/stdlib/main.html
index 06e32bc962..92e825b0e6 100644
--- a/user_docs/stdlib/main.html
+++ b/user_docs/stdlib/main.html
@@ -176,7 +176,7 @@ Polygon Miden VM
-
+
Miden Standard Library
Miden standard library provides a set of procedures which can be used by any Miden program. These procedures build on the core instruction set of Miden assembly expanding the functionality immediately available to the user.
The goals of Miden standard library are:
diff --git a/user_docs/stdlib/math/u64.html b/user_docs/stdlib/math/u64.html
index 0a0bc05176..20ebeeb065 100644
--- a/user_docs/stdlib/math/u64.html
+++ b/user_docs/stdlib/math/u64.html
@@ -176,7 +176,7 @@ Polygon Miden VM
-
+
Unsigned 64-bit integer operations
Module std::math::u64
contains a set of procedures which can be used to perform unsigned 64-bit integer operations. These operations fall into the following categories:
diff --git a/user_docs/stdlib/mem.html b/user_docs/stdlib/mem.html
index fe9a251350..fb84339231 100644
--- a/user_docs/stdlib/mem.html
+++ b/user_docs/stdlib/mem.html
@@ -176,7 +176,7 @@ Polygon Miden VM
-
+
Memory procedures
Module std::mem
contains a set of utility procedures for working with random access memory.
Procedure Description
diff --git a/user_docs/stdlib/sys.html b/user_docs/stdlib/sys.html
index ba5b8b6c79..a93062e703 100644
--- a/user_docs/stdlib/sys.html
+++ b/user_docs/stdlib/sys.html
@@ -176,7 +176,7 @@ Polygon Miden VM
-
+
System procedures
Module std::sys
contains a set of system-level utility procedures.
Procedure Description
, the above reduces to
Cost of auxiliary columns for lookup arguments
It is important to note that depending on the field in which we operate, an auxiliary column implementing a lookup argument may actually require more than one trace column. This is specifically true for small fields.
Since Miden uses a 64-bit field, each auxiliary column needs to be represented by columns to achieve ~100-bit security and by columns to achieve ~128-bit security.
- +Multiset checks
A brief introduction to multiset checks can be found here. In Miden VM, multiset checks are used to implement virtual tables and efficient communication buses.
Running product columns
@@ -4626,7 +4626,7 @@Communication buses in Miden VM
In Miden VM, the specialized components are implemented as dedicated segments of the execution trace, which include the 3 chiplets in the Chiplets module (the hash chiplet, bitwise chiplet, and memory chiplet).
Miden VM currently uses multiset checks to implement the chiplets bus , which communicates with all of the chiplets (Hash, Bitwise, and Memory).
- +LogUp: multivariate lookups with logarithmic derivatives
The description of LogUp can be found here. In MidenVM, LogUp is used to implement efficient communication buses.
Using the LogUp construction instead of a simple multiset check with running products reduces the computational effort for the prover and the verifier. Given two columns and in the main trace where contains duplicates and does not (i.e. is part of the lookup table), LogUp allows us to compute two logarithmic derivatives and check their equality.
@@ -4667,7 +4667,7 @@
If any of these flags have degree greater than 2 then this will increase the overall degree of the constraint and reduce the number of lookup requests that can be accommodated by the bus per row.
-
+
Background Material
Proofs of execution generated by Miden VM are based on STARKs. A STARK is a novel proof-of-computation scheme that allows you to create an efficiently verifiable proof that a computation was executed correctly. The scheme was developed by Eli Ben-Sasson, Michael Riabzev et al. at Technion - Israel Institute of Technology. STARKs do not require an initial trusted setup, and rely on very few cryptographic assumptions.
Here are some resources to learn more about STARKs:
diff --git a/tools/debugger.html b/tools/debugger.html
index bc9f9b7df3..85d2c79147 100644
--- a/tools/debugger.html
+++ b/tools/debugger.html
@@ -176,7 +176,7 @@ Polygon Miden VM
-
+
Miden Debugger
The Miden debugger is a command-line interface (CLI) application, inspired by GNU gdb, which allows debugging of Miden assembly (MASM) programs. The debugger allows the user to step through the execution of the program, both forward and backward, either per clock cycle tick, or via breakpoints.
The Miden debugger supports the following commands:
diff --git a/tools/main.html b/tools/main.html
index 27352a2120..5daf47cb17 100644
--- a/tools/main.html
+++ b/tools/main.html
@@ -176,7 +176,7 @@ Polygon Miden VM
-
+
Development Tools and Resources
The following tools are available for interacting with Miden VM:
diff --git a/tools/repl.html b/tools/repl.html
index ce319fe2ca..54c2a9ce5c 100644
--- a/tools/repl.html
+++ b/tools/repl.html
@@ -176,7 +176,7 @@ Polygon Miden VM
-
+
Miden REPL
The Miden Read–eval–print loop (REPL) is a Miden shell that allows for quick and easy debugging of Miden assembly. After the REPL gets initialized, you can execute any Miden instruction, undo executed instructions, check the state of the stack and memory at a given point, and do many other useful things! When the REPL is exited, a history.txt
file is saved. One thing to note is that all the REPL native commands start with an !
to differentiate them from regular assembly instructions.
Miden REPL can be started via the CLI repl command like so:
diff --git a/user_docs/assembly/code_organization.html b/user_docs/assembly/code_organization.html
index bc1071fdeb..3bfa327deb 100644
--- a/user_docs/assembly/code_organization.html
+++ b/user_docs/assembly/code_organization.html
@@ -176,7 +176,7 @@ Polygon Miden VM
-
+
Code organization
A Miden assembly program is just a sequence of instructions each describing a specific directive or an operation. You can use any combination of whitespace characters to separate one instruction from another.
In turn, Miden assembly instructions are just keywords which can be parameterized by zero or more parameters. The notation for specifying parameters is keyword.param1.param2 - i.e., the parameters are separated by periods. For example, push.123
instruction denotes a push
operation which is parameterized by value 123
.
diff --git a/user_docs/assembly/cryptographic_operations.html b/user_docs/assembly/cryptographic_operations.html
index f7be6629a8..9c6aed8eb7 100644
--- a/user_docs/assembly/cryptographic_operations.html
+++ b/user_docs/assembly/cryptographic_operations.html
@@ -176,7 +176,7 @@ Polygon Miden VM
-
+
Cryptographic operations
Miden assembly provides a set of instructions for performing common cryptographic operations. These instructions are listed in the table below.
Hashing and Merkle trees
diff --git a/user_docs/assembly/debugging.html b/user_docs/assembly/debugging.html
index 5b66339e89..60ba96fcf6 100644
--- a/user_docs/assembly/debugging.html
+++ b/user_docs/assembly/debugging.html
@@ -176,7 +176,7 @@ Polygon Miden VM
-
+
Debugging
To support basic debugging capabilities, Miden assembly provides a debug
instruction. This instruction prints out the state of the VM at the time when the debug
instruction is executed. The instruction can be parameterized as follows:
diff --git a/user_docs/assembly/events.html b/user_docs/assembly/events.html
index d5e2942570..096987ba64 100644
--- a/user_docs/assembly/events.html
+++ b/user_docs/assembly/events.html
@@ -176,7 +176,7 @@ Polygon Miden VM
-
+
Events
Miden assembly supports the concept of events. Events are a simple data structure with a single event_id
field. When an event is emitted by a program, it is communicated to the host. Events can be emitted at specific points of program execution with the intent of triggering some action on the host. This is useful as the program has contextual information that would be challenging for the host to infer. The emission of events allows the program to communicate this contextual information to the host. The host contains an event handler that is responsible for handling events and taking appropriate actions. The emission of events does not change the state of the VM but it can change the state of the host.
An event can be emitted via the emit.<event_id>
assembly instruction where <event_id>
can be any 32-bit value specified either directly or via a named constant. For example:
diff --git a/user_docs/assembly/execution_contexts.html b/user_docs/assembly/execution_contexts.html
index 91e11eae1b..f262497b6b 100644
--- a/user_docs/assembly/execution_contexts.html
+++ b/user_docs/assembly/execution_contexts.html
@@ -176,7 +176,7 @@ Polygon Miden VM
-
+
Execution contexts
Miden assembly program execution can span multiple isolated contexts. An execution context defines its own memory space which is not accessible from other execution contexts.
All programs start executing in a root context. Thus, the main procedure of a program is always executed in the root context. To move execution into a different context, we can invoke a procedure using the call
instruction. In fact, any time we invoke a procedure using the call
instruction, the procedure is executed in a new context. We refer to all non-root contexts as user contexts.
diff --git a/user_docs/assembly/field_operations.html b/user_docs/assembly/field_operations.html
index 80836ed881..176e300a87 100644
--- a/user_docs/assembly/field_operations.html
+++ b/user_docs/assembly/field_operations.html
@@ -176,7 +176,7 @@ Polygon Miden VM
-
+
Field operations
Miden assembly provides a set of instructions which can perform operations with raw field elements. These instructions are described in the tables below.
While most operations place no restrictions on inputs, some operations expect inputs to be binary values, and fail if executed with non-binary inputs.
diff --git a/user_docs/assembly/flow_control.html b/user_docs/assembly/flow_control.html
index c6ea91a763..f72aafa86a 100644
--- a/user_docs/assembly/flow_control.html
+++ b/user_docs/assembly/flow_control.html
@@ -176,7 +176,7 @@ Polygon Miden VM
-
+
Flow control
As mentioned above, Miden assembly provides high-level constructs to facilitate flow control. These constructs are:
diff --git a/user_docs/assembly/io_operations.html b/user_docs/assembly/io_operations.html
index fc631c70e3..3d238e608f 100644
--- a/user_docs/assembly/io_operations.html
+++ b/user_docs/assembly/io_operations.html
@@ -176,7 +176,7 @@ Polygon Miden VM
-
+
Input / output operations
Miden assembly provides a set of instructions for moving data between the operand stack and several other sources. These sources include:
diff --git a/user_docs/assembly/main.html b/user_docs/assembly/main.html
index 3c895bbdab..6c0c3fbab8 100644
--- a/user_docs/assembly/main.html
+++ b/user_docs/assembly/main.html
@@ -176,7 +176,7 @@ Polygon Miden VM
-
+
Miden Assembly
Miden assembly is a simple, low-level language for writing programs for Miden VM. It stands just above raw Miden VM instruction set, and in fact, many instructions of Miden assembly map directly to raw instructions of Miden VM.
Before Miden assembly can be executed on Miden VM, it needs to be compiled into a Program MAST (Merkelized Abstract Syntax Tree) which is a binary tree of code blocks each containing raw Miden VM instructions.
diff --git a/user_docs/assembly/stack_manipulation.html b/user_docs/assembly/stack_manipulation.html
index 6730df6e7e..fa8d1e2194 100644
--- a/user_docs/assembly/stack_manipulation.html
+++ b/user_docs/assembly/stack_manipulation.html
@@ -176,7 +176,7 @@ Polygon Miden VM
-
+
Stack manipulation
Miden VM stack is a push-down stack of field elements. The stack has a maximum depth of , but only the top elements are directly accessible via the instructions listed below.
In addition to the typical stack manipulation instructions such as drop
, dup
, swap
etc., Miden assembly provides several conditional instructions which can be used to manipulate the stack based on some condition - e.g., conditional swap cswap
or conditional drop cdrop
.
diff --git a/user_docs/assembly/u32_operations.html b/user_docs/assembly/u32_operations.html
index 25834bc88e..085062e0c4 100644
--- a/user_docs/assembly/u32_operations.html
+++ b/user_docs/assembly/u32_operations.html
@@ -176,7 +176,7 @@ Polygon Miden VM
-
+
u32 operations
Miden assembly provides a set of instructions which can perform operations on regular two-complement 32-bit integers. These instructions are described in the tables below.
For instructions where one or more operands can be provided as immediate parameters (e.g., u32wrapping_add
and u32wrapping_add.b
), we provide stack transition diagrams only for the non-immediate version. For the immediate version, it can be assumed that the operand with the specified name is not present on the stack.
diff --git a/user_docs/main.html b/user_docs/main.html
index b4174bce1e..52a62075c7 100644
--- a/user_docs/main.html
+++ b/user_docs/main.html
@@ -176,7 +176,7 @@ Polygon Miden VM
-
+
User Documentation
In the following sections, we provide developer-focused documentation useful to those who want to develop on Miden VM or build compilers from higher-level languages to Miden VM.
This documentation consists of two high-level sections:
diff --git a/user_docs/stdlib/collections.html b/user_docs/stdlib/collections.html
index 1f385cce2f..e5645cf404 100644
--- a/user_docs/stdlib/collections.html
+++ b/user_docs/stdlib/collections.html
@@ -176,7 +176,7 @@ Polygon Miden VM
-
+
Collections
Namespace std::collections
contains modules for commonly-used authenticated data structures. This includes:
diff --git a/user_docs/stdlib/crypto/dsa.html b/user_docs/stdlib/crypto/dsa.html
index f8aaa1613f..0eb8bb07c7 100644
--- a/user_docs/stdlib/crypto/dsa.html
+++ b/user_docs/stdlib/crypto/dsa.html
@@ -176,7 +176,7 @@ Polygon Miden VM
-
+
Digital signatures
Namespace std::crypto::dsa
contains a set of digital signature schemes supported by default in the Miden VM. Currently, these schemes are:
diff --git a/user_docs/stdlib/crypto/fri.html b/user_docs/stdlib/crypto/fri.html
index f7aa1fb63a..296e85a1f7 100644
--- a/user_docs/stdlib/crypto/fri.html
+++ b/user_docs/stdlib/crypto/fri.html
@@ -176,7 +176,7 @@ Polygon Miden VM
-
+
FRI verification procedures
Namespace std::crypto::fri
contains modules for verifying FRI proofs.
FRI Extension 2, Fold 4
diff --git a/user_docs/stdlib/crypto/hashes.html b/user_docs/stdlib/crypto/hashes.html
index 96d3220641..ca2caa28de 100644
--- a/user_docs/stdlib/crypto/hashes.html
+++ b/user_docs/stdlib/crypto/hashes.html
@@ -176,7 +176,7 @@ Polygon Miden VM
-
+
Cryptographic hashes
Namespace std::crypto
contains modules for commonly used cryptographic hash functions.
BLAKE3
diff --git a/user_docs/stdlib/main.html b/user_docs/stdlib/main.html
index 06e32bc962..92e825b0e6 100644
--- a/user_docs/stdlib/main.html
+++ b/user_docs/stdlib/main.html
@@ -176,7 +176,7 @@ Polygon Miden VM
-
+
Miden Standard Library
Miden standard library provides a set of procedures which can be used by any Miden program. These procedures build on the core instruction set of Miden assembly expanding the functionality immediately available to the user.
The goals of Miden standard library are:
diff --git a/user_docs/stdlib/math/u64.html b/user_docs/stdlib/math/u64.html
index 0a0bc05176..20ebeeb065 100644
--- a/user_docs/stdlib/math/u64.html
+++ b/user_docs/stdlib/math/u64.html
@@ -176,7 +176,7 @@ Polygon Miden VM
-
+
Unsigned 64-bit integer operations
Module std::math::u64
contains a set of procedures which can be used to perform unsigned 64-bit integer operations. These operations fall into the following categories:
diff --git a/user_docs/stdlib/mem.html b/user_docs/stdlib/mem.html
index fe9a251350..fb84339231 100644
--- a/user_docs/stdlib/mem.html
+++ b/user_docs/stdlib/mem.html
@@ -176,7 +176,7 @@ Polygon Miden VM
-
+
Memory procedures
Module std::mem
contains a set of utility procedures for working with random access memory.
Procedure Description
diff --git a/user_docs/stdlib/sys.html b/user_docs/stdlib/sys.html
index ba5b8b6c79..a93062e703 100644
--- a/user_docs/stdlib/sys.html
+++ b/user_docs/stdlib/sys.html
@@ -176,7 +176,7 @@ Polygon Miden VM
-
+
System procedures
Module std::sys
contains a set of system-level utility procedures.
Procedure Description
Miden Debugger
The Miden debugger is a command-line interface (CLI) application, inspired by GNU gdb, which allows debugging of Miden assembly (MASM) programs. The debugger allows the user to step through the execution of the program, both forward and backward, either per clock cycle tick, or via breakpoints.
The Miden debugger supports the following commands:
diff --git a/tools/main.html b/tools/main.html index 27352a2120..5daf47cb17 100644 --- a/tools/main.html +++ b/tools/main.html @@ -176,7 +176,7 @@Polygon Miden VM
Development Tools and Resources
The following tools are available for interacting with Miden VM:
-
diff --git a/tools/repl.html b/tools/repl.html
index ce319fe2ca..54c2a9ce5c 100644
--- a/tools/repl.html
+++ b/tools/repl.html
@@ -176,7 +176,7 @@
Polygon Miden VM
Miden REPL
The Miden Read–eval–print loop (REPL) is a Miden shell that allows for quick and easy debugging of Miden assembly. After the REPL gets initialized, you can execute any Miden instruction, undo executed instructions, check the state of the stack and memory at a given point, and do many other useful things! When the REPL is exited, a history.txt
file is saved. One thing to note is that all the REPL native commands start with an !
to differentiate them from regular assembly instructions.
Miden REPL can be started via the CLI repl command like so:
diff --git a/user_docs/assembly/code_organization.html b/user_docs/assembly/code_organization.html index bc1071fdeb..3bfa327deb 100644 --- a/user_docs/assembly/code_organization.html +++ b/user_docs/assembly/code_organization.html @@ -176,7 +176,7 @@Polygon Miden VM
Code organization
A Miden assembly program is just a sequence of instructions each describing a specific directive or an operation. You can use any combination of whitespace characters to separate one instruction from another.
In turn, Miden assembly instructions are just keywords which can be parameterized by zero or more parameters. The notation for specifying parameters is keyword.param1.param2 - i.e., the parameters are separated by periods. For example, push.123
instruction denotes a push
operation which is parameterized by value 123
.
Polygon Miden VM
Cryptographic operations
Miden assembly provides a set of instructions for performing common cryptographic operations. These instructions are listed in the table below.
Hashing and Merkle trees
diff --git a/user_docs/assembly/debugging.html b/user_docs/assembly/debugging.html index 5b66339e89..60ba96fcf6 100644 --- a/user_docs/assembly/debugging.html +++ b/user_docs/assembly/debugging.html @@ -176,7 +176,7 @@Polygon Miden VM
Debugging
To support basic debugging capabilities, Miden assembly provides a debug
instruction. This instruction prints out the state of the VM at the time when the debug
instruction is executed. The instruction can be parameterized as follows:
-
diff --git a/user_docs/assembly/events.html b/user_docs/assembly/events.html
index d5e2942570..096987ba64 100644
--- a/user_docs/assembly/events.html
+++ b/user_docs/assembly/events.html
@@ -176,7 +176,7 @@
Polygon Miden VM
Events
Miden assembly supports the concept of events. Events are a simple data structure with a single event_id
field. When an event is emitted by a program, it is communicated to the host. Events can be emitted at specific points of program execution with the intent of triggering some action on the host. This is useful as the program has contextual information that would be challenging for the host to infer. The emission of events allows the program to communicate this contextual information to the host. The host contains an event handler that is responsible for handling events and taking appropriate actions. The emission of events does not change the state of the VM but it can change the state of the host.
An event can be emitted via the emit.<event_id>
assembly instruction where <event_id>
can be any 32-bit value specified either directly or via a named constant. For example:
Polygon Miden VM
Execution contexts
Miden assembly program execution can span multiple isolated contexts. An execution context defines its own memory space which is not accessible from other execution contexts.
All programs start executing in a root context. Thus, the main procedure of a program is always executed in the root context. To move execution into a different context, we can invoke a procedure using the call
instruction. In fact, any time we invoke a procedure using the call
instruction, the procedure is executed in a new context. We refer to all non-root contexts as user contexts.
Polygon Miden VM
Field operations
Miden assembly provides a set of instructions which can perform operations with raw field elements. These instructions are described in the tables below.
While most operations place no restrictions on inputs, some operations expect inputs to be binary values, and fail if executed with non-binary inputs.
diff --git a/user_docs/assembly/flow_control.html b/user_docs/assembly/flow_control.html index c6ea91a763..f72aafa86a 100644 --- a/user_docs/assembly/flow_control.html +++ b/user_docs/assembly/flow_control.html @@ -176,7 +176,7 @@Polygon Miden VM
Flow control
As mentioned above, Miden assembly provides high-level constructs to facilitate flow control. These constructs are:
-
diff --git a/user_docs/assembly/io_operations.html b/user_docs/assembly/io_operations.html
index fc631c70e3..3d238e608f 100644
--- a/user_docs/assembly/io_operations.html
+++ b/user_docs/assembly/io_operations.html
@@ -176,7 +176,7 @@
Polygon Miden VM
Input / output operations
Miden assembly provides a set of instructions for moving data between the operand stack and several other sources. These sources include:
-
diff --git a/user_docs/assembly/main.html b/user_docs/assembly/main.html
index 3c895bbdab..6c0c3fbab8 100644
--- a/user_docs/assembly/main.html
+++ b/user_docs/assembly/main.html
@@ -176,7 +176,7 @@
Polygon Miden VM
Miden Assembly
Miden assembly is a simple, low-level language for writing programs for Miden VM. It stands just above raw Miden VM instruction set, and in fact, many instructions of Miden assembly map directly to raw instructions of Miden VM.
Before Miden assembly can be executed on Miden VM, it needs to be compiled into a Program MAST (Merkelized Abstract Syntax Tree) which is a binary tree of code blocks each containing raw Miden VM instructions.
diff --git a/user_docs/assembly/stack_manipulation.html b/user_docs/assembly/stack_manipulation.html index 6730df6e7e..fa8d1e2194 100644 --- a/user_docs/assembly/stack_manipulation.html +++ b/user_docs/assembly/stack_manipulation.html @@ -176,7 +176,7 @@Polygon Miden VM
Stack manipulation
Miden VM stack is a push-down stack of field elements. The stack has a maximum depth of , but only the top elements are directly accessible via the instructions listed below.
In addition to the typical stack manipulation instructions such as drop
, dup
, swap
etc., Miden assembly provides several conditional instructions which can be used to manipulate the stack based on some condition - e.g., conditional swap cswap
or conditional drop cdrop
.
Polygon Miden VM
u32 operations
Miden assembly provides a set of instructions which can perform operations on regular two-complement 32-bit integers. These instructions are described in the tables below.
For instructions where one or more operands can be provided as immediate parameters (e.g., u32wrapping_add
and u32wrapping_add.b
), we provide stack transition diagrams only for the non-immediate version. For the immediate version, it can be assumed that the operand with the specified name is not present on the stack.
Polygon Miden VM
User Documentation
In the following sections, we provide developer-focused documentation useful to those who want to develop on Miden VM or build compilers from higher-level languages to Miden VM.
This documentation consists of two high-level sections:
diff --git a/user_docs/stdlib/collections.html b/user_docs/stdlib/collections.html index 1f385cce2f..e5645cf404 100644 --- a/user_docs/stdlib/collections.html +++ b/user_docs/stdlib/collections.html @@ -176,7 +176,7 @@Polygon Miden VM
Collections
Namespace std::collections
contains modules for commonly-used authenticated data structures. This includes:
-
diff --git a/user_docs/stdlib/crypto/dsa.html b/user_docs/stdlib/crypto/dsa.html
index f8aaa1613f..0eb8bb07c7 100644
--- a/user_docs/stdlib/crypto/dsa.html
+++ b/user_docs/stdlib/crypto/dsa.html
@@ -176,7 +176,7 @@
Polygon Miden VM
Digital signatures
Namespace std::crypto::dsa
contains a set of digital signature schemes supported by default in the Miden VM. Currently, these schemes are:
-
diff --git a/user_docs/stdlib/crypto/fri.html b/user_docs/stdlib/crypto/fri.html
index f7aa1fb63a..296e85a1f7 100644
--- a/user_docs/stdlib/crypto/fri.html
+++ b/user_docs/stdlib/crypto/fri.html
@@ -176,7 +176,7 @@
Polygon Miden VM
FRI verification procedures
Namespace std::crypto::fri
contains modules for verifying FRI proofs.
FRI Extension 2, Fold 4
diff --git a/user_docs/stdlib/crypto/hashes.html b/user_docs/stdlib/crypto/hashes.html index 96d3220641..ca2caa28de 100644 --- a/user_docs/stdlib/crypto/hashes.html +++ b/user_docs/stdlib/crypto/hashes.html @@ -176,7 +176,7 @@Polygon Miden VM
Cryptographic hashes
Namespace std::crypto
contains modules for commonly used cryptographic hash functions.
BLAKE3
diff --git a/user_docs/stdlib/main.html b/user_docs/stdlib/main.html index 06e32bc962..92e825b0e6 100644 --- a/user_docs/stdlib/main.html +++ b/user_docs/stdlib/main.html @@ -176,7 +176,7 @@Polygon Miden VM
Miden Standard Library
Miden standard library provides a set of procedures which can be used by any Miden program. These procedures build on the core instruction set of Miden assembly expanding the functionality immediately available to the user.
The goals of Miden standard library are:
diff --git a/user_docs/stdlib/math/u64.html b/user_docs/stdlib/math/u64.html index 0a0bc05176..20ebeeb065 100644 --- a/user_docs/stdlib/math/u64.html +++ b/user_docs/stdlib/math/u64.html @@ -176,7 +176,7 @@Polygon Miden VM
Unsigned 64-bit integer operations
Module std::math::u64
contains a set of procedures which can be used to perform unsigned 64-bit integer operations. These operations fall into the following categories:
-
diff --git a/user_docs/stdlib/mem.html b/user_docs/stdlib/mem.html
index fe9a251350..fb84339231 100644
--- a/user_docs/stdlib/mem.html
+++ b/user_docs/stdlib/mem.html
@@ -176,7 +176,7 @@
Polygon Miden VM
Memory procedures
Module std::mem
contains a set of utility procedures for working with random access memory.
Procedure | Description |
---|
Procedure | Description |
---|