Construct an accumulator object.
Get the current accumulated value
Add a single element to the accumulator
Optional
secretKey: AccumulatorSecretKeyOptional
state: IAccumulatorStateOptional. If provided, checked before adding and updated with the new element
Add multiple elements in a batch.
Optional
secretKey: AccumulatorSecretKeyOptional
state: IAccumulatorStateProtected
addProtected
If state is provided, add the batch of elements to the state
Optional
state: IAccumulatorStateAdd and remove 1 batch of elements each.
Optional
secretKey: AccumulatorSecretKeyOptional
state: IAccumulatorStateProtected
addProtected
If state is provided, add the element to the state
Optional
state: IAccumulatorStateProtected
ensureProtected
Check if element is absent in the state and throws an error if its present. Only checks if the state is passed
Optional
state: IAccumulatorStateProtected
ensureProtected
Check 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
Optional
state: IAccumulatorStateProtected
ensureProtected
Check if element is present in the state and throws an error if its absent. Only checks if the state is passed
Optional
state: IAccumulatorStateProtected
ensureProtected
Check 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
Optional
state: IAccumulatorStateProtected
getReturn the params if provided as an argument else look for params on this
.
Optional
params: AccumulatorParamsparams or throws error if cannot find params
Protected
getReturn the secret key if provided as an argument else look for secret key on this
.
Optional
secretKey: AccumulatorSecretKeysecret key or throws error if cannot find secret key
Create membership witness for a single member.
for which the witness is created.
Optional
secretKey: AccumulatorSecretKeyOptional
state: 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
Optional
secretKey: AccumulatorSecretKeyOptional
state: IAccumulatorStateOptional. If provided, checks that all members
are present in state
Remove a single element from the accumulator
Optional
secretKey: AccumulatorSecretKeyOptional
state: IAccumulatorStateOptional. If provided, checked before removing and element is removed
Remove multiple elements in a batch.
Optional
secretKey: AccumulatorSecretKeyOptional
state: IAccumulatorStateProtected
removeProtected
If state is provided, remove the batch of elements from the state
Optional
state: IAccumulatorStateProtected
removeProtected
If state is provided, remove the element from the state
Optional
state: IAccumulatorStateVerify that membership witness is valid for the member.
Optional
params: AccumulatorParamsStatic
deriveStatic
encodeTo 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.
Static
encodeStatic
fromUsed by the verifier to create the accumulator.
Static
fromJSONStatic
generateGenerate private and public key from given params and optional seed
.
Optional
seed: Uint8ArrayPass to generate keys deterministically.
Static
generateGenerate 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.
Optional
label: Uint8ArrayThe bytearray that is hashed to deterministically generate the proving key.
Static
generateGenerate proving key for proving non-membership in a universal accumulator in zero knowledge.
Optional
label: Uint8ArrayThe bytearray that is hashed to deterministically generate the proving key.
Static
generateGenerate accumulator parameters. They are needed to generate public key and initialize the accumulator.
Optional
label: Uint8ArrayPass to generate parameters deterministically.
Static
generateGenerate public key from given params and secret key.
Static
generateGenerate secret key for the accumulator manager who updates the accumulator and creates witnesses.
Optional
seed: Uint8ArrayPass to generate key deterministically.
Static
initializeInitialize a positive accumulator
Optional
secretKey: AccumulatorSecretKeyOptional. If provided, its stored to do any future updates.
VB accumulator that supports only membership proofs.