Processor Table
The Processor Table records all of Triton VM states during execution of a particular program.
The states are recorded in chronological order.
The first row is the initial state, the last (non-padding) row is the terminal state, i.e., the state after having executed instruction halt.
It is impossible to generate a valid proof if the instruction executed last is anything but halt.
It is worth highlighting the initialization of the operational stack.
Stack elements st0 through st10 are initially 0.
However, stack elements st11 through st15, i.e., the very bottom of the stack, are initialized with the hash digest of the program that is being executed.
This is primarily useful for recursive verifiers:
they can compare their own program digest to the program digest of the proof they are verifying.
This way, a recursive verifier can easily determine if they are actually recursing, or whether the proof they are checking was generated using an entirely different program.
A more detailed explanation of the mechanics can be found on the page about program attestation.
Main Columns
The processor consists of all registers defined in the Instruction Set Architecture. Each register is assigned a column in the processor table.
Auxiliary Columns
The Processor Table has the following auxiliary columns, corresponding to Evaluation Arguments, Permutation Arguments, and Lookup Arguments:
RunningEvaluationStandardInputfor the Evaluation Argument with the input symbols.RunningEvaluationStandardOutputfor the Evaluation Argument with the output symbols.InstructionLookupClientLogDerivativefor the Lookup Argument with the Program TableRunningProductOpStackTablefor the Permutation Argument with the Op Stack Table.RunningProductRamTablefor the Permutation Argument with the RAM Table. Note that virtual columninstruction_typeholds value 1 for reads and 0 for writes.RunningProductJumpStackTablefor the Permutation Argument with the Jump Stack Table.RunningEvaluationHashInputfor the Evaluation Argument with the Hash Table for copying the input to the hash function from the processor to the hash coprocessor.RunningEvaluationHashDigestfor the Evaluation Argument with the Hash Table for copying the hash digest from the hash coprocessor to the processor.RunningEvaluationSpongefor the Evaluation Argument with the Hash Table for copying the 10 next to-be-absorbed elements from the processor to the hash coprocessor or the 10 next squeezed elements from the hash coprocessor to the processor, depending on the instruction.U32LookupClientLogDerivativefor the Lookup Argument with the U32 Table.ClockJumpDifferenceLookupServerLogDerivativefor the Lookup Argument of clock jump differences with the Op Stack Table, the RAM Table, and the Jump Stack Table.
Permutation Argument with the Op Stack Table
The subset Permutation Argument with the Op Stack Table RunningProductOpStackTable establishes consistency of the op stack underflow memory.
The number of factors incorporated into the running product at any given cycle depends on the executed instruction in this cycle:
for every element pushed to or popped from the stack, there is one factor.
Namely, if the op stack grows, every element spilling from st15 into op stack underflow memory will be incorporated as one factor;
and if the op stack shrinks, every element from op stack underflow memory being transferred into st15 will be one factor.
Notably, if an instruction shrinks the op stack by more than one element in a single clock cycle, each spilled element is incorporated as one factor. The same holds true for instructions growing the op stack by more than one element in a single clock cycle.
One key insight for this Permutation Argument is that the processor will always have access to the elements that are to be read from or written to underflow memory:
if the instruction grows the op stack, then the elements in question currently reside in the directly accessible, top part of the stack;
if the instruction shrinks the op stack, then the elements in question will be in the top part of the stack in the next cycle.
In either case, the Transition Constraint for the Permutation Argument can incorporate the explicitly listed elements as well as the corresponding trivial-to-compute op_stack_pointer.
Padding
A padding row is a copy of the Processor Table's last row with the following modifications:
- column
clkis increased by 1, - column
IsPaddingis set to 1, - column
cjd_mulis set to 0,
A notable exception:
if the row with clk equal to 1 is a padding row, then the value of cjd_mul is not constrained in that row.
The reason for this exception is the lack of βawarenessβ of padding rows in the Jump Stack Table:
it keeps looking up clock jump differences in its padding section.
All these clock jumps are guaranteed to have magnitude 1.
Arithmetic Intermediate Representation
Let all household items (πͺ₯, π, etc.) be challenges, concretely evaluation points, supplied by the verifier. Let all fruit & vegetables (π₯, π₯₯, etc.) be challenges, concretely weights to compress rows, supplied by the verifier. Both types of challenges are X-field elements, i.e., elements of .
Note, that the transition constraint's use of some_column vs some_column_next might be a little unintuitive.
For example, take the following part of some execution trace.
| Clock Cycle | Current Instruction | st0 | β¦ | st15 | Running Evaluation βTo Hash Tableβ | Running Evaluation βFrom Hash Tableβ |
|---|---|---|---|---|---|---|
foo | 17 | β¦ | 22 | |||
| hash | 17 | β¦ | 22 | |||
bar | 1337 | β¦ | 22 |
In order to verify the correctness of RunningEvaluationHashInput, the corresponding transition constraint needs to conditionally βactivateβ on row-tuple (, ), where it is conditional on ci_next (not ci), and verifies absorption of the next row, i.e., row .
However, in order to verify the correctness of RunningEvaluationHashDigest, the corresponding transition constraint needs to conditionally βactivateβ on row-tuple (, ), where it is conditional on ci (not ci_next), and verifies absorption of the next row, i.e., row .
Initial Constraints
- The cycle counter
clkis 0. - The instruction pointer
ipis 0. - The jump address stack pointer
jspis 0. - The jump address origin
jsois 0. - The jump address destination
jsdis 0. - The operational stack element
st0is 0. - The operational stack element
st1is 0. - The operational stack element
st2is 0. - The operational stack element
st3is 0. - The operational stack element
st4is 0. - The operational stack element
st5is 0. - The operational stack element
st6is 0. - The operational stack element
st7is 0. - The operational stack element
st8is 0. - The operational stack element
st9is 0. - The operational stack element
st10is 0. - The Evaluation Argument of operational stack elements
st11throughst15with respect to indeterminate π₯¬ equals the public part of program digest challenge, π«. See program attestation for more details. - The
op_stack_pointeris 16. RunningEvaluationStandardInputis 1.RunningEvaluationStandardOutputis 1.InstructionLookupClientLogDerivativehas absorbed the first row with respect to challenges π₯, π₯₯, and π« and indeterminate πͺ₯.RunningProductOpStackTableis 1.RunningProductRamTablehas absorbed the first row with respect to challenges π, π, π, and π½ and indeterminate π.RunningProductJumpStackTablehas absorbed the first row with respect to challenges π, π , π, π, and π and indeterminate π§΄.RunningEvaluationHashInputhas absorbed the first row with respect to challenges π§β through π§β and indeterminate πͺ if the current instruction ishash. Otherwise, it is 1.RunningEvaluationHashDigestis 1.RunningEvaluationSpongeis 1.U32LookupClientLogDerivativeis 0.ClockJumpDifferenceLookupServerLogDerivativestarts having accumulated the first contribution.
Consistency Constraints
- The composition of instruction bits
ib0throughib6corresponds to the current instructionci. - The instruction bit
ib0is a bit. - The instruction bit
ib1is a bit. - The instruction bit
ib2is a bit. - The instruction bit
ib3is a bit. - The instruction bit
ib4is a bit. - The instruction bit
ib5is a bit. - The instruction bit
ib6is a bit. - The padding indicator
IsPaddingis either 0 or 1. - If the current padding row is a padding row and
clkis not 1, then the clock jump difference lookup multiplicity is 0.
Transition Constraints
Due to their complexity, instruction-specific constraints are defined in their own section. The following additional constraints also apply to every pair of rows.
- The cycle counter
clkincreases by 1. - The padding indicator
IsPaddingis 0 or remains unchanged. - If the next row is not a padding row, the logarithmic derivative for the Program Table absorbs the next row with respect to challenges π₯, π₯₯, and π« and indeterminate πͺ₯. Otherwise, it remains unchanged.
- The running sum for the logarithmic derivative of the clock jump difference lookup argument accumulates the next row's
clkwith the appropriate multiplicitycjd_mulwith respect to indeterminate πͺ. - The running product for the Jump Stack Table absorbs the next row with respect to challenges π, π , π, π, and π and indeterminate π§΄.
-
- If the current instruction in the next row is
hash, the running evaluation βHash Inputβ absorbs the next row with respect to challenges π§β through π§β and indeterminate πͺ. - If the current instruction in the next row is
merkle_stepormerkle_step_memand helper variablehv5β¦- β¦is 0, the running evaluation βHash Inputβ absorbs next row's
st0throughst4andhv0throughhv4β¦ - β¦is 1, the running evaluation βHash Inputβ absorbs next row's
hv0throughhv4andst0throughst4β¦
β¦with respect to challenges π§β through π§β and indeterminate πͺ.
- β¦is 0, the running evaluation βHash Inputβ absorbs next row's
- Otherwise, it remains unchanged.
- If the current instruction in the next row is
- If the current instruction is
hash,merkle_step, ormerkle_step_mem, the running evaluation βHash Digestβ absorbs the next row with respect to challenges π§β through π§β and indeterminate πͺ. Otherwise, it remains unchanged. - If the current instruction is
sponge_init, then the running evaluation βSpongeβ absorbs the current instruction and the Sponge's default initial state with respect to challenges π§ and π§β through π§β and indeterminate π§½. Else if the current instruction issponge_absorb, then the running evaluation βSpongeβ absorbs the current instruction and the current row with respect to challenges π§ and π§β through π§β and indeterminate π§½. Else if the current instruction issponge_squeeze, then the running evaluation βSpongeβ absorbs the current instruction and the next row with respect to challenges π§ and π§β through π§β and indeterminate π§½. Else if the current instruction issponge_absorb_mem, then the running evaluation βSpongeβ absorbs the opcode of instructionsponge_absorband stack elementsst1throughst4and all 6 helper variables with respect to challenges π§ and π§β through π§β and indeterminate π§½. Otherwise, the running evaluation remains unchanged. -
- If the current instruction is
split, then the logarithmic derivative for the Lookup Argument with the U32 Table accumulatesst0andst1in the next row andciin the current row with respect to challenges π₯, π°, and π₯, and indeterminate π§·. - If the current instruction is
lt,and,xor, orpow, then the logarithmic derivative for the Lookup Argument with the U32 Table accumulatesst0,st1, andciin the current row andst0in the next row with respect to challenges π₯, π°, π₯, and π₯, and indeterminate π§·. - If the current instruction is
log_2_floor, then the logarithmic derivative for the Lookup Argument with the U32 Table accumulatesst0andciin the current row andst0in the next row with respect to challenges π₯, π₯, and π₯, and indeterminate π§·. - If the current instruction is
div_mod, then the logarithmic derivative for the Lookup Argument with the U32 Table accumulates bothst0in the next row andst1in the current row as well as the constantsopcode(lt)and1with respect to challenges π₯, π°, π₯, and π₯, and indeterminate π§·.st0in the current row andst1in the next row as well asopcode(split)with respect to challenges π₯, π°, and π₯, and indeterminate π§·.
- If the current instruction is
merkle_stepormerkle_step_mem, then the logarithmic derivative for the Lookup Argument with the U32 Table accumulatesst5from the current and next rows as well asopcode(split)with respect to challenges π₯, π°, and π₯, and indeterminate π§·. - If the current instruction is
pop_count, then the logarithmic derivative for the Lookup Argument with the U32 Table accumulatesst0andciin the current row andst0in the next row with respect to challenges π₯, π₯, and π₯, and indeterminate π§·. - Else, i.e., if the current instruction is not a u32 instruction, the logarithmic derivative for the Lookup Argument with the U32 Table remains unchanged.
- If the current instruction is
Terminal Constraints
- In the last row, register βcurrent instructionβ
ciis 0, corresponding to instructionhalt.