Class BlindedCredentialRequestBuilder<SigParams>Abstract

Creates a request for a blinded credential, i.e. where some of the attributes are not known to the signer

Type Parameters

  • SigParams

Hierarchy (view full)

Constructors

Properties

The schema of the whole (unblinded credential). This should include all attributes, i.e. blinded and unblinded

_statusToBlind?: object

The credential status if blinded

_subjectToBlind?: object | object[]

The attributes of the credential subject that will be blinded (hidden from the issuer)

_topLevelAttributesToBlind: Map<string, unknown>

Any top level attributes to blind

_version: string
attributeEqualities: BlindedAttributeEquality[]

Equalities between blinded and credential attributes

attributeInequalities: Map<string, [IPresentedAttributeInequality, Uint8Array][]>

Attributes proved inequal to a public value in zero knowledge. An attribute can be proven inequal to any number of values

boundedPseudonyms: IProverBoundedPseudonymInBlindedCredReq[]

Pseudonyms on blinded and credential attributes

bounds: Map<string, IPresentedAttributeBound[]>

Bounds on blinded attributes

circomPredicates: IProverCircomPredicate[]

Circom predicates on blinded attributes

presentationBuilder: PresentationBuilder

A blinded credential request will contain a presentation that will prove predicates about the credential attributes and blinded attributes.

sigParams?: SignatureParams
verifEnc: Map<string, IPresentedAttributeVE[]>

Encryption of blinded attributes

VERSION: string = '0.5.0'

Follows semver and must be updated accordingly when the logic of this class changes or the underlying crypto changes.

Accessors

Methods

  • Add a pseudonym which is bound to 0 or more credential attributes and 0 or more blinded attributes

    Parameters

    • basesForAttributes: Uint8Array[]

      The bases at the beginning of array will be used for credential attributes and then in the end for blinded attributes.

    • credentialAttributeNames: Map<number, string[]>

      Map with key as the credential index and value as an array of attribute to use in pseudonym.

    • blindedAttributeNames: string[]

      Array of blinded attribute to use in pseudonym

    • OptionalbaseForSecretKey: Uint8Array
    • OptionalsecretKey: Uint8Array

    Returns void

  • Add a pseudonym to only credential attributes

    Parameters

    • basesForAttribute: Uint8Array[]
    • attributeNames: Map<number, string[]>
    • OptionalbaseForSecretKey: Uint8Array
    • OptionalsecretKey: Uint8Array

    Returns number

  • Create a commitment to the blinded attributes.

    Parameters

    • encodedSubject: Map<number, Uint8Array>

      The blinded attributes in encoded (as a field element) form. The key of the map is the index of the attributes in the flattened attributes list

    • totalAttributes: number

      Total number of attributes (blinded and unblinded) in the credential

    • labelOrParams: undefined | Uint8Array | SigParams

      Signature params or the label to generate them.

    Returns Uint8Array

  • Enforce that the blinded attribute attributeName is inequal to the public value inEqualTo

    Parameters

    • attributeName: string
    • inEqualTo: any
    • OptionalparamId: string
    • Optionalparam: PederCommKeyUncompressed | PederCommKey

    Returns void

  • Parameters

    • credIdx: number
    • attributeName: string
    • inEqualTo: any
    • OptionalparamId: string
    • Optionalparam: PederCommKeyUncompressed | PederCommKey

    Returns void