A vector commitment (VC) scheme allows a prover with access to a vector v=[v1,…,vn] to convince any verifier that position i in v stores vi for any index i∈[n].
Importantly, verifers only store a succinct digest of the vector (e.g., a 32-byte hash) rather than the full vector v.
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} and [a,b]={a,a+1,…,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 algorithm for computing allejth roots of g∏i∈[n]ei,j∈[n].
Shamir’s trick
Given z1/a and z1/b where z∈\Gho and a,b∈Z with gcd(a,b)=1, one can compute z1/ab=(z1/a)y(z1/b)x where x,y are the Bezout coefficients for a,b such that ax+by=1.
This is because:
(z1/a)y(z1/b)x=zabbyzabax=zabax+by=zab1
We often use zab1←\shamirtrick(z1/a,z1/b,a,b) to denote performing a Shamir’s trick..
Computing z1/(ab) takes O(max(∣x∣,∣y∣))\Gho operations since the Bezout coefficients (a,b) are as big as (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 with generator g 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 where N=pq is picked via a secure multi-party computation (MPC) ceremony such that nobody knows the factorization of N (and thus nobody knows the order of \Gho; i.e., ∣\Gho∣=ϕ(N)=(p−1)(q−1)).
Then, a collision-resistant hash function H:[n]→\primesℓ+1 must be fixe.
H will map each vector index i∈[n] to a prime ei=H(i) such that $2^\ell < e_i < 2^{\ell+1}$ where ℓ is the maximum size in bits of a vector element vi.
We often use eK=∏k∈Kek to denote a product of a subset of such primes, where K⊆[n].
Digest (or commitments)
Instead of commitments, we’ll stick to the digest terminology.
The digest of a vector \vectv=[v1,…,vn] consists of two parts.
First, an RSA accumulator over all positions in the vector:
S=g∏i∈[n]ei
Second, a multi-exponentiation of each RSA membership witness (w.r.t. S) for position i to the value vi:
Λ=i∈[n]∏(S1/ei)vi
We often use d(\vectv)=(S,Λ) to denote the digest of a vector.
Computing the digest requires computing all S1/ei,∀i∈[n].
As described before, this can be done in O(nlogn) group exponentiations via (S1/ei)i∈[n]←\rootfactor(g,(ei)i∈[n]).
Since each exponentiation is by an (ℓ+1)-bit prime ei, this takes O(ℓnlogn)\Gho operations.
Then, Λ can be computed with an additional O(ℓ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 vi of any position i in the vector using a proofπi.
To convince the verifier of multiple values (\vectvi)i∈I, this would require individual proofs for each position i∈I.
However, in VCs like CF, a single I-subvector proof πI can be constructed for all (vi)i∈I.
Importantly, the size of πI is always constant, independent of ∣I∣.
In CF, an I-subvector proof πI is just the digest of the vector \vectv but “without” positions I in it.
We abuse notation and denote this by \vectv∖I=(vi)i∈[n]∖I.
Thus, πI=d(\vectv∖I).
Observe that the accumulator SI is over all positions i except the ones in I.
Also, observe that the membership witnesses in ΛI are w.r.t. to SI (not S) and that ΛI does not contain witnesses for i∈I.
This is what it means to commit to a vector \vectv “without” positions I in it.
Computing πI takes O(ℓ(n−∣I∣)log(n−∣I∣))\Gho operations, dominated by the cost to compute (SI1/ei)i∈I via \rootfactor(g,(ei)i∈[n]∖I).
To verify the proof, one simply “adds back” \vectvI to d(\vectv∖I)=πI and checks it obtains the digest d(\vectv)=(S,Λ) of the vector:
SΛ=?SIeI=?ΛIeIi∈I∏(S1/ei)vi
One problem is that all (S1/ei)i∈I must be computed via \rootfactor(SI,(ei)i∈I), which would take O(ℓ∣I∣log∣I∣)\Gho operations.
We explain next how this can be done in O(ℓ∣I∣)\Gho operations by adding each vi,i∈I back into πIsequentially!
Updating digest
It is possible to update the digest d(\vectv)=(S,Λ) after an element vi changes to vi+δi.
For this, the RSA membership witness S1/ei is needed as helper information, which we refer to as an update key.
Since S does not contain any information about vi (just about i), S stays the same.
However, Λ must change into Λ’ as follows:
Λ’=Λ⋅(S1/ei)δi
This technique can be generalized to work with many positions i∈I changing by δi.
This either requires all the S1/ei update keys or an aggregated update keySI=S1/eI=S∏i∈I1/ei as auxiliary information.
In this last case, all the (S1/ei)i∈I←\rootfactor(SI,(ei)i∈I) can be computed in O(ℓ∣I∣log∣I∣)\Gho operations from the aggregated update key.
Then the update can be performed as Λ′=Λ⋅∏i∈I(S1/ei)δi
Adding new positions to the vector
It is also possible to “extend” the vector \vectv of size n to size n+1 by adding an extra element vn+1.
For this, the digest can be updated as:
This can be generalized to adding Δ new positions, and would take O(ℓΔ)\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 for a subvector \vectvI:
First, suppose a position i∈I changes from vi to vi+δi.
Then, the proof πI remains the same!
This is because the proof contains no information about vi, since the proof is the digest of \vectv without any positions i∈I.
Case 2: j∈/I changed
Second, suppose a position j∈/I changes from vj to vj+δj.
In this case, we only need to change ΛI into a ΛI’ such that:
ΛI’=ΛI⋅(SI1/ej)δj
The difficult part is computing SI1/ej.
We could do it from scratch but that would take O(ℓ(n−∣I∣))\Gho operations.
Instead, as with the digest update, we assume we are given the S1/ej update key associated with the changed position j.
Fortunately, we know that we can compute SI1/ej=S1/(eIej) using Shamir’s trick on SI=S1/eI and S1/ej!
(This takes O(ℓ∣I∣)\Gho operations which is faster when ∣I∣ is much smaller than n.)
This technique can also be generalized to updating πI after many positions j∈J changed by δj.
(Assume without loss of generality that J∩I=∅ or let J←J∖I otherwise.)
This either requires all SI1/ej update keys or the aggregated update keySI∪J=S1/(eIeJ)=S∏k∈I∪J1/ek as auxiliary information.
In this last case, all the (SI1/ej)j∈J←\rootfactor(SI∪J,(ej)j∈J) can be computed in O(ℓ∣J∣log∣J∣)\Gho operations from the aggregated update key.
Then, ΛI′=ΛI⋅∏j∈J(SI1/ej)δj.
Case 3: Adding new positions
Third, suppose a new position vn+1 was added to the vector.
Then the proof update proceeds similar to the digest update for adding new positions:
Suppose we want to disaggregate a proof πI=(SI,ΛI) for \vectvI into a proof πK=(SK,ΛK) for \vectvK, where K⊂I.
In other words, we want to go from d(\vectv∖I) to d(\vectv∖K).
Since K⊂I we can write K=I∖Δ for some set Δ of indices.
Thus, all we need to do is add back the elements from Δ to πI.
So, for each i∈Δ, we simply add back (i,vi) to πI (as explained here) and obtain πK.
This takes O(ℓ∣Δ∣)\Gho operations.
Aggregating proofs
To aggregate two subvector proofs for \vectvI and \vectvJ, things are bit more involved.
Let πI=(SI,ΛI) and πJ=(SJ,ΛJ) denote the two proofs.
Assume that I∩J=∅ and if not, just set J=J∖I and disaggregate πJ into πJ∖I.
(Can also set I=I∖J and disaggregate πI instead.)
Denote the aggregated proof by πI∪J=(SI∪J,ΛI∪J).
We can easily compute the first part of the proof as:
SI∪J=\shamirtrick(SI,SJ,eI,eJ)=S1/(eIeJ)
For the second part, focusing on ΛI, recall that:
ΛI=i∈[n]∖I∏(SI1/ei)vi
We will tweak it as ΛI∗ by removing all elements vj,j∈J from ΛI:
Overall, if b=max(∣I∣,∣J∣), this requires Shamir tricks of size b and \rootfactor’s of size b, so it takes O(ℓblogb)\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 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=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 i 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 efficiently (see here).
Indeed, if you think about it, this tree implicitly computes the \rootfactor tree too, since each CF proof for vi has an RSA membership witness for i in it.
Note that Campanelli et al.[^CFGplus20e] claim O(ℓnlog2n)\Gho operations for this algorithm, but the faster disaggregation explained above actually gives O(ℓnlogn).
[^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]