Aztec's zk\(^2\)-Rollup
Part \(1\)
UTXO vs Account
Aztec Model
20
Bob
Alice
Open account
\(\texttt{bob}\)
\(\texttt{alice}\)
8
2
10
10
0.5
1.5
18
2
10
Shield
Rollup Contract
Account UTXO
Value UTXO
Private sends
\(\text{zkETH}=8.5\)
\(\text{zkDAI}=18\)
\(\text{zkETH}=1.5\)
\(\text{zkDAI}=2\)
Withdraw
\(0\)
1.5
Aztec Notes
- Account balances are calculated by adding up the available UTXOs
- UTXOs are called as notes: \(\textcolor{orange}{\textsf{Account}}\) notes and \(\textcolor{violet}{\textsf{Value}}\) notes
- State transition in UTXO model is tricky
- A user creates an account on zk.money using an alias and a nonce \(n \in \mathbb{Z}^{32}_2\)
- We compute an account identifier as:Â
- Account information is stored in account notes
Account PK
Account id
Spending PK1
\(a_{\text{id}} \ \in \ \mathbb{Z}_2^{32}\)
\(S_1 \ \in \ \mathbb{G}_1\)
\(A \ \in \ \mathbb{G}_1\)
Account PK
Account id
Spending PK2
\(a_{\text{id}} \ \in \ \mathbb{Z}_2^{32}\)
\(S_2 \ \in \ \mathbb{G}\)
\(A \ \in \ \mathbb{G}_1\)
\(a_{\text{id}} \coloneqq \left( n \ \| \ H_{B}\left(\texttt{suyashbagad}\right)[ \ 0 : 224 \ ]\right) \in \mathbb{Z}^{256}_2\)
- Spending keys are used for signing transactions
Aztec Notes
- Aztec uses value notes as a basis for private transactions on Ethereum
Value
Asset id
Nonce
Owner
Secret
\(a \ \in \ \mathbb{Z}_2^{32}\)
\(A \ \in \ \mathbb{G}_1\)
\(n \ \in \ \mathbb{Z}_2^{32}\)
\(v \ \in \ \mathbb{F}_q\)
\(s \ \in \ \mathbb{F}_q\)
- A value note is given as: \(\mathcal{V} = \{a, v, n, \mathcal{O}, s\}\)
- The nonce here is same as the one used in an account note
- A note incorporates the on-chain identity (i.e. account PK) of its owner
- The secret \(s\) is the hiding factor in computing Pedersen commitment to a note:
Plonk Overview
Arithmetic Circuit
- A typical computational problem: find solutions to the equation (i.e. \(\textsf{stmt}\))
\(x_1^2 \cdot x_2 + x_1 + 1 = 22\)
- Witness: \(w \equiv (x_1=3, x_2=2)\), public inputs: \(\ell \equiv (c=1, z=22)\)
- I can convince you that I know a solution \(w\) to \(\{\textsf{stmt}, \ell\}\) without revealing \(w\)Â
- PLONK: Circuit size: \(n=4\), prover: \(\mathcal{O}(n\cdot\text{log}n)\), proof size and verifier: \(\mathcal{O}(1)\)
Plonk Arithmetisation
StandardPlonk
TurboPlonk
Width = \(4\)
Circuit size = \(n\)
Copy constraints
Cell-wise permutation
Plonk Preprocessing
Width = \(4\)
Circuit size = \(n\)
Constraint Selectors
Permutation Selectors
Plonk Preprocessing
Constraint Selectors
Permutation Selectors
- Compute and store coset-FFTs of selector polynomial over domain of size \(4n\)
- Verification key consists of commitments to the selector polynomials
- Selector polynomials are fixed for a given circuit/computation
- FFT: \((7+4) \times 4n\)
- MSM: \((7 + 4) \times n\)
- Memory: \((7 + 4) \times 5n\)
Plonk Prover: Round 0
- Convert wire polynomials to coefficient form
Width = \(4\)
Circuit size = \(n\)
Plonk Prover: Round 1
- Commit to wire polynomials
Width = \(4\)
Circuit size = \(n\)
- Update proof: \(\pi \leftarrow (\textcolor{orange}{[a]}, \textcolor{orange}{[b]}, \textcolor{orange}{[c]}, \textcolor{orange}{[d]})\)
Plonk Prover: Round 2
- Compute permutation polynomial \(z(X)\)
Width = \(4\)
Circuit size = \(n\)
Plonk Prover: Round 3
- Compute quotient polynomial \(t(X)\)
- Number of wires decide the degree of \(t(X)\): \((4n-5)\)
- Lots of polynomial multiplication and division in computing \(t(X)\)
- Easier to compute in evaluation form
- But need the evaluation over a domain of size \(4n\) 😯
- Hence need all component polynomials to be in coset-fft form
Plonk Prover: Round 3
- Compute quotient polynomial \(t(X)\)
Plonk Prover: Round 3
- Compute quotient polynomial \(t(X)\)
Plonk Prover: Round 4, 5
- Round 4: Compute opening evaluations
- Round 5: Compute linearisation polynomial \(r(X)\)
- \(r(X)\) is a degree-\((n-1)\) polynomial
- By combining many polynomials linearly, we avoid opening them individually
Plonk Prover: Round 5
- Round 5 (contd.): Compute KZG opening proofs
\(\pi = \bigg\{\underbrace{[a]_1, [b]_1, [c]_1, [d]_1, [z]_1, [t_1]_1, [t_2]_1, [t_3]_1, [t_4]_1, [W_{\mathfrak{z}}]_1, [W_{\mathfrak{z\omega}}]_1}_{\mathbb{G}_1^{2w + 3}}, \ \underbrace{\bar{a}, \bar{b}, \bar{c}, \bar{d}, \bar{z}_{\omega}, \bar{s}_{\sigma_1}, \bar{s}_{\sigma_2}, \bar{s}_{\sigma_3}}_{\mathbb{F}_p^{2w}} \bigg\}\)
Plonk Prover: Benchmarking
Circuit size: \(2^{16}\)
Circuit size: \(2^{20}\)
Recursion Basics
Recursive Proof Verification
- A Plonk proof \(\pi\) is verified by checking equality of polynomial evaluations
\(W_{\mathfrak{z}}(x) \cdot (x - \mathfrak{z}) = F_1(x) - F_1(\mathfrak{z})\)
\(W_{\mathfrak{z\omega}}(x) \cdot (x - \mathfrak{z}\omega) = F_2(x) - F_2(\mathfrak{z}\omega)\)
\(W_{\mathfrak{z}}(x) \cdot (x - \mathfrak{z}) + u \cdot (W_{\mathfrak{z\omega}}(x) \cdot (x - \mathfrak{z}\omega))= F_1(x) - F_1(\mathfrak{z}) + u \cdot (F_2(x) - F_2(\mathfrak{z}\omega))\)
\(\pi = \bigg\{\underbrace{[a]_1, [b]_1, [c]_1, [d]_1, [z]_1, [t_1]_1, [t_2]_1, [t_3]_1, [t_4]_1, [W_{\mathfrak{z}}]_1, [W_{\mathfrak{z\omega}}]_1}_{\mathbb{G}_1^{2w + 3}}, \ \underbrace{\bar{a}, \bar{b}, \bar{c}, \bar{d}, \bar{z}_{\omega}, \bar{s}_{\sigma_1}, \bar{s}_{\sigma_2}, \bar{s}_{\sigma_3}}_{\mathbb{F}_p^{2w}} \bigg\}\)
Recursive Proof Verification
- A Plonk proof \(\pi\) is verified by checking equality of polynomial evaluations
\(W_{\mathfrak{z}}(x) \cdot (x - \mathfrak{z}) = F_1(x) - F_1(\mathfrak{z})\)
\(W_{\mathfrak{z\omega}}(x) \cdot (x - \mathfrak{z}\omega) = F_2(x) - F_2(\mathfrak{z}\omega)\)
\(W_{\mathfrak{z}}(x) \cdot (x - \mathfrak{z}) + u \cdot (W_{\mathfrak{z\omega}}(x) \cdot (x - \mathfrak{z}\omega))= F_1(x) - F_1(\mathfrak{z}) + u \cdot (F_2(x) - F_2(\mathfrak{z}\omega))\)
\(\underbrace{\left(W_{\mathfrak{z}}(x) + uW_{\mathfrak{z\omega}}(x)\right)}_{P_0} \cdot x = \underbrace{\left(\mathfrak{z}W_{\mathfrak{z}}(x) + u\mathfrak{z}\omega W_{\mathfrak{z\omega}}(x)) + F(x) - E\right)}_{P_1}\)
\(P_0 \cdot x \stackrel{?}{=} P_1\)
\(\pi = \bigg\{\underbrace{[a]_1, [b]_1, [c]_1, [d]_1, [z]_1, [t_1]_1, [t_2]_1, [t_3]_1, [t_4]_1, [W_{\mathfrak{z}}]_1, [W_{\mathfrak{z\omega}}]_1}_{\mathbb{G}_1^{2w + 3}}, \ \underbrace{\bar{a}, \bar{b}, \bar{c}, \bar{d}, \bar{z}_{\omega}, \bar{s}_{\sigma_1}, \bar{s}_{\sigma_2}, \bar{s}_{\sigma_3}}_{\mathbb{F}_p^{2w}} \bigg\}\)
Recursive Proof Verification
- Suppose we have \(n\) Plonk proofs \((\pi_1, \pi_2, \dots, \pi_m)\) with verification equations:
\(P_0^{(i)} \cdot x \stackrel{?}{=} P_1^{(i)} \quad \forall i \in [m]\)
\(\left(P_0^{(1)} + qP_0^{(2)} + \dots +Â q^{m-1}P_0^{(m)}\right) \cdot x \stackrel{?}{=} \left(P_1^{(1)} + qP_1^{(2)} \dots + q^{m-1}P_1^{(m)}\right)\)
- A single pairing is \(\approx 300\) times costlier than a scalar multiplication
- Using recursive verification, we can verify any number of Plonk proofs using a single pairing
- Too good to be true? The circuit size presents a practical constraint on the number of proofs to be rolled up
- Failure of the recursive check implies at least one of the \(n\) proofs is wrong
Recursive Verification Circuit
- To recursively verify proofs, we only need to compute:
Past \(n\) proofs
Current proof
- So this is a scalar multiplication of size \(\approx (m + 10)\)
- This involves non-native computation: i.e. computation in \(\mathbb{F}_q\) over a circuit modulo \(\mathbb{F}_p\) where \(q \gg p\).
- Performing non-native arithmetic over arithmetic circuits is very costly
- Therefore recursive verification circuits tend to be huge
Aztec Circuit Landscape
Transaction Proofs
Account Proofs
Root Rollup Proof:
Tx Rollup Proofs:
Root Verifier Proof:
Aztec's zk-zk-Rollup Analysis
By Suyash Bagad
Aztec's zk-zk-Rollup Analysis
- 110