triton-opcodes

Crates.iotriton-opcodes
lib.rstriton-opcodes
version0.31.0
sourcesrc
created_at2022-12-22 11:19:40.762568
updated_at2023-07-05 09:57:10.811908
descriptionTriton VM instructions and their translations
homepagehttps://triton-vm.org/
repositoryhttps://github.com/TritonVM/triton-vm
max_upload_size
id743831
size71,931
(aszepieniec)

documentation

https://triton-vm.org/spec/

README

triton-opcodes

Triton VM (GitHub, Crates.io) is a virtual machine that comes with Algebraic Execution Tables (AET) and Arithmetic Intermediate Representations (AIR) for use in combination with a STARK proof system.

The package triton-opcodes delivers the Instruction type and a parser from assembly like:

// Swap the top two stack elements so they're sorted.
//
// The larger element is at the top.
//
// Before: _ a b
// After: _ min(a, b) max(a, b)
minmax:
    dup 1        // _ a b a
    dup 1        // _ a b a b
    lt           // _ a b (b < a)
    skiz swap 1  // _ min(a, b) max(a, b)
    return

Features:

  • pseudo-instructions like lt by simple substitution.
  • labelled jumps where labels look like <name>: and jumping to them looks like call <name>.
  • inline comments in the form // ....
Commit count: 2281

cargo fmt