Post · 11 min read· pp. 128–134

Feist-Khovratovich technique for computing KZG proofs fast

tl;dr: Given a polynomial f(X)f(X) of degree mm, can we compute all nn KZG proofs for f(ωk),k∈[0,n−1]f(\omega^k), k\in[0,n-1] in O(nlog⁡n)O(n\log{n}) time, where ω\omega is a primitive nnth root of unity? Dankrad Feist and Dmitry Khovratovich [^FK20] give a resounding ‘yes!’

There may now be improvements over FK that are faster [^CJLplus24e],^,[^LJGK25e]. This blog post still only explains the original FK algorithm.

\def\Adv{\mathcal{A}} \def\Badv{\mathcal{B}} \def\vect#1{\mathbf{#1}} %\definecolor{myBlueColor}{HTML}{268BD2} %\definecolor{myPinkColor}{HTML}{D33682} %\definecolor{myGreenColor}{HTML}{859900} %\def\mygreen#1{\color{myGreenColor}{#1}} %\def\mygreen#1{\color{green}{#1}} %\newcommand{\myblue}[1]{\textcolor{myBlueColor}{#1}} %\newcommand{\mypink}[1]{\textcolor{myPinkColor}{#1}}

Preliminaries

First, read:

Notation:

  • gg generates a “bilinear” group \Gr\Gr of prime order pp, endowed with a bilinear map or pairing e:\Gr×\Gr→\GrTe : \Gr\times\Gr\rightarrow\Gr_T
    • we use multiplicative notation here: i.e., gag^a denotes composing gg with itself aa times
  • there exists a primitive nnth root of unity ω\omega, where nn is a power of two
  • we have qq-SDH public parameters (g,gτ,gτ2,…,gτq)\left(g, g^\tau,g^{\tau^2},\dots,g^{\tau^q}\right), for q≤nq \le n
  • we work with polynomials in \Zp[X]\Zp[X] of degree ≤n\le n

Other works that give related techniques to compute proofs fast in KZG-like polynomial commitments are:

  • Authenticated multipoint evaluation trees (AMTs) (see paper [^TCZplus20] and blogpost)
  • “How to compute all Pointproofs” (see paper [^Tome20How]), much inspired by Feist and Khovratovich’s technique explained in this blogpost

Refresher: Computing nn different KZG proofs

Let f(X)f(X) be a polynomial with coefficients fif_i:

f(X)=fmXm+fm−1Xm−1+⋯f1X+f0=∑i∈[0,m]fiXi\begin{align*} f(X) &= f_m X^m + f_{m-1} X^{m-1} + \cdots f_1 X + f_0\\ &= \sum_{i\in[0,m]} f_i X^i \end{align*}

Recall that a KZG evaluation proof πi\pi_i for f(ωi)f(\omega^i) is a KZG commitment to a quotient polynomial Qi(X)=f(X)−f(ωi)X−ωiQ_i(X) = \frac{f(X) - f(\omega^i)}{X-\omega^i}:

πi=gQi(τ)=gf(τ)−f(ωi)τ−ωi\begin{align*} \pi_i = g^{Q_i(\tau)} = g^{\frac{f(\tau) - f(\omega^i)}{\tau-\omega^i}} \end{align*}

Computing such a proof takes O(m)O(m) time!

But what if we want to compute all πi,i∈[0,n)\pi_i, i\in[0, n)?

If done naively, this would take O(nm)O(nm) time, which is too expensive!

Lower bound? Is this O(nm)O(nm) time complexity inherent? After all, to compute πi\pi_i don’t we first need to compute Qi(X)Q_i(X), which takes O(m)O(m) time? As you’ll see below, the answer is “no!”

Fortunately, Feist and Khovratovich observe that the QiQ_i’s are algebraically-related and so are their πi\pi_i KZG commitments! As a result, they observe that computing all πi\pi_i’s does not require computing all QiQ_i’s.

Below, we explain how their faster, O(nlog⁡n)O(n\log{n})-time technique works!

An important caveat is that their technique relies on the evaluation points being ω0,…,ωn−1\omega^0,\dots,\omega^{n-1}.

Quotient polynomials and their coefficients

To understand how the πi\pi_i’s relate to one other, let us look at the coefficients of Qi(X)Q_i(X).

We can show that when dividing ff (of degree mm) by (X−ωi)(X-\omega^i) we obtain a quotient polynomial with coefficients t0,t1,…,tm−1t_0, t_1, \dots, t_{m-1} such that:

\labeleq:div−coeffs−1tm−1=fm\labeleq:div−coeffs−2tj=fj+1+ωi⋅tj+1,∀j∈[0,m−1)\begin{align} \label{eq:div-coeffs-1} t_{m-1} &= f_m\\ %t_{m-2} &= f_{m-1} + \omega^i \cdot f_m\\ %t_{m-3} &= f_{m-2} + \omega^i \cdot t_{m-2}\\ % &= f_{m-2} + \omega^i \cdot (f_{m-1} + \omega^i \cdot f_m)\\ % &= f_{m-2} + \omega^i \cdot f_{m-1} + \omega^{2i} \cdot f_m\\ %t_{m-4} &= f_{m-3} + \omega^i \cdot t_{m-3}\\ % &= f_{m-3} + \omega^i \cdot (f_{m-2} + \omega^i \cdot f_{m-1} + \omega^{2i} \cdot f_m)\\ % &= f_{m-3} + \omega^i \cdot f_{m-2} + \omega^{2i} \cdot f_{m-1} + \omega^{3i} \cdot f_m\\\ % & \vdots\\ \label{eq:div-coeffs-2} t_{j} &= f_{j+1} + \omega^i \cdot t_{j+1}, \forall j \in [0, m-1) % & \vdots\\ % t_0 &= f_1 + \omega^i \cdot f_2 + \omega^{2i} f_3 + \dots + \omega^{m-1} f_m \end{align}
Note that the tit_i’s are a function of fm,fm−1,…,f1f_m, f_{m-1},\dots, f_1, but not of f0f_0!

Proof: One could prove by induction that the coefficients above are correct. However, it's easiest to take an example and convince yourself, as shown below for m=4m=4. (Click to expand.)

Indeed, the quotient obtained when dividing f(X)=f3X3+f2X2+⋯+f0f(X) = f_3 X^3 + f_2 X^2 + \dots + f_0 by X−ωiX-\omega^i exactly matches Equations \refeq:div−coeffs−1\ref{eq:div-coeffs-1} and \refeq:div−coeffs−2\ref{eq:div-coeffs-2} above:

Specifically, the quotient's coefficients, as expected, are:

t2=f3t1=f2+ωit2=f2+ωif3t0=f1+ωit1=f1+ωi⋅(f2+ωif3)=f1+ωif2+ω2if3\begin{align} t_2 &= \color{green}{f_3}\\ t_1 &= f_2 + \omega^i t_2\\ &= \color{blue}{f_2 + \omega^i f_3}\\ t_0 &= f_1 + \omega^i t_1 = f_1 + \omega^i \cdot (f_2 + \omega^i f_3)\\ &= \color{pink}{f_1 + \omega^i f_2 + \omega^{2i} f_3} \end{align}

The relationship between KZG proofs

Next, let us expand Equations \refeq:div−coeffs−1\ref{eq:div-coeffs-1} and \refeq:div−coeffs−2\ref{eq:div-coeffs-2} above and get a better sense of the relationship between KZG quotient polynomials:

tm−1=fm‾tm−2=fm−1+ωi⋅tm−1==fm−1+ωi⋅fm‾tm−3=fm−2+ωi⋅tm−2=fm−2+ωi⋅(fm−1+ωi⋅fm)=fm−2+ωi⋅fm−1+ω2i⋅fm‾tm−4=fm−3+ωi⋅tm−3=fm−3+ωi⋅(fm−2+ωi⋅fm−1+ω2i⋅fm)=fm−3+ωi⋅fm−2+ω2i⋅fm−1+ω3i⋅fm‾ ⋮t1=f2+ωi⋅f3+ω2i⋅f4+⋯+ω(m−2)i⋅fm‾t0=f1+ωi⋅f2+ω2i⋅f3+⋯+ω(m−1)i⋅fm‾\begin{align} \color{green}{t_{m-1}} &= \underline{f_m}\\ \color{blue}{t_{m-2}} &= f_{m-1} + \omega^i \cdot \color{green}{t_{m-1}} =\nonumber\\ &= \underline{f_{m-1} + \omega^i \cdot f_m}\\ \color{red}{t_{m-3}} &= f_{m-2} + \omega^i \cdot \color{blue}{t_{m-2}}\nonumber\\ &= f_{m-2} + \omega^i \cdot (f_{m-1} + \omega^i \cdot f_m)\nonumber\\ &= \underline{f_{m-2} + \omega^i \cdot f_{m-1} + \omega^{2i} \cdot f_m}\\ t_{m-4} &= f_{m-3} + \omega^i \cdot \color{red}{t_{m-3}}\nonumber\\ &= f_{m-3} + \omega^i \cdot (f_{m-2} + \omega^i \cdot f_{m-1} + \omega^{2i} \cdot f_m)\nonumber\\ &= \underline{f_{m-3} + \omega^i \cdot f_{m-2} + \omega^{2i} \cdot f_{m-1} + \omega^{3i} \cdot f_m}\\\ &\hspace{.55em}\vdots\nonumber\\ % t_{j} &= f_{j+1} + \omega^i \cdot t_{j+1}, \forall j \in [0, m-1)\\ % & \vdots\\ t_1 &= \underline{f_2 + \omega^i \cdot f_3 + \omega^{2i} \cdot f_4 + \dots + \omega^{(m-2)i} \cdot f_m}\\ t_0 &= \underline{f_1 + \omega^i \cdot f_2 + \omega^{2i} \cdot f_3 + \dots + \omega^{(m-1)i} \cdot f_m} \end{align}
As you can see above, the quotient polynomial Qi(X)=∑j=0m−1tjXjQ_i(X) = \sum_{j=0}^{m-1} t_j X^j obtained when dividing f(X)f(X) by X−ωiX-\omega^i is:
Qi(X)=fm⋅Xm−1++(fm−1+ωi⋅fm)⋅Xm−2++(fm−2+ωi⋅fm−1+ω2i⋅fm)⋅Xm−3++(fm−3+ωi⋅fm−2+ω2i⋅fm−1+ω3i⋅fm)⋅Xm−4+ +⋯+ +(f2+ωi⋅f3+ω2i⋅f4+⋯+ω(m−2)i⋅fm)⋅X++(f1+ωi⋅f2+ω2i⋅f3+⋯+ω(m−1)i⋅fm)\begin{align} Q_i(X) &= f_m \cdot X^{m-1} + {}\\ &+ \left(f_{m-1} + \omega^i \cdot f_m\right) \cdot X^{m-2} + {}\nonumber\\ &+ \left(f_{m-2} + \omega^i \cdot f_{m-1} + \omega^{2i} \cdot f_m\right) \cdot X^{m-3} + {}\nonumber\\ &+ \left(f_{m-3} + \omega^i \cdot f_{m-2} + \omega^{2i} \cdot f_{m-1} + \omega^{3i} \cdot f_m\right) \cdot X^{m-4} + {}\nonumber\\\ &+ \dots + {}\nonumber\\\ &+ \left(f_2 + \omega^i \cdot f_3 + \omega^{2i} \cdot f_4 + \dots + \omega^{(m-2)i} \cdot f_m\right) \cdot X + {}\nonumber\\ &+ \left(f_1 + \omega^i \cdot f_2 + \omega^{2i} \cdot f_3 + \dots + \omega^{(m-1)i} \cdot f_m\right)\nonumber \end{align}
Factoring out the roots of unity, we can rearrange this as follows:
\labeleq:HXQi(X)=(fmXm−1+fm−1Xm−2+⋯+f1)(ωi)0++(fmXm−2+fm−1Xm−3+⋯+f2)(ωi)1++(fmXm−3+fm−1Xm−4+⋯+f3)(ωi)2++⋯++(fmX+fm−1)(ωi)m−2++(fm)(ωi)m−1\begin{align} \label{eq:HX} Q_i(X) &= \left(f_m X^{m-1} + f_{m-1} X^{m-2} + \dots + f_1\right) (\omega^i)^0 + {}\\ &+ \left(f_m X^{m-2} + f_{m-1} X^{m-3} + \dots + f_2\right) (\omega^i)^1 + {}\nonumber\\ &+ \left(f_m X^{m-3} + f_{m-1} X^{m-4} + \dots + f_3\right) (\omega^i)^2 + {}\nonumber\\ &+ \dots + {}\nonumber\\ &+ \left(f_m X + f_{m-1}\right) (\omega^i)^{m-2} + {}\nonumber\\ &+ \left(f_m \right) (\omega^i)^{m-1}\nonumber \end{align}
Baptising the polynomials above as Hj(X)H_j(X), we can rewrite as:
Qi(X)\bydefH1(X)(ωi)0++H2(X)(ωi)1++⋯++Hm(X)(ωi)m−1\begin{align} Q_i(X) &\bydef H_1(X) (\omega^i)^0 + {}\\ &+ H_2(X) (\omega^i)^1 + {}\nonumber\\ &+ \dots + {}\nonumber\\ &+ H_m(X) (\omega^i)^{m-1}\nonumber\\ \end{align}
More succinctly, the quotient polynomial is:
\labeleq:Qi−polyQi(X)=∑j=0m−1Hj+1(X)⋅(ωi)j\begin{align} \label{eq:Qi-poly} Q_i(X) &= \sum_{j=0}^{m-1} H_{j+1}(X) \cdot (\omega^i)^j \end{align}

Note: At this point, it is not helpful to write down a closed form formula for Hj(X)H_j(X), but we’ll return to it later.

Next, let:

\labeleq:hjhj=gHj(τ),∀j∈[m]\begin{align} \label{eq:hj} h_j = g^{H_j(\tau)},\forall j\in[m] \end{align}
…denote a KZG commitment to Hj(X)H_j(X). (We are ignoring for now the actual closed-form formula for the HjH_j’s.)

Recall that πi=gQi(τ)\pi_i=g^{Q_i(\tau)} denotes a KZG proof for ωi\omega^i.

Therefore, applying Equation \refeq:Qi−poly\ref{eq:Qi-poly} to πi\pi_i’s expression, we get:

\labeleq:pi−dft−likeπi=∏j=0m−1(hj+1)(ωi)j,∀i∈[0,n)\begin{align} \label{eq:pi-dft-like} \pi_i = \prod_{j=0}^{m-1} \left(h_{j+1}\right)^{(\omega^i)^j}, \forall i\in[0,n) \end{align}

But a close look at Equation \refeq:pi−dft−like\ref{eq:pi-dft-like} reveals it is actually a Discrete Fourier Transform (DFT) on the hjh_j’s! Specifically, we can rewrite it as:

\labeleq:pi−dft[π0,π1,…,πn−1]=DFT\Gr(h1,h2,…,hm,hm+1,…,hn)\begin{align} \label{eq:pi-dft} [ \pi_0, \pi_1, \dots, \pi_{n-1} ] = \mathsf{DFT}_{\Gr}(h_1, h_2, \dots, h_m, h_{m+1},\dots, h_n) \end{align}
Here, the extra hm+1,…,hnh_{m+1},\dots,h_n (if any) are just commitments to the zero polynomials: i.e., they are the identity element in \Gr\Gr. (Also, DFT\Gr\mathsf{DFT}_{\Gr} is a DFT on group elements via exponentiations, rather than on field elements via multiplication.)

Time complexity: Ignoring the time to compute the hjh_j commitments, which we have not discussed yet, note that the DFT above would only take O(nlog⁡n)O(n\log{n}) time!

This (almost) summarizes the Feist-Khovratovich (FK) technique!

The key idea? KZG quotient polynomial commitments are actually related, if the evaluation points are roots of unity. Specifically, these commitments are the output of a single DFT as per Equation \refeq:pi−dft\ref{eq:pi-dft}, which can be computed in quasilinear time!

However, one key challenge remains, which we address next: computing the hjh_j commitments.

Computing the hj=gHj(τ)h_j = g^{H_j(\tau)} commitments

To see how the hjh_j’s can be computed fast too, let’s rewrite them from Equation \refeq:HX\ref{eq:HX}.

H1(X)=fmXm−1+fm−1Xm−2+⋯+f1H2(X)=fmXm−2+fm−1Xm−3+⋯+f2H3(X)=fmXm−3+fm−1Xm−4+⋯+f3⋮Hm(X)=fmX+fm−1Hm−1(X)=fm\begin{align} H_1(X) &= f_m X^{m-1} + f_{m-1} X^{m-2} + \dots + f_1\\ H_2(X) &= f_m X^{m-2} + f_{m-1} X^{m-3} + \dots + f_2\\ H_3(X) &= f_m X^{m-3} + f_{m-1} X^{m-4} + \dots + f_3\\ &\vdots\\ H_m(X) &= f_m X + f_{m-1}\\ H_{m-1}(X) &= f_m \end{align}
Key observation: We can express the Hj(X)H_j(X) polynomials as a Toeplitz matrix product between a matrix F\mathbf{F} (of f(X)f(X)’s coefficients) and a column vector V(X)V(X) (of the indeterminate variable XX):
[H1(X)H2(X)H3(X)⋮Hm(X)Hm−1(X)]=[fmfm−1fm−2fm−3…f2f10fmfm−1fm−2…f3f200fmfm−1…f4f3⋮⋱⋮0000…fmfm−10000…0fm]⋅[Xm−1Xm−2Xm−3⋮X1]\bydefF⋅V(X)\begin{align} \begin{bmatrix} H_1(X)\\ H_2(X)\\ H_3(X)\\ \vdots\\ H_m(X)\\ H_{m-1}(X)\\ \end{bmatrix} &= \begin{bmatrix} f_m & f_{m-1} & f_{m-2} & f_{m-3} & \dots & f_2 & f_1\\ 0 & f_m & f_{m-1} & f_{m-2} & \dots & f_3 & f_2\\ 0 & 0 & f_m & f_{m-1} & \dots & f_4 & f_3\\ \vdots & & & \ddots & & & \vdots\\ 0 & 0 & 0 & 0 & \dots & f_m & f_{m-1}\\ 0 & 0 & 0 & 0 & \dots & 0 & f_m \end{bmatrix} \cdot \begin{bmatrix} X^{m-1}\\ X^{m-2}\\ X^{m-3}\\ \vdots\\ X\\ 1 \end{bmatrix} \\ &\bydef \mathbf{F} \cdot V(X) \end{align}
Therefore, the commitments hjh_j to the Hj(X)H_j(X)’s can also be expressed as a Toeplitz matrix product, where “multiplication” is replaced with “exponentation” and the column vector V(X)V(X) is replaced by V(τ)V(\tau):
[h1h2h3⋮hmhm−1]=[fmfm−1fm−2fm−3…f2f10fmfm−1fm−2…f3f200fmfm−1…f4f3⋮⋱⋮0000…fmfm−10000…0fm]⋅[τm−1τm−2τm−3⋮τ1]\bydefF⋅V(τ)\begin{align} \begin{bmatrix} h_1\\ h_2\\ h_3\\ \vdots\\ h_m\\ h_{m-1}\\ \end{bmatrix} &= \begin{bmatrix} f_m & f_{m-1} & f_{m-2} & f_{m-3} & \dots & f_2 & f_1\\ 0 & f_m & f_{m-1} & f_{m-2} & \dots & f_3 & f_2\\ 0 & 0 & f_m & f_{m-1} & \dots & f_4 & f_3\\ \vdots & & & \ddots & & & \vdots\\ 0 & 0 & 0 & 0 & \dots & f_m & f_{m-1}\\ 0 & 0 & 0 & 0 & \dots & 0 & f_m \end{bmatrix} \cdot \begin{bmatrix} \tau^{m-1}\\ \tau^{m-2}\\ \tau^{m-3}\\ \vdots\\ \tau\\ 1 \end{bmatrix} \\ &\bydef \mathbf{F} \cdot V(\tau) \end{align}
Fortunately, it is well known that such a matrix product can be computed in O(mlog⁡m)O(m\log{m}) time (incidentally, also via DFTs). If you are curious, in a previous blogpost, as well as in a short paper [^Tome20How], we explain in detail how this works.

Conclusion

We are all done! To summarize, to compute all proofs πi\pi_i for f(ωi)f(\omega^i), the Feist-Khovratovich (FK) technique [^FK20] proceeds as follows:

  1. Computes all hjh_j’s from Equation \refeq:hj\ref{eq:hj} in O(mlog⁡m)O(m\log{m}) time via a Toeplitz matrix product
  2. Computes all πi\pi_i’s in O(nlog⁡n)O(n\log{n}) time via a DFT on the hjh_j’s, as per Equation \refeq:pi−dft\ref{eq:pi-dft}

A few things that we could still talk about, but we are out of time:

  • Implementing this efficiently (see one attempt here)
  • Optimizing part of the implementation (see Dankrad’s observation’s in this tweet)
  • Other techniques for computing proofs on multiple polynomials from the FK paper [^FK20]
  • Decreasing KZG verifier time when opening multiple polynomials (fi)i∈[t](f_i)_{i\in[t]} at the same point x=ztx=z^t, also via the power of DFTs [^GW21]

[^FK20]: Fast amortized Kate proofs, by Dankrad Feist and Dmitry Khovratovich, 2020, [URL] [^CJLplus24e]: Improved Polynomial Division in Cryptography, by Kostas Kryptos Chalkias and Charanjit Jutla and Jonas Lindstrom and Varun Madathil and Arnab Roy, in Cryptology {ePrint} Archive, Paper 2024/1279, 2024, [URL] [^LJGK25e]: Cauchyproofs: Batch-Updatable Vector Commitment with Easy Aggregation and Application to Stateless Blockchains, by Zhongtang Luo and Yanxue Jia and Alejandra Victoria Ospina Gracia and Aniket Kate, in Cryptology {ePrint} Archive, Paper 2025/038, 2025, [URL] [^TCZplus20]: Towards Scalable Threshold Cryptosystems, by Alin Tomescu and Robert Chen and Yiming Zheng and Ittai Abraham and Benny Pinkas and Guy Golan Gueta and Srinivas Devadas, in IEEE S&P’20, 2020 [^Tome20How]: How to compute all Pointproofs, by Alin Tomescu, in Cryptology ePrint Archive, Report 2020/1516, 2020, [URL] [^GW21]: fflonk: a Fast-Fourier inspired verifier efficient version of PlonK, by Ariel Gabizon and Zachary J. Williamson, in Cryptology ePrint Archive, Report 2021/1167, 2021, [URL]