KB universal accumulator. Its composed of 2 accumulators, one for accumulating elements that are "members" and one for "non-members". But this detail is largely abstracted away. All possible "members" and "non-members" of this accumulator are called its domain and during initialization, the domain needs to be known/passed. The domain can be extended at any point and any number of times.

Hierarchy (view full)

Constructors

Properties

params: undefined | AccumulatorParams
secretKey: undefined | AccumulatorSecretKey

Accessors

Methods

  • Add a single element to the accumulator

    Parameters

    • element: Uint8Array

      The element to add.

    • OptionalsecretKey: AccumulatorSecretKey

      If secret key is not provided, its expected to find the secret key on the object.

    • Optionalstate: IKBUniversalAccumulatorState

      If 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.

    Returns Promise<void>

  • To 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.

    Parameters

    • bytes: Uint8Array

    Returns Uint8Array

  • Generate 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.

    Parameters

    • Optionallabel: Uint8Array

      The bytearray that is hashed to deterministically generate the proving key.

    Returns MembershipProvingKey