ToolszkEVMArchitectureProving system

Selector columns

In the above discussions, we have generally signalled the operation applied to a specific row by writing the operation alongside that row, but outside the matri

In the above discussions, we have generally signalled the operation applied to a specific row by writing the operation alongside that row, but outside the matrix.

There is a need to pull in this information into the execution matrix.

For this purpose extra columns, called selector columns, are appended to the execution matrix.

A selector column will mostly consist of zeros, "00"s, and ones, "11"s, where a 11 appears in the row to which the operation is applied.

Example: (Selector columns)

Consider the two operations defined in the previous example:

Op1:a=a+b+cOp2:c=a+b+c+a+b\begin{aligned} &\texttt{Op1}:a' = a + b + c \\ &\texttt{Op2}:c' = a + b + c + a' + b' \end{aligned}

Their corresponding selector columns are given the same name, and are incorporated in the execution matrix as shown below.

 A  B  C OP1OP2a0b0c010a1b1c101a2b2c2\begin{aligned} \begin{array}{|c|c|c|c|c|c|}\hline {\texttt{ A }} & {\texttt{ B }} & {\texttt{ C }} & {\texttt{OP1}} & {\texttt{OP2}} \\ \hline a_0 & b_0 & c_0 & 1 & 0 \\ \hline a_1 & b_1 & c_1 & 0 & 1 \\ \hline a_2 & b_2 & c_2 & - & - \\ \hline \end{array} \end{aligned}

This way, the appearance of 11 in each of the columns Op1\texttt{Op1} and Op2\texttt{Op2} flags when the respective operation is executed.

Designing the execution traces in this way is fully aligned with how interpolation is applied to the execution traces, that is to say column-wise.

Selector columns are used to control whether the constraints of an operation apply or not, meaning whether Opx\texttt{Opx} or Opy\texttt{Opy} is applied to a particular row.

Selector columns and constraints

Next we explain how to test the correctness of the execution trace in each row with just one equation.

Firstly, note that:

Op1: a=a+b+ca+b+ca=0Op2: c=a+b+c+a+ba+b+c+a+bc=0\begin{aligned} &\texttt{Op1}:\ a' = a + b + c \quad\quad \Rightarrow \quad a + b + c - a' = 0 \\ &\texttt{Op2}:\ c' = a + b + c + a' + b' \quad \Rightarrow \quad a + b + c + a' + b' - c' = 0 \end{aligned}

Secondly, correct execution of each operation is tested with a zero-check. That is, checking each of the second equations:

Op1: a+b+ca=0Op2: a+b+c+a+bc=0\begin{aligned} &\texttt{Op1}:\ a + b + c - a' = 0 \\ &\texttt{Op2}:\ a + b + c + a' + b' - c' = 0 \end{aligned}

Thirdly, each operation is only checked if it was applied to the particular row. That is, only if a value Opx=1\texttt{Opx} = 1 appears in the corresponding row. That is, with respect to each operation Opx\texttt{Opx}, the following factor is tested:

Op1(1Op2)=1only ifOp1=1\texttt{Op1} \cdot \big( 1 - \texttt{Op2} \big) = 1\quad \text{only if}\quad \texttt{Op1} = 1 Op2(1Op1)=1only ifOp2=1\texttt{Op2} \cdot \big( 1 - \texttt{Op1} \big) = 1\quad \text{only if}\quad \texttt{Op2} = 1

Note that, Op1=0\texttt{Op1} = 0 if Op2=1\texttt{Op2} = 1, and conversely, Op2=0\texttt{Op2} = 0 if Op1=1\texttt{Op1} = 1.

Putting all these together, checking correctness of execution culminates in testing the following constraint:

Op1(1Op2)(a+b+ca)+Op2(1Op1)(a+b+c+a+bc)=0\texttt{Op1}·(1- \texttt{Op2})·(a+b+c-a')+ \texttt{Op2}·(1- \texttt{Op1})·(a+b+c+a'+b'-c')=0

Example: (Checking execution correctness)

Consider the above execution trace of the operations Op1\texttt{Op1} and Op2\texttt{Op2}.

In the first row, Op1\texttt{Op1} = 1 and Op2\texttt{Op2} = 0, so the right-hand side of the constraint reduces to:

1(10)(a+b+ca)+0(11)(a+b+c+a+bc)=a+b+ca1·(1-0)·(a + b + c - a') + 0·(1 - 1)·(a + b + c + a' + b' - c')= a+b+c-a'

which equals 00 only if a=a+b+ca' = a + b + c. And thus proving that Op1\texttt{Op1} was correctly executed.

Similarly, in the second row, Op2\texttt{Op2} = 1 and Op1\texttt{Op1} = 0, and the right-hand side of the constraint yields:

0(11)(a+b+ca)+1(10)(a+b+c+a+bc)=a+b+c+a+bc0·(1-1)·(a + b + c - a') + 1·(1 - 0)·(a + b + c + a' + b' - c')= a + b + c + a' + b' - c'

which is 00 only if c=a+b+c+a+bc' = a + b + c + a' + b'. And this proves that Op2\texttt{Op2} was correctly executed.

The values in the selector columns are independent of the input values x=(x0,x1,x2,...,xl)x = (x_0, x_1, x_2, ... , x_l), but are rather determined by the computation itself.

That is, the input program: (Op1,Op2)\big( \texttt{Op1}, \texttt{Op2} \big), as seen in the above example.

Note that the input program could well be (Op1,Op1,Op2,Op1,Op2,Op1)\big( \texttt{Op1}, \texttt{Op1}, \texttt{Op2}, \texttt{Op1}, \texttt{Op2}, \texttt{Op1} \big), resulting in the execution trace with the following selector columns:

 A  B  C OP1OP2a0b0c010a1b1c110a2b2c201a3b3c3a4b4c410a5b5c501a6b6c6a7b7c710\begin{aligned} \begin{array}{|c|c|c|c|c|c|}\hline {\texttt{ A }} & {\texttt{ B }} & {\texttt{ C }} & {\texttt{OP1}} & {\texttt{OP2}} \\ \hline a_0 & b_0 & c_0 & 1 & 0 \\ \hline a_1 & b_1 & c_1 & 1 & 0 \\ \hline a_2 & b_2 & c_2 & 0 & 1 \\ \hline a_3 & b_3 & c_3 & - & - \\ \hline a_4 & b_4 & c_4 & 1 & 0 \\ \hline a_5 & b_5 & c_5 & 0 & 1 \\ \hline a_6 & b_6 & c_6 & - & - \\ \hline a_7 & b_7 & c_7 & 1 & 0 \\ \hline \end{array} \end{aligned}

Therefore, for each computation, selector columns can be preprocessed.

Edit on GitHub

Last updated on