Construct an accumulator object.
f_V is supposed to kept private by the accumulator manager. V is the accumulated value.
Add a single element to the accumulator
The element to add.
OptionalsecretKey: AccumulatorSecretKeyIf secret key is not provided, its expected to find the secret key on the object.
Optionalstate: IAccumulatorStateIf state is provided it is checked before computing the new accumulator and updated with new element after computing the new accumulator. Throws error if element present.
OptionalinitialElementsStore: IInitialElementsStoreif provided, check that the element is not part of the initial elements, throws error if it is.
Add a batch of elements to the accumulator.
OptionalsecretKey: AccumulatorSecretKeyOptionalstate: IAccumulatorStateIf state is provided it is checked before computing the new accumulator and updated with new elements after computing the new accumulator
OptionalinitialElementsStore: IInitialElementsStoreProtectedaddProtectedIf state is provided, add the batch of elements to the state
Optionalstate: IAccumulatorStateAdd and remove batches of elements.
The batch to be added
The batch to be removed.
OptionalsecretKey: AccumulatorSecretKeyOptionalstate: IAccumulatorStateIf state is provided it is checked before computing the new accumulator and updated by adding and removing given elements after computing the new accumulator.
OptionalinitialElementsStore: IInitialElementsStoreProtectedaddProtectedIf state is provided, add the element to the state
Optionalstate: IAccumulatorStateProtectedcheckProtectedChecks to do before adding a new element
Optionalstate: IAccumulatorStateOptionalinitialElementsStore: IInitialElementsStoreProtectedcheckProtectedChecks to do before adding several elements as a batch
Optionalstate: IAccumulatorStateOptionalinitialElementsStore: IInitialElementsStoreProtectedcheckProtectedChecks to do before removing an existing element
Optionalstate: IAccumulatorStateOptionalinitialElementsStore: IInitialElementsStoreProtectedcheckProtectedChecks to do before removing several elements as a batch
Optionalstate: IAccumulatorStateOptionalinitialElementsStore: IInitialElementsStoreThrows an error if the element is part of the initial elements given that the initial element store is provided
Optionalstore: IInitialElementsStoreThrows an error if any element of the batch is part of the initial elements given that the initial element store is provided
Optionalstore: IInitialElementsStoreProtectedensureProtectedCheck if element is absent in the state and throws an error if its present. Only checks if the state is passed
Optionalstate: IAccumulatorStateProtectedensureProtectedCheck if a batch of elements is absent in the state and throws an error any of them is present. Only checks if the state is passed
Optionalstate: IAccumulatorStateProtectedensureProtectedCheck if element is present in the state and throws an error if its absent. Only checks if the state is passed
Optionalstate: IAccumulatorStateProtectedensureProtectedCheck if a batch of elements is present in the state and throws an error any of them is absent. Only checks if the state is passed
Optionalstate: IAccumulatorStateProtectedgetReturn the params if provided as an argument else look for params on this.
Optionalparams: AccumulatorParamsparams or throws error if cannot find params
ProtectedgetReturn the secret key if provided as an argument else look for secret key on this.
OptionalsecretKey: AccumulatorSecretKeysecret key or throws error if cannot find secret key
Calculate the membership witness for the given element
OptionalsecretKey: AccumulatorSecretKeyOptionalstate: IAccumulatorStateIf state is provided it is checked for presence of the element before calculating the witness
OptionalinitialElementsStore: IInitialElementsStoreCalculate the membership witnesses for the given batch of elements
OptionalsecretKey: AccumulatorSecretKeyOptionalstate: IAccumulatorStateIf state is provided it is checked for presence of all the elements before calculating the witnesses
OptionalinitialElementsStore: IInitialElementsStoreCalculate the non-membership witness for the given element. The function takes time proportional to the current size of the accumulator as it takes the product of difference of all members and the non-member. To avoid taking too much memory, it breaks the computation into smaller batches.
OptionalsecretKey: AccumulatorSecretKeyOptionalparams: AccumulatorParamsOptionalinitialElementsStore: IInitialElementsStoreBreaks down this large computation in batches of size batchSize.
Calculate the non-membership witnesses for given batch of elements. The function takes time proportional to the current members and the number of non-members. To avoid taking too much memory, it breaks the computation into smaller batches.
OptionalsecretKey: AccumulatorSecretKeyOptionalparams: AccumulatorParamsOptionalinitialElementsStore: IInitialElementsStoreBreaks down this large computation in batches of size batchSize.
Calculate the non-membership witnesses for given batch of elements when the product of differences of all members and
non-member (d) for each non-member is already computed.
array of products of difference of all members and each non-member
OptionalsecretKey: AccumulatorSecretKeyOptionalparams: AccumulatorParamsOptionalstate: IUniversalAccumulatorStateOptionalinitialElementsStore: IInitialElementsStoreCalculate the non-membership witness for the given element when the product of differences of all members and
non-member (d) is already computed.
the product of difference of all members and the non-member.
OptionalsecretKey: AccumulatorSecretKeyOptionalparams: AccumulatorParamsOptionalstate: IUniversalAccumulatorStateOptionalinitialElementsStore: IInitialElementsStoreRemove a single element from the accumulator
OptionalsecretKey: AccumulatorSecretKeyOptionalstate: IAccumulatorStateIf state is provided it is checked before computing the new accumulator and element is removed from it after computing the new accumulator. Throws error if element is not present.
OptionalinitialElementsStore: IInitialElementsStoreif provided, check that the element is not part of the initial elements, throws error if it is.
Remove a batch of elements from the accumulator.
OptionalsecretKey: AccumulatorSecretKeyOptionalstate: IAccumulatorStateIf state is provided it is checked before computing the new accumulator and updated by removing those elements after computing the new accumulator
OptionalinitialElementsStore: IInitialElementsStoreProtectedremoveProtectedIf state is provided, remove the batch of elements from the state
Optionalstate: IAccumulatorStateProtectedremoveProtectedIf state is provided, remove the element from the state
Optionalstate: IAccumulatorStateVerify the membership witness.
Optionalparams: AccumulatorParamsOptionalparams: AccumulatorParamsStaticcombineStaticdStaticderiveStaticdStaticencodeTo add arbitrary bytes like byte representation of UUID or some other user id or something else as an accumulator member, encode it first using this. This is an irreversible encoding as a hash function is used to convert a message of arbitrary length to a fixed length encoding.
StaticencodeStaticfixedStaticfromStaticfromJSONStaticgenerateGenerate private and public key from given params and optional seed.
Optionalseed: Uint8ArrayPass to generate keys deterministically.
StaticgenerateGenerate proving key for proving membership in an accumulator in zero knowledge. Proving key is public data that must be known to both the prover and verifier. Any prover and verifier pair can mutually agree on a proving key and the manager does not need to be aware of any proving key.
Optionallabel: Uint8ArrayThe bytearray that is hashed to deterministically generate the proving key.
StaticgenerateGenerate proving key for proving non-membership in a universal accumulator in zero knowledge.
Optionallabel: Uint8ArrayThe bytearray that is hashed to deterministically generate the proving key.
StaticgenerateGenerate accumulator parameters. They are needed to generate public key and initialize the accumulator.
Optionallabel: Uint8ArrayPass to generate parameters deterministically.
StaticgenerateGenerate public key from given params and secret key.
StaticgenerateGenerate secret key for the accumulator manager who updates the accumulator and creates witnesses.
Optionalseed: Uint8ArrayPass to generate key deterministically.
StaticinitialTakes product of the form initial_element_i + secret_key.
StaticinitializeInitialize a universal accumulator of the given maxSize. The function takes time proportional to maxSize as it
generates about the same number of elements as the maxSize and takes their product in the end. These "initial elements"
should not be added or removed from the accumulator.
Maximum members the accumulator can have at any instant.
OptionalinitialElementsStore: IInitialElementsStoreOptional, stores "initial elements" generated during initialization.
Breaks down this large computation in batches of size batchSize.
StaticinitializeAssumes that the initial elements are generated and their product is taken, initialize the accumulator.
OptionalsecretKey: AccumulatorSecretKey
VB accumulator that supports both membership proofs and non-membership proofs. For guarding against forgery of non-membership proofs (details in the paper), during initialization, it should generate several accumulator members and never remove them from accumulator, nor it should allow duplicates of them to be added. Thus, several methods accept an optional persistent database
IInitialElementsStorewhich stores those initial elements.