Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[chore] Mention the new HintRandom phantom discriminant in the docs (see PR#1294) #1296

Merged
merged 2 commits into from
Jan 26, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion docs/specs/ISA.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ To enable user input and non-determinism in OpenVM programs, we maintain the fol
runtime execution
- `hint_stream`: a queue of values populated during runtime execution via [phantom sub-instructions](#phantom-sub-instructions) such as `Rv32HintInput`, `NativeHintInput`, and `NativeHintBits`.

These streams do not live in OpenVM memory, and their state is not constrained in ZK. At runtime, instructions like `HINT_STORE_RV32` (from the RV32IM extension) and `HINT_STOREW, HINT_STOREW4` (from the native extension) can read from the `hint_stream` and write them to OpenVM memory to provide non-deterministic hints.
These streams do not live in OpenVM memory, and their state is not constrained in ZK. At runtime, instructions like `HINT_STORE_RV32` (from the RV32IM extension) and `HINT_STOREW`, `HINT_STOREW4` (from the native extension) can read from the `hint_stream` and write them to OpenVM memory to provide non-deterministic hints.

### Public Inputs and Outputs

Expand Down Expand Up @@ -280,6 +280,7 @@ The RV32IM extension defines the following phantom sub-instructions.
| ------------------------- | ------------ | ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Rv32HintInput | 0x20 | `_` | Pops a vector `hint` of field elements from the input stream and resets the hint stream to equal the vector `[(hint.len() as u32).to_le_bytes()), hint].concat()`. |
| Rv32PrintStr | 0x21 | `a,b,_` | Peeks at `[r32{0}(a)..r32{0}(a) + r32{0}(b)]_2`, tries to convert to byte array and then UTF-8 string and prints to host stdout. Prints error message if conversion fails. Does not change any VM state. |
| Rv32HintRandom | 0x22 | `a,_,_` | Resets the hint stream to `4 * r32{0}(a)` random bytes. |
yi-sun marked this conversation as resolved.
Show resolved Hide resolved


### Native Extension
Expand Down
Loading