Post · 13 min read· pp. 104–110

Catalano-Fiore Vector Commitments

A vector commitment (VC) scheme allows a prover with access to a vector v=[v1,…,vn]\mathbf{v} = [ v_1, \dots, v_n ] to convince any verifier that position ii in v\mathbf{v} stores viv_i for any index i∈[n]i\in[n]. Importantly, verifers only store a succinct digest of the vector (e.g., a 32-byte hash) rather than the full vector v\mathbf{v}.

\def\Adv{\mathcal{A}} \def\Badv{\mathcal{B}} \def\GenGho{\mathsf{GenGroup}_?} \def\Ghosz{|\Gho|} \def\Ghoid{1_{\Gho}} \def\multirootexp{\mathsf{MultiRootExp}} \def\primes{\mathsf{Primes}} \def\QRn{\mathsf{QR}_N} \def\rootfactor{\mathsf{RootFactor}} \def\shamirtrick{\mathsf{ShamirTrick}} \def\vect#1{\mathbf{#1}}

Below, we review Catalano and Fiore’s elegant VC scheme [^CF13e] built from hidden-order groups, extended with the enhancements proposed by Lai and Malavolta [^LM18] and by Campanelli et al.[^CFGplus20e] We also make one new, small observation: proof disaggregation in this VC is faster than originally thought, which helps precompute all proofs slightly faster.

Preliminaries

Let [n]={1,2,…,n}[n] = \{1,2,\dots, n\} and [a,b]={a,a+1,…,b−1,b}[a,b] = \{a, a+1,\dots, b-1, b\}.

We assume the reader is familiar with RSA accumulators, which Catalano-Fiore (CF) VCs rely heavily upon. Also, we assume familiarity with the \rootfactor\rootfactor algorithm for computing all eje_jth roots of g∏i∈[n]ei,j∈[n]g^{\prod_{i\in[n]} e_i}, j\in [n].

Shamir’s trick

Given z1/az^{1/a} and z1/bz^{1/b} where z∈\Ghoz\in\Gho and a,b∈Za,b\in\Z with gcd⁡(a,b)=1\gcd(a,b) = 1, one can compute z1/ab=(z1/a)y(z1/b)xz^{1/ab} = (z^{1/a})^y (z^{1/b})^x where x,yx,y are the Bezout coefficients for a,ba,b such that ax+by=1ax+by=1.

This is because:

(z1/a)y(z1/b)x=zbyabzaxab=zax+byab=z1ab(z^{1/a})^y (z^{1/b})^x = z^\frac{by}{ab} z^\frac{ax}{ab} = z^\frac{ax+by}{ab} = z^\frac{1}{ab}

We often use z1ab←\shamirtrick(z1/a,z1/b,a,b)z^\frac{1}{ab}\leftarrow \shamirtrick(z^{1/a}, z^{1/b}, a, b) to denote performing a Shamir’s trick..

Computing z1/(ab)z^{1/(ab)} takes O(max⁡(∣x∣,∣y∣)) \GhoO(\max(\vert x\vert,\vert y\vert))\ \Gho operations since the Bezout coefficients (a,b)(a,b) are as big as (x,y)(x,y). (Some extra time is needed to compute the Bezout coefficients, but we ignore it here.)

Public parameters

To set up the VC scheme, a hidden-order group \Gho\Gho with generator gg must be picked such that nobody knows the order of the group. Importantly, the RSA problem needs to be hard in this group. Typically, \Gho=\ZNs\Gho = \ZNs where N=pqN=pq is picked via a secure multi-party computation (MPC) ceremony such that nobody knows the factorization of NN (and thus nobody knows the order of \Gho\Gho; i.e., ∣\Gho∣=ϕ(N)=(p−1)(q−1)\vert\Gho\vert = \phi(N)= (p-1)(q-1)).

Then, a collision-resistant hash function H:[n]→\primesℓ+1H : [n] \rightarrow \primes^{\ell+1} must be fixe. HH will map each vector index i∈[n]i\in [n] to a prime ei=H(i)e_i = H(i) such that $2^\ell < e_i < 2^{\ell+1}$ where ℓ\ell is the maximum size in bits of a vector element viv_i. We often use eK=∏k∈Keke_K = \prod_{k\in K} e_k to denote a product of a subset of such primes, where K⊆[n]K\subseteq[n].

Digest (or commitments)

Instead of commitments, we’ll stick to the digest terminology.

The digest of a vector \vectv=[v1,…,vn]\vect{v} = [ v_1, \dots, v_n ] consists of two parts. First, an RSA accumulator over all positions in the vector:

S=g∏i∈[n]ei\begin{align} S &= g^{\prod_{i\in[n]} e_i} \end{align}

Second, a multi-exponentiation of each RSA membership witness (w.r.t. SS) for position ii to the value viv_i:

Λ=∏i∈[n](S1/ei)vi\begin{align} \Lambda &= \prod_{i\in [n]} (S^{1/e_i})^{v_i} \end{align}

We often use d(\vectv)=(S,Λ)d(\vect{v}) = (S, \Lambda) to denote the digest of a vector.

Computing the digest requires computing all S1/ei,∀i∈[n]S^{1/e_i}, \forall i\in[n]. As described before, this can be done in O(nlog⁡n)O(n\log{n}) group exponentiations via (S1/ei)i∈[n]←\rootfactor(g,(ei)i∈[n])(S^{1/e_i})_{i\in[n]} \leftarrow \rootfactor(g, (e_i)_{i\in[n]}). Since each exponentiation is by an (ℓ+1)(\ell+1)-bit prime eie_i, this takes O(ℓnlog⁡n) \GhoO(\ell n\log{n})\ \Gho operations. Then, Λ\Lambda can be computed with an additional O(ℓn) \GhoO(\ell n)\ \Gho operations.

The beauty of CF VCs is that, once you understand what a digest looks like, everything follows very naturally.

Proofs are just digests

At minimum, in any VC scheme, a verifier can be convinced of the value viv_i of any position ii in the vector using a proof πi\pi_i. To convince the verifier of multiple values (\vectvi)i∈I(\vect{v}_i)_{i\in I}, this would require individual proofs for each position i∈Ii\in I. However, in VCs like CF, a single II-subvector proof πI\pi_I can be constructed for all (vi)i∈I(v_i)_{i\in I}. Importantly, the size of πI\pi_I is always constant, independent of ∣I∣\vert I\vert.

In CF, an II-subvector proof πI\pi_I is just the digest of the vector \vectv\vect{v} but “without” positions II in it. We abuse notation and denote this by \vectv∖I=(vi)i∈[n]∖I\vect{v} \setminus I = (v_i)_{i\in[n] \setminus I}. Thus, πI=d(\vectv∖I)\pi_I = d(\vect{v}\setminus I).

Let eI=∏i∈Ieie_I = \prod_{i\in I} e_i. Then, the proof πI\pi_I is just:

SI=S1/eI=g∏i∈[n]∖IeiΛI=∏i∈[n]∖I(SI1/ei)vi\begin{align} S_I &= S^{1/e_I} = g^{\prod_{i\in[n]\setminus I} e_i}\\ \Lambda_I &= \prod_{i\in [n]\setminus I} (S_I^{1/e_i})^{v_i} \end{align}

Observe that the accumulator SIS_I is over all positions ii except the ones in II. Also, observe that the membership witnesses in ΛI\Lambda_I are w.r.t. to SIS_I (not SS) and that ΛI\Lambda_I does not contain witnesses for i∈Ii\in I. This is what it means to commit to a vector \vectv\vect{v} “without” positions II in it.

Computing πI\pi_I takes O(ℓ(n−∣I∣)log⁡(n−∣I∣)) \GhoO(\ell(n-\vert I \vert)\log(n-\vert I\vert))\ \Gho operations, dominated by the cost to compute (SI1/ei)i∈I(S_I^{1/e_i})_{i\in I} via \rootfactor(g,(ei)i∈[n]∖I)\rootfactor(g, (e_i)_{i\in[n]\setminus I}).

To verify the proof, one simply “adds back” \vectvI\vect{v}_I to d(\vectv∖I)=πId(\vect{v}\setminus I) = \pi_I and checks it obtains the digest d(\vectv)=(S,Λ)d(\vect{v}) = (S, \Lambda) of the vector:

S=?SIeIΛ=?ΛIeI∏i∈I(S1/ei)vi\begin{align} S &\stackrel{?}{=} S_I^{e_I}\\ \Lambda &\stackrel{?}{=} \Lambda_I^{e_I} \prod_{i\in I} (S^{1/e_i})^{v_i} \end{align}

One problem is that all (S1/ei)i∈I(S^{1/e_i})_{i\in I} must be computed via \rootfactor(SI,(ei)i∈I)\rootfactor(S_I, (e_i)_{i\in I}), which would take O(ℓ∣I∣log⁡∣I∣) \GhoO(\ell \vert I\vert \log\vert I\vert)\ \Gho operations. We explain next how this can be done in O(ℓ∣I∣) \GhoO(\ell \vert I \vert)\ \Gho operations by adding each vi,i∈Iv_i, i\in I back into πI\pi_I sequentially!

Updating digest

It is possible to update the digest d(\vectv)=(S,Λ)d(\vect{v})=(S,\Lambda) after an element viv_i changes to vi+δiv_i + \delta_i. For this, the RSA membership witness S1/eiS^{1/e_i} is needed as helper information, which we refer to as an update key.

Since SS does not contain any information about viv_i (just about ii), SS stays the same. However, Λ\Lambda must change into Λ’\Lambda’ as follows:

Λ’=Λ⋅(S1/ei)δi\begin{align} \Lambda’ = \Lambda \cdot (S^{1/e_i})^{\delta_i} \end{align}

This technique can be generalized to work with many positions i∈Ii\in I changing by δi\delta_i. This either requires all the S1/eiS^{1/e_i} update keys or an aggregated update key SI=S1/eI=S∏i∈I1/eiS_I = S^{1/e_I} = S^{\prod_{i\in I} 1/e_i} as auxiliary information. In this last case, all the (S1/ei)i∈I←\rootfactor(SI,(ei)i∈I)(S^{1/e_i})_{i\in I} \leftarrow \rootfactor(S_I, (e_i)_{i\in I}) can be computed in O(ℓ∣I∣log⁡∣I∣) \GhoO(\ell \vert I \vert \log \vert I \vert)\ \Gho operations from the aggregated update key. Then the update can be performed as Λ′=Λ⋅∏i∈I(S1/ei)δi\Lambda' = \Lambda \cdot \prod_{i\in I} (S^{1/e_i})^{\delta_i}

Adding new positions to the vector

It is also possible to “extend” the vector \vectv\vect{v} of size nn to size n+1n+1 by adding an extra element vn+1v_{n+1}. For this, the digest can be updated as:

S’=Sen+1Λ’=Λen+1Svn+1=⋯=∏i∈[n+1](S’1/ei)vi\begin{align} S’ &= S^{e_{n+1}}\\ \Lambda’ &= \Lambda^{e_{n+1}} S^{v_{n+1}} = \dots = \prod_{i\in [n+1]} (S’^{1/e_i})^{v_i} \end{align}

This can be generalized to adding Δ\Delta new positions, and would take O(ℓΔ) \GhoO(\ell \Delta)\ \Gho operations by applying each extension sequentially. In fact, this how one would verify a subvector proof fast: by adding back the elements being verified to the proof (which can be viewed as a digest) and checking the actual digest is obtained!

Updating proofs

Since proofs are just digests they are, in principle, updatable in the same fashion, with a few extra details.

Suppose we have a proof πI\pi_I for a subvector \vectvI\vect{v}_I:

SI=S1/eI=S1/∏i∈Iei=g∏i∈[n]∖IeiΛI=∏i∈[n]∖I(SI1/ei)vi\begin{align} S_I &= S^{1/e_I} = S^{1/\prod_{i\in I} e_i} = g^{\prod_{i\in[n]\setminus I} e_i}\\ \Lambda_I &= \prod_{i\in [n]\setminus I} (S_I^{1/e_i})^{v_i} \end{align}

Case 1: i∈Ii\in I changed

First, suppose a position i∈Ii\in I changes from viv_i to vi+δiv_i + \delta_i. Then, the proof πI\pi_I remains the same! This is because the proof contains no information about viv_i, since the proof is the digest of \vectv\vect{v} without any positions i∈Ii\in I.

Case 2: j∉Ij\notin I changed

Second, suppose a position j∉Ij\notin I changes from vjv_j to vj+δjv_j+\delta_j. In this case, we only need to change ΛI\Lambda_I into a ΛI’\Lambda_I’ such that:

ΛI’=ΛI⋅(SI1/ej)δj\begin{align} \Lambda_I’ = \Lambda_I \cdot (S_I^{1/e_j})^{\delta_j} \end{align}

The difficult part is computing SI1/ejS_I^{1/e_j}. We could do it from scratch but that would take O(ℓ(n−∣I∣)) \GhoO(\ell (n - \vert I \vert))\ \Gho operations. Instead, as with the digest update, we assume we are given the S1/ejS^{1/e_j} update key associated with the changed position jj. Fortunately, we know that we can compute SI1/ej=S1/(eIej)S_I^{1/e_j} = S^{1/(e_I e_j)} using Shamir’s trick on SI=S1/eIS_I = S^{1/e_I} and S1/ejS^{1/e_j}! (This takes O(ℓ∣I∣) \GhoO(\ell \vert I \vert)\ \Gho operations which is faster when ∣I∣|I| is much smaller than nn.)

This technique can also be generalized to updating πI\pi_I after many positions j∈Jj\in J changed by δj\delta_j. (Assume without loss of generality that J∩I=∅J\cap I =\varnothing or let J←J∖IJ \leftarrow J \setminus I otherwise.) This either requires all SI1/ejS_I^{1/e_j} update keys or the aggregated update key SI∪J=S1/(eIeJ)=S∏k∈I∪J1/ekS_{I\cup J} = S^{1/(e_I e_J)} = S^{\prod_{k\in I\cup J} 1/e_k} as auxiliary information. In this last case, all the (SI1/ej)j∈J←\rootfactor(SI∪J,(ej)j∈J)(S_I^{1/e_j})_{j\in J} \leftarrow \rootfactor(S_{I\cup J}, (e_j)_{j\in J}) can be computed in O(ℓ∣J∣log⁡∣J∣) \GhoO(\ell \vert J \vert \log \vert J \vert)\ \Gho operations from the aggregated update key. Then, ΛI′=ΛI⋅∏j∈J(SI1/ej)δj\Lambda_I' = \Lambda_I \cdot \prod_{j\in J} (S_I^{1/e_j})^{\delta_j}.

Case 3: Adding new positions

Third, suppose a new position vn+1v_{n+1} was added to the vector. Then the proof update proceeds similar to the digest update for adding new positions:

SI’=SIen+1ΛI’=ΛIen+1SIvn+1=⋯=∏i∈[n+1]∖I(SI’1/ei)vi\begin{align} S_I’ &= S_I^{e_{n+1}}\\ \Lambda_I’ &= \Lambda_I^{e_{n+1}} S_I^{v_{n+1}} = \dots = \prod_{i\in [n+1] \setminus I} (S_I’^{1/e_i})^{v_i} \end{align}

Disaggregating proofs

Suppose we want to disaggregate a proof πI=(SI,ΛI)\pi_I=(S_I,\Lambda_I) for \vectvI\vect{v}_I into a proof πK=(SK,ΛK)\pi_K=(S_K,\Lambda_K) for \vectvK\vect{v}_K, where K⊂IK\subset I.

In other words, we want to go from d(\vectv∖I)d(\vect{v}\setminus I) to d(\vectv∖K)d(\vect{v}\setminus K). Since K⊂IK\subset I we can write K=I∖ΔK = I\setminus \Delta for some set Δ\Delta of indices. Thus, all we need to do is add back the elements from Δ\Delta to πI\pi_I.

So, for each i∈Δi\in \Delta, we simply add back (i,vi)(i,v_i) to πI\pi_I (as explained here) and obtain πK\pi_K. This takes O(ℓ∣Δ∣)O(\ell\vert\Delta\vert) \Gho\Gho operations.

Aggregating proofs

To aggregate two subvector proofs for \vectvI\vect{v}_I and \vectvJ\vect{v}_J, things are bit more involved. Let πI=(SI,ΛI)\pi_I = (S_I,\Lambda_I) and πJ=(SJ,ΛJ)\pi_J = (S_J,\Lambda_J) denote the two proofs. Assume that I∩J=∅I\cap J = \varnothing and if not, just set J=J∖IJ = J\setminus I and disaggregate πJ\pi_J into πJ∖I\pi_{J\setminus I}. (Can also set I=I∖JI=I\setminus J and disaggregate πI\pi_I instead.)

Denote the aggregated proof by πI∪J=(SI∪J,ΛI∪J)\pi_{I\cup J} = (S_{I \cup J}, \Lambda_{I \cup J}). We can easily compute the first part of the proof as:

SI∪J=\shamirtrick(SI,SJ,eI,eJ)=S1/(eIeJ)S_{I\cup J} = \shamirtrick(S_I, S_J, e_I, e_J) = S^{1/(e_I e_J)}

For the second part, focusing on ΛI\Lambda_I, recall that:

ΛI=∏i∈[n]∖I(SI1/ei)vi\begin{align} \Lambda_I &= \prod_{i\in [n]\setminus I} (S_I^{1/e_i})^{v_i} \end{align}
We will tweak it as ΛI∗\Lambda_I^* by removing all elements vj,j∈Jv_j, j\in J from ΛI\Lambda_I:
ΛI∗=ΛI/∏j∈J(SI1/ej)vj=∏i∈[n]∖(I∪J)(SI1/ei)vi\begin{align} \Lambda_I^* &= \Lambda_I / \prod_{j\in J} (S_I^{1/e_j})^{v_j}\\ &= \prod_{i\in [n]\setminus (I\cup J)} (S_I^{1/e_i})^{v_i} \end{align}
But for this, we need to compute SI1/ej,∀j∈JS_I^{1/e_j},\forall j\in J via \rootfactor\rootfactor:
(SI1/ej)j∈J←\rootfactor(SI∪J,(ej)j∈J)\begin{align} (S_I^{1/e_j})_{j\in J} \leftarrow \rootfactor(S_{I\cup J}, (e_j)_{j\in J}) \end{align}
In a similar, fashion, we can compute
ΛJ∗=∏i∈[n]∖(I∪J)(SJ1/ei)vi\begin{align} \Lambda_J^* &= \prod_{i\in [n]\setminus (I\cup J)} (S_J^{1/e_i})^{v_i} \end{align}
Next, observe that ΛI∗\Lambda_I^* and ΛJ∗\Lambda_J^* can be rewritten as:
ΛI∗=(∏i∈[n]∖(I∪J)(S1/ei)vi)1/eIΛJ∗=(∏i∈[n]∖(I∪J)(S1/ei)vi)1/eJ\begin{align} \Lambda_I^* &= \left(\prod_{i\in [n]\setminus (I\cup J)} (S^{1/e_i})^{v_i}\right)^{1/e_I}\\ \Lambda_J^* &= \left(\prod_{i\in [n]\setminus (I\cup J)} (S^{1/e_i})^{v_i}\right)^{1/e_J} \end{align}
Thus, if we apply a Shamir trick on them, we can obtain ΛI∪J\Lambda_{I\cup J}:
ΛI∪J=\shamirtrick(ΛI∗,ΛJ∗,eI,eJ)=(∏i∈[n]∖(I∪J)(S1/ei)vi)1/(eIeJ)=∏i∈[n]∖(I∪J)(SI∪J1/ei)vi\begin{align} \Lambda_{I\cup J} &= \shamirtrick(\Lambda_I^*, \Lambda_J^*, e_I, e_J)\\ &= \left(\prod_{i\in [n]\setminus (I\cup J)} (S^{1/e_i})^{v_i}\right)^{1/(e_I e_J)}\\ &= \prod_{i\in [n]\setminus (I\cup J)} (S_{I\cup J}^{1/e_i})^{v_i} \end{align}

Overall, if b=max⁡(∣I∣,∣J∣)b=\max(\vert I\vert, \vert J \vert), this requires Shamir tricks of size bb and \rootfactor\rootfactor’s of size bb, so it takes O(ℓblog⁡b) \GhoO(\ell b\log{b})\ \Gho operations.

Precomputing all proofs via disaggregation

Campanelli et al.[^CFGplus20e] explain how to compute all proofs fast via disaggregation. The idea is to start with a proof for the whole vector \vectv\vect{v} and then disaggregate it into a proof for the left half of the vector and the right half. Then, one repeats recursively on these two halves. This determines a tree of subvector proofs, where the leaves store the proofs for the individual vector and each internal node stores an aggregation of its children’s proofs (with the root storing the proof for the full vector).

Here’s an example for n=8n=8:

Looked at it differently, clearly one can compute this tree via proof aggregation, which we discuss next, by starting with the leaves storing individual proofs for each position ii and aggregating up the tree. The key observation is that one can also compute this tree by starting with the root, which stores the proof for the full vector (i.e., the empty digest), disaggregating this proof into two halves, and recursing on these two halves.

This very much resembles the recursion tree used to implement \rootfactor\rootfactor efficiently (see here). Indeed, if you think about it, this tree implicitly computes the \rootfactor\rootfactor tree too, since each CF proof for viv_i has an RSA membership witness for ii in it.

Note that Campanelli et al.[^CFGplus20e] claim O(ℓnlog⁡2n) \GhoO(\ell n\log^2{n})\ \Gho operations for this algorithm, but the faster disaggregation explained above actually gives O(ℓnlog⁡n)O(\ell n\log{n}).

[^CF13e]: Vector Commitments and their Applications, by Dario Catalano and Dario Fiore, in Cryptology ePrint Archive, Report 2011/495, 2011, [URL] [^LM18]: Subvector Commitments with Application to Succinct Arguments, by Russell W.F. Lai and Giulio Malavolta, in Cryptology ePrint Archive, Report 2018/705, 2018, [URL] [^CFGplus20e]: Vector Commitment Techniques and Applications to Verifiable Decentralized Storage, by Matteo Campanelli and Dario Fiore and Nicola Greco and Dimitris Kolonelos and Luca Nizzardo, 2020, [URL]