Post · 5 min read· pp. 111–113

RSA Accumulators

An RSA accumulator is an authenticated set built from cryptographic assumptions in hidden-order groups such as ZN∗\mathbb{Z}_N^*. RSA accumulators enable a prover, who stores the full set, to convince any verifier, who only stores a succinct digest of the set, of various set relations such as (non)membership, subset or disjointness. For example, the prover can prove membership of elements in the set to verifiers who have the digest.

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

The digest of the set is often referred to as the accumulator of the set.

RSA accumulators were introduced by Benaloh and de Mare[^Bd93] and later extended by Li et al.[^LLX07] with non-mmebership proofs. Recently, Boneh et al.[^BBF18] extended RSA accumulators with many new features.

This post is not a full treatment of RSA accumulators, but will be extended over time.

Digest (or accumulator) of a set

Let HH be a collision-resistant hash function that maps its input to prime numbers. Let gg be the generator of a hidden-order group \Gho\Gho where the Strong RSA problem is hard. Let T={b1,b2,…,bn}T = \{b_1, b_2, \dots, b_n\} and let ei=H(bi)e_i = H(b_i) be the prime representative of bib_i.

The accumulator of TT is:

a=g∏i∈[n]eia = g^{\prod_{i\in[n]} e_i}

Note that this can be computed in O(n)O(n) exponentiations in \Gho\Gho.

Membership witnesses

To prove that bib_i is in the accumulator, a membership witness can be computed:

wi=g∏j∈[n]∖{i}ej=a1/eiw_i = g^{\prod_{j\in[n]\setminus\{i\}} e_j} = a^{1/e_i}

Note that the witness is simply the accumulator of the set T∖{bi}T \setminus \{b_i\} and is just an eie_ith root of aa!

Unfortunately, computing this root cannot be done using an exponentiation by $1/e_i$ because eie_i cannot be inverted without knowing the order of the group \Gho\Gho. Instead, computing wiw_i has to be done by exponentiating gg by the n−1n-1 different eie_i’s and thus takes O(n)O(n) time, which can be slow. We explain below how this can be done in O(log⁡n)O(\log{n}) amortized time per witness.

To verify the witness against the accumulator aa, one checks if:

a=?wieia \stackrel{?}{=} w_i^{e_i}

In other words, one simply “adds back” bib_i to the set accumulated in wiw_i and checks if the result equals aa. This takes one exponentiation in \Gho\Gho.

Membership witnesses can be easily generalized into batch membership witnesses. For example, if one wants to prove that all (bi)i∈I(b_i)_{i\in I} are in the accumulator, they can compute:

wI=g∏i∈[n]∖Iei=a1/∏i∈Ieiw_I = g^{\prod_{i\in[n]\setminus I} e_i} = a^{1/ \prod_{i\in I} e_i}

The verification proceeds analogously but takes O(∣I∣)O(\vert I \vert) exponentiations:

a=?wi∏i∈Ieia \stackrel{?}{=} w_i^{\prod_{i\in I}e_i}

Precomputing all membership witnesses fast

Computing all nn membership witnesses naively takes O(n2)O(n^2) exponentiations in \Gho\Gho, which does not scale well. Fortunately, Sander et al.[^SSY01] give a divide-and-conquer approach for computing all witnesses which takes O(nlog⁡n)O(n\log{n}) exponentiations in \Gho\Gho.

The key observation is that half of the witnesses require computing g∏i∈[1,n/2]eig^{\prod_{i\in[1,n/2]} e_i} while the other half require computing g∏i∈[n/2+1,n]eig^{\prod_{i\in[n/2+1,n]} e_i}. If done naively, these computations would be repeated many times unnecessarily. But one could compute the witnesses recursively in a tree-like fashion as follows (n=8n=8 in this example):

Intuition: You can think of each node as (1) a set of elements and (2) its batch membership witness w.r.t. the accumulator aa. Then, this algorithm simply splits the set into two halves and disaggregates the witness into witnesses for the two halves. This repeats until witnesses for individual elements are obtained at the bottom.

In other words, this algorithm computes every eie_ith root of aa (i.e., ge1…ei−1ei+1…eng^{e_1 \dots e_{i-1} e_{i+1} \dots e_{n}}) for all i∈[n]i\in[n]. The time to compute a tree of size nn leaves can be defined recursively as T(n)=2T(n/2)+O(n)T(n) = 2T(n/2) + O(n) because the amount of work done at the root of a size-nn subtree is O(n)O(n) exponentiations plus the time to recurse on its two children. This gives T(n)=O(nlog⁡n)T(n) = O(n\log{n}) exponentiations.

Boneh et al.[^BBF18] baptised this algorithm as \rootfactor\rootfactor. Specifically,

\rootfactor(g,(ei)i∈[n])=(wi)i∈[n]=(a1/ei)i∈[n]=((g∏j∈[n]ej)1/ei)i∈[n]\rootfactor(g, (e_i)_{i\in[n]}) = (w_i)_{i\in[n]} = (a^{1/e_i})_{i\in[n]} = \left((g^{\prod_{j\in[n]} e_j})^{1/e_i}\right)_{i\in[n]}

More to come

There is so much more to be said about RSA accumulators! Hopefully, we will update this post over time with:

  • Accumulator updates
  • Membership witness updates
  • Cross-incremental (dis)aggregation of membership witnesses [^TXN20e]
  • Non-membership witnesses
    • Updates
    • Aggregation
  • Disjointness witnesses [^Tome20]
  • Subset witnesses [^Tome20]
  • Leveraging the trapdoor (RSA factorization) to compute witnesses and accumulators faster
    • And when it should not be used
  • Instantiating RSA accumulators over class groups

References

For cited works, see below 👇👇

[^Bd93]: One-Way Accumulators: A Decentralized Alternative to Digital Signatures, by Benaloh, Josh and de Mare, Michael, in EUROCRYPT ‘93, 1994 [^LLX07]: Universal Accumulators with Efficient Nonmembership Proofs, by Li, Jiangtao and Li, Ninghui and Xue, Rui, in Applied Cryptography and Network Security, 2007 [^SSY01]: Blind, Auditable Membership Proofs, by Sander, Tomas and Ta-Shma, Amnon and Yung, Moti, in Financial Cryptography, 2001 [^TXN20e]: Authenticated Dictionaries with Cross-Incremental Proof (Dis)aggregation, by Alin Tomescu and Yu Xia and Zachary Newman, in Cryptology ePrint Archive, Report 2020/1239, 2020, [URL] [^Tome20]: How to Keep a Secret and Share a Public Key (Using Polynomial Commitments), by Tomescu, Alin, 2020, [URL]