Logic proof
The purpose of this Stark is to prove integrity of sponge operations as a part of building Keccak. KeccakSponge proof via zk-STARKs enables efficient verification of logical operations(xor, and, or) using CPUStark in EVM, but for our needs we use the Stark only for xor operation proving with state and input blocks in KeccakSpongeStark.
Circuit
Private inputs include data fields about each value:
operator
flag of logical operatorinput0
first operand of logical operationinput1
second operand of logical operationresult
of logical operation
Columns that are used in trace rows generation:
IS_AND
flag that describes AND operation, must be booleanIS_OR
flag that describes OR operation, must be booleanIS_XOR
flag that describes XOR operation, must be booleanINPUT0
left operand(256 bits) of operation that are decomposed from U256INPUT1
right operand(256 bits) of operation that are decomposed from U256RESULT
the result of operation that is packed in 32 bits from U256
Constraints
The Logic Stark aims to constrain the following aspects:
Ensure that all bits are indeed bits.
The result will be ‘
input0
OPinput1
= sum coeff * (input0
+input1
) + and coeff(input0
ANDinput1
)‘. AND => sum coeff = 0, and coeff = 1, OR => sum coeff = 1, and coeff = -1, XOR => sum coeff = 1, and coeff = -2
The function is used in proving STARK using CTL:
ctl_logic()
prove that concatenation columns oforiginal_rate_u32s
,block_bytes
,xored_rate_u32s
and flag of xor operation in KeccakSponge table is equal to concatenation ofinput0
,input1
and flag of xor operation. This function guarantees that xor operation of state andblock_bytes
is correct.
Last updated