Construct an accumulator object.
Get the current accumulated value
Add a single element to the accumulator
OptionalsecretKey: AccumulatorSecretKeyOptionalstate: IAccumulatorStateOptional. If provided, checked before adding and updated with the new element
Add multiple elements in a batch.
OptionalsecretKey: AccumulatorSecretKeyOptionalstate: IAccumulatorStateProtectedaddProtectedIf state is provided, add the batch of elements to the state
Optionalstate: IAccumulatorStateAdd and remove 1 batch of elements each.
OptionalsecretKey: AccumulatorSecretKeyOptionalstate: IAccumulatorStateProtectedaddProtectedIf state is provided, add the element to the state
Optionalstate: IAccumulatorStateProtectedensureProtectedCheck 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
Create membership witness for a single member.
for which the witness is created.
OptionalsecretKey: AccumulatorSecretKeyOptionalstate: IAccumulatorStateOptional. If provided, checks that member is present in state
Create membership witnesses for a batch of members. More efficient than creating witness for 1 member at a time.
array of members for which witnesses need to be creates
OptionalsecretKey: AccumulatorSecretKeyOptionalstate: IAccumulatorStateOptional. If provided, checks that all members are present in state
Remove a single element from the accumulator
OptionalsecretKey: AccumulatorSecretKeyOptionalstate: IAccumulatorStateOptional. If provided, checked before removing and element is removed
Remove multiple elements in a batch.
OptionalsecretKey: AccumulatorSecretKeyOptionalstate: IAccumulatorStateProtectedremoveProtectedIf state is provided, remove the batch of elements from the state
Optionalstate: IAccumulatorStateProtectedremoveProtectedIf state is provided, remove the element from the state
Optionalstate: IAccumulatorStateVerify that membership witness is valid for the member.
Optionalparams: AccumulatorParamsStaticderiveStaticencodeTo 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.
StaticencodeStaticfromUsed by the verifier to create the accumulator.
StaticfromJSONStaticgenerateGenerate 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.
StaticinitializeInitialize a positive accumulator
OptionalsecretKey: AccumulatorSecretKeyOptional. If provided, its stored to do any future updates.
VB accumulator that supports only membership proofs.