# Accumulator (cryptography)

In cryptography, an accumulator is a one way membership hash function. It allows users to certify that potential candidates are a member of a certain set without revealing the individual members of the set. This concept was formally introduced by Josh Benaloh and Michael de Mare in 1993.[1][2]

## Formal definitions

There are several formal definitions which have been proposed in the literature. This section lists them by proposer, in roughly chronological order.[2]

### Benaloh and de Mare (1993)

Benaloh and de Mare define a one-way hash function as a family of functions $\displaystyle{ h_{\ell}: X_{\ell}\times Y_{\ell}\to Z_{\ell} }$ which satisfy the following three properties:[1][2]

1. For all $\displaystyle{ \ell\in\mathbb{Z}, x\in X_{\ell}, y\in Y_{\ell} }$, one can compute $\displaystyle{ h_{\ell}(x,y) }$ in time $\displaystyle{ \text{poly}(\ell, |x|, |y|) }$. (Here the "poly" symbol refers to an unspecified, but fixed, polynomial.)
2. No probabilistic polynomial-time algorithm will, for sufficiently large $\displaystyle{ \ell }$, map the inputs $\displaystyle{ \ell\in\mathbb{Z}, (x, y)\in X_{\ell}\times Y_{\ell}, y'\in Y_{\ell} }$, find a value $\displaystyle{ x'\in X_{\ell} }$ such that $\displaystyle{ h_{\ell}(x, y) = h_{\ell}(x', y') }$ with more than negligible probability.
3. For all $\displaystyle{ \ell\in\mathbb{Z}, x\in X_{\ell}, y_1, y_2\in Y_{\ell} }$, one has $\displaystyle{ h(h(x, y_1), y_2) = h(h(x, y_2), y_1) }$. (A function that satisfies this property is called quasi-commutative.)

(With the first two properties, one recovers the normal definition of a cryptographic hash function.)

From such a function, one defines the "accumulated hash" of a set $\displaystyle{ \{y_1,\dots, y_m \} }$ and starting value $\displaystyle{ x }$ w.r.t. a value $\displaystyle{ z }$ to be $\displaystyle{ h(h(\cdots h(h(x, y_1), y_2),\dots, y_{m-1}), y_m) }$. The result, does not depend on the order of elements $\displaystyle{ y_1,y_2,...,y_n }$because $\displaystyle{ h }$ is quasi-commutative.[1][2]

If $\displaystyle{ y_1,y_2,...,y_n }$ belong to some users of a cryptosystem, then everyone can compute the accumulated value $\displaystyle{ z. }$ Also, the user of $\displaystyle{ y_i }$ can compute the partial accumulated value $\displaystyle{ z_i }$ of $\displaystyle{ ( y_1,...,y_{i-1},y_{i+1},...,y_n ) }$. Then, $\displaystyle{ h(z_i,y_i)=z. }$ So the $\displaystyle{ i - }$user can provide the pair $\displaystyle{ (z_i,y_i) }$ to any other part, in order to authenticate $\displaystyle{ y_i }$.

### Barić and Pfitzmann (1997)

The basic functionality of a quasi-commutative hash function is not immediate from the definition. To fix this, Barić and Pfitzmann defined a slightly more general definition, which is the notion of an accumulator scheme as consisting of the following components:[2][3]

1. Gen: a probabilistic algorithm that takes in two parameters $\displaystyle{ \lambda, N }$ (the security parameter and the number of values that can be securely accumulated, respectively), and returns an appropriate key $\displaystyle{ k }$.
2. Eval: a probabilistic algorithm that takes in a key $\displaystyle{ k }$ and accumulation set $\displaystyle{ Y:=\{y_1, \dots, y_{N'}\} }$, where $\displaystyle{ N'\leq N }$, and returning an accumulated value $\displaystyle{ z }$ and auxiliary information $\displaystyle{ aux }$. We insist that Eval must be deterministic for $\displaystyle{ z }$.
3. Wit: a probabilistic algorithm that takes in a key $\displaystyle{ k }$, a value $\displaystyle{ y }$, an accumulated value $\displaystyle{ z }$ of some set $\displaystyle{ Y }$, and some auxiliary information $\displaystyle{ aux }$, and returns either a witness $\displaystyle{ w }$ or the special symbol $\displaystyle{ \bot }$. We insist that, if $\displaystyle{ y\in L }$, that Wit returns a witness, and that Wit otherwise returns $\displaystyle{ \bot }$.
4. Ver: a deterministic algorithm that takes in a key $\displaystyle{ k }$, a value $\displaystyle{ y }$, a witness $\displaystyle{ w }$, and an accumulated value $\displaystyle{ z }$, and returns a Yes/No value. We insist that if $\displaystyle{ w }$ was generated from running Wit on a tuple $\displaystyle{ (k, y, z, aux) }$, where $\displaystyle{ z, aux }$ were generated from running Eval on some $\displaystyle{ k, L }$, and where $\displaystyle{ L }$ was chosen arbitrarily and $\displaystyle{ k }$ was chosen from running Gen, that Ver always return Yes.

It is relatively easy to see that one can define an accumulator scheme from any quasi-commutative hash function, using the technique shown above.[2]

### Camenisch and Lysyanskaya (2002)

One observes that, for many applications, the set of accumulated values will change many times. Naïvely, one could completely redo the accumulator calculation every time; however, this may be inefficient, especially if our set is very large and the change is very small. To formalize this intuition, Camenish and Lysyanskaya defined a dynamic accumulator scheme to consist of the 4 components of an ordinary accumulator scheme, plus three more:[2][4]

1. Add: a (possibly probabilistic) algorithm that takes in a key $\displaystyle{ k }$, an accumulated value $\displaystyle{ z }$, and another value to accumulate $\displaystyle{ y }$, and returns a new accumulated value $\displaystyle{ z' }$ and auxiliary information $\displaystyle{ aux }$. We insist that if $\displaystyle{ z }$ was generated by accumulating some set $\displaystyle{ L }$, then $\displaystyle{ z' }$ must be as if it were generated by accumulating the set $\displaystyle{ L\cup\{y\} }$.
2. Del: a (possibly probabilistic) algorithm that takes in a key $\displaystyle{ k }$, an accumulated value $\displaystyle{ z }$, and another value to accumulate $\displaystyle{ y }$, and returns a new accumulated value $\displaystyle{ z' }$ and auxiliary information $\displaystyle{ aux }$. We insist that if $\displaystyle{ z }$ was generated by accumulating some set $\displaystyle{ L }$, then $\displaystyle{ z' }$ must be as if it were generated by accumulating the set $\displaystyle{ L\backslash\{y\} }$.
3. Upd: a deterministic algorithm that takes in the key $\displaystyle{ k }$, a value $\displaystyle{ y }$, a witness $\displaystyle{ w }$, the accumulated value $\displaystyle{ z }$, and auxiliary information $\displaystyle{ aux }$, and returns a new witness $\displaystyle{ w' }$. We insist that if $\displaystyle{ k }$ was generated by Gen, $\displaystyle{ y }$ is part of a set $\displaystyle{ L }$, $\displaystyle{ w }$ is a witness for $\displaystyle{ y }$ being a member of $\displaystyle{ L }$, and $\displaystyle{ z }$ is an accumulated value for $\displaystyle{ L }$, and $\displaystyle{ aux }$ was generated by running Add or Del, then $\displaystyle{ w' }$ will be a witness for $\displaystyle{ y }$ being a member of the new set.

Fazio and Nicolosi note that since Add, Del, and Upd can be simulated by rerunning Eval and Wit, this definition does not add any fundamentally new functionality.[2]

## Examples

One example is multiplication over large prime numbers. This is a cryptographic accumulator, since it takes superpolynomial time to factor a composite number (at least according to conjecture), but it takes only a small amount of time (polynomial in size) to divide a prime into an integer to check if it is one of the factors and/or to factor it out. New members may be added or subtracted to the set of factors by multiplying or factoring out the number respectively. In this system, two accumulators that have accumulated a single shared prime can have it trivially discovered by calculating their GCD, even without prior knowledge of the prime (which would otherwise require prime factorization of the accumulator to discover).

More practical accumulators use a quasi-commutative hash function, so that the size of the accumulator does not grow with the number of members. For example, Benaloh and de Mare propose a cryptographic accumulator inspired by RSA: the quasi-commutative function $\displaystyle{ h(x, y) := x^y\pmod{n} }$ for some composite number $\displaystyle{ n }$. They recommend to choose $\displaystyle{ n }$ to be a rigid integer (i.e. the product of two safe primes).[1] Barić and Pfitzmann proposed a variant where $\displaystyle{ y }$ was restricted to be prime and at most $\displaystyle{ n/4 }$ (this constant is very close to $\displaystyle{ \phi(n) }$, but does not leak information about the prime factorization of $\displaystyle{ n }$).[2][3]

David Naccache observed in 1993 that $\displaystyle{ e_{n, c}(x, y) := x^y c^{y - 1} \pmod{n} }$ is quasi-commutative for all constants $\displaystyle{ c, n }$, generalizing the previous RSA-inspired cryptographic accumulator. Naccache also noted that the Dickson polynomials are quasi-commutative in the degree, but it is unknown whether this family of functions is one-way.[1]

In 1996, Nyberg constructed an accumulator which is provably information-theoretically secure in the random oracle model. Choosing some upper limit $\displaystyle{ N = 2^d }$ for the number of items that can be securely accumulated and $\displaystyle{ \lambda }$ the security parameter, define the constant $\displaystyle{ \ell:\approx\frac{e}{\log_2(e)}\lambda N\log_2(N) }$ to be an integer multiple of $\displaystyle{ d }$ (so that one can write $\displaystyle{ \ell = rd }$) and let $\displaystyle{ H:\{0, 1\}^* \to \{0, 1\}^{\ell} }$ be some cryptographically secure hash function. Choose a key $\displaystyle{ k }$ as a random $\displaystyle{ r }$-bit bitstring. Then, to accumulate using Nyberg's scheme, use the quasi-commutative hash function $\displaystyle{ h(x, y):= x\odot\alpha_r(H(y)) }$, where $\displaystyle{ \odot }$ is the bitwise and operation and $\displaystyle{ \alpha_r:\{0, 1\}^{\ell}\to \{0,1\}^r }$ is the function that interprets its input as a sequence of $\displaystyle{ d }$-bit bitstrings of length $\displaystyle{ r }$, replaces every all-zero bitstring with a single 0 and every other bitstring with a 1, and outputs the result.[2][5]

## Applications

Haber and Stornetta showed in 1990 that accumulators can be used to timestamp documents through cryptographic chaining. (This concept anticipates the modern notion of a cryptographic blockchain.)[1][2][6] Benaloh and de Mare proposed an alternative scheme in 1991 based on discretizing time into rounds.[1][7]

Benaloh and de Mare showed that accumulators can be used so that a large group of people can recognize each other at a later time (which Fazio and Nicolosi call an "ID Escrow" situation). Each person selects a $\displaystyle{ y }$ representing their identity, and the group collectively selects a public accumulator $\displaystyle{ h }$ and a secret $\displaystyle{ x }$. Then, the group publishes or saves the hash function and the accumulated hash of all the group's identities w.r.t the secret $\displaystyle{ x }$ and public accumulator; simultaneously, each member of the group keeps both its identity value $\displaystyle{ y }$ and the accumulated hash of all the group's identities except that of the member. (If the large group of people do not trust each other, or if the accumulator has a cryptographic trapdoor as in the case of the RSA-inspired accumulator, then they can compute the accumulated hashes by secure multiparty computation.) To verify that a claimed member did indeed belong to the group later, they present their identity and personal accumulated hash (or a zero-knowledge proof thereof); by accumulating the identity of the claimed member and checking it against the accumulated hash of the entire group, anyone can verify a member of the group.[1][2] With a dynamic accumulator scheme, it is additionally easy to add or remove members afterward.[2][4]

Cryptographic accumulators can also be used to construct other cryptographically secure data structures:

• Barić and Pfitzmann show that one can construct fail-stop signatures with only constant space by exploiting the compression property.[2][3]
• Goodrich et al. constructed a size-oblivious, efficient, dynamic authenticated dictionary (which allows untrusted directories to give cryptographically verifiable answers to membership queries).[2][8]
• Papamanthou et al. constructed a cryptographically secure hash table, whose functionality can be authenticated when stored remotely.[9]

The concept has received renewed interest due to the Zerocoin add on to bitcoin, which employs cryptographic accumulators to eliminate trackable linkage in the bitcoin blockchain, which would make transactions anonymous and more private.[10][11][12] More concretely, to mint (create) a Zerocoin, one publishes a coin and a cryptographic commitment to a serial number with a secret random value (which all users will accept as long as it is correctly formatted); to spend (reclaim) a Zerocoin, one publishes the Zerocoin's serial number along with a non-interactive zero-knowledge proof that they know of some published commitment that relates to the claimed serial number, then claims the coin (which all users will accept as long as the NIZKP is valid and the serial number has not appeared before).[10][11] Since the initial proposal of Zerocoin, it has been succeeded by the Zerocash protocol and is currently being developed into Zcash, a fully-fledged[weasel words] digital currency.[13][14]

## References

1. Benaloh, Josh; de Mare, Michael (1994). "One-way Accumulators: A Decentralized Alternative to Digital Signatures". Advances in Cryptology — EUROCRYPT '93. LCNS 765: 274–285. doi:10.1007/3-540-48285-7_24. ISBN 978-3-540-57600-6. Retrieved 3 May 2021.
2. Fazio, Nelly; Nicolosi, Antonio (2002). "Cryptographic Accumulators: Definitions, Constructions and Applications".
3. Barić, Niko; Pfitzmann, Birgit (1997). Fumy, Walter. ed. "Collision-Free Accumulators and Fail-Stop Signature Schemes Without Trees" (in en). Advances in Cryptology — EUROCRYPT '97. Lecture Notes in Computer Science (Berlin, Heidelberg: Springer) 1233: 480–494. doi:10.1007/3-540-69053-0_33. ISBN 978-3-540-69053-5.
4. Camenisch, Jan; Lysyanskaya, Anna (2002). Yung, Moti. ed. "Dynamic Accumulators and Application to Efficient Revocation of Anonymous Credentials" (in en). Advances in Cryptology — CRYPTO 2002. Lecture Notes in Computer Science (Berlin, Heidelberg: Springer) 2442: 61–76. doi:10.1007/3-540-45708-9_5. ISBN 978-3-540-45708-4.
5. Nyberg, Kaisa (1996). Gollmann, Dieter. ed. "Fast accumulated hashing" (in en). Fast Software Encryption. Lecture Notes in Computer Science (Berlin, Heidelberg: Springer) 1039: 83–87. doi:10.1007/3-540-60865-6_45. ISBN 978-3-540-49652-6.
6. Haber, Stuart; Stornetta, W. Scott (1991). Menezes, Alfred J.; Vanstone, Scott A.. eds. "How to Time-Stamp a Digital Document" (in en). Advances in Cryptology-CRYPTO' 90. Lecture Notes in Computer Science (Berlin, Heidelberg: Springer) 537: 437–455. doi:10.1007/3-540-38424-3_32. ISBN 978-3-540-38424-3.
7. Benaloh, J.; de Mare, M. (August 1991). "Efficient Broadcast Time-Stamping". Clarkson University Department of Mathematics and Computer Science TR 91-1.
8. Goodrich, Michael T.; Tamassia, Roberto; Hasić, Jasminka (11 Nov 2001). "An Efficient Dynamic and Distributed Cryptographic Accumulator". International Conference on Information Security ISC 2002: 372–388.
9. Papamanthou, Charalampos; Tamassia, Roberto; Triandopoulos, Nikos (18 Aug 2009). "Cryptographic Accumulators for Authenticated Hash Tables". Cryptology ePrint Archive. Retrieved 3 May 2021.
10. Ian, Miers; Garman, Christina; Green, Matthew; Rubin, Aviel D. (2013). "Zerocoin: Anonymous Distributed E-Cash from Bitcoin". 2013 IEEE Symposium on Security and Privacy: 397–411. doi:10.1109/SP.2013.34. ISBN 978-0-7695-4977-4. Retrieved 3 May 2021.
11. Green, Matthew (11 Apr 2013). "Zerocoin: making Bitcoin anonymous".