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:
operatorflag of logical operatorinput0first operand of logical operationinput1second operand of logical operationresultof logical operation
Columns that are used in trace rows generation:
IS_ANDflag that describes AND operation, must be booleanIS_ORflag that describes OR operation, must be booleanIS_XORflag that describes XOR operation, must be booleanINPUT0left operand(256 bits) of operation that are decomposed from U256INPUT1right operand(256 bits) of operation that are decomposed from U256RESULTthe 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 ‘
input0OPinput1= sum coeff * (input0+input1) + and coeff(input0ANDinput1)‘. 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_u32sand flag of xor operation in KeccakSponge table is equal to concatenation ofinput0,input1and flag of xor operation. This function guarantees that xor operation of state andblock_bytesis correct.
Last updated