Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
• new ZkPassApiKey(apiKey
, secretApiKey
): ZkPassApiKey
Parameters
Returns
• Readonly
apiKey: string
Unique identifier for accessing ZkPass services
• Readonly
secretApiKey: string
Acts like a password for apiKey
and must be kept confidential for secure communication with ZkPass servers
▸ getApiToken(): string
Returns
string
This class is typically created by the Proof Verifier client, and the DVR represents a request to verify certain attributes or properties of a user data.
Parameters
Returns
• dvrId: string
The unique id of the DVR
• dvrTitle: string
The title of the DVR
The verifying key of the DVR
The zkPass Query script
• queryEngineVer: string
The version of the zkpass query engine used to create the DVR
• queryMethodVer: string
The version of the zkpass query method used to create the DVR
An object containing one or more user data verifying key and url for the respective user data provided
• zkVm: string
The option of zkVM. We're planning to support multiple zkVMs.
This field could be filled with r0
▸ getSha256Digest(): string
Returns the DVR's SHA256 digest
Returns
string
▸ serialize(): string
Serializes the DVR into JSON string format
Returns
string
▸ serializeJson(): Object
Serializes the DVR into JSON object
Returns
Object
▸ signToJwsToken(pem
, verifyingKeyJWKS?
): Promise
<string
>
Signs the DVR into JWS token
Parameters
Returns
Promise
<string
>
▸ deserialize(json
): DataVerificationRequest
Deserializes JSON string into DVR object
Parameters
Returns
▸ fromJSON(«destructured»
): DataVerificationRequest
Deserializes JSON object into DVR object
Parameters
Returns
The main class which implements all of the traits defined in this module.
Parameters
Returns
Overrides
• Private
Readonly
zkPassServiceUrl: string
Containing the URL address of the ZkPass service
Representing a pair of keys (apiKey and secretApiKey) used for accessing ZkPass services securely.
• Private
Readonly
zkVm: string
Representing the user's chosen virtual machine (VM) for interacting with ZkPass services. Currently only support for r0
Decrypts a JWT token
Parameters
Returns
Implementation of
▸ encryptDataToJweToken(key
, data
): Promise
<string
>
Encrypts data into a JWE token
Parameters
Returns
Promise
<string
>
Implementation of
▸ generateZkPassProof(userDataToken
, dvrToken
): Promise
<string
>
Generates a ZkPass proof.
This function calls the corresponding RESTful API provided by the zkPass Service, where the query in the DVR is processed and the proof is generated. It encrypts both the signed user data token and the signed DVR token prior to sending it to the zkPass Service.
This function is asynchronous and must be awaited. It’s designed to be used in asynchronous contexts, for example within async functions or blocks.
Parameters
Returns
Promise
<string
>
Implementation of
▸ getApiToken(): string
Retrieves the API base64 token from the API key and API secret
Returns
string
Returns the query engine and method version information
Returns
Implementation of
▸ signDataToJwsToken(signingKey
, data
, verifyingKeyJwks?
): Promise
<string
>
Signs data into a JWS token
Parameters
Returns
Promise
<string
>
Implementation of
Verifies the signature of a JWS token
Parameters
Returns
Implementation of
Parameters
Returns
Overrides
Get the FFI Wrapper for zkVm
Returns
Asynchronously fetches and verifies public keys for service signing and encryption from a remote JWKS endpoint.
Returns
▸ getEncryptionKey(): Promise
<string
>
Returns
Promise
<string
>
▸ getVerifyingKey(): Promise
<string
>
Returns
Promise
<string
>
Name | Type |
---|---|
• new DataVerificationRequest(dvrTitle
, dvrId
, queryEngineVer
, queryMethodVer
, query
, userDataRequests
, dvrVerifyingKey?
):
Name | Type |
---|
• Optional
dvrVerifyingKey:
• query:
• userDataRequests:
Name | Type |
---|
Name | Type |
---|
Name | Type |
---|
• new ZkPassClient(zkPassServiceUrl
, zkPassApiKey
, zkVm
):
Name | Type |
---|
• Private
Optional
Readonly
zkPassApiKey:
▸ decryptJweToken(key
, jweToken
): Promise
<>
Name | Type |
---|
Promise
<>
Name | Type |
---|
Name | Type |
---|
▸ getQueryEngineVersionInfo(): Promise
<>
Promise
<>
Name | Type |
---|
▸ verifyJwsToken(key
, jwsToken
): Promise
<>
Name | Type |
---|
Promise
<>
▸ verifyZkPassProofInternal(zkPassProofToken
): Promise
<>
Name | Type |
---|
Promise
<>
▸ Private
getFfiWrapper():
▸ getKeys(): Promise
<>
Promise
<>
Asynchronously retrieves the service encryption public key from the function
Asynchronously retrieves the service verifying public key from the function
string
string
|
|
|
|
|
|
|
|
| { [tag: |
|
|
|
|
|
|
|
|
Logical operators used within DVR query
Ƭ LogicalOperators: "and"
| "or"
Logical operators composing nested ZkPassQueries
Ƭ MultipleOperator: { [operator in LogicalOperators]?: ZkPassQuery[] }
A mapping containing multiple UserDataRequest
string]
: UserDataRequest
Key and value pair, where the key indicates the key to the respective user data, and the value is in the form of UserDataRequest which contains the verifying key and URL of the user data.
Primitive data types
Ƭ Primitive: boolean
| number
| string
| object
Provides alternative ways to represent a public key
Either the PublicKey
or the KeysetEndpoint
can be used as a public key. This is useful for sites which do not support JWKS and opts to provide the public key using PublicKey
directly.
Ƭ PublicKeyOption: PublicKeyWrapped
| KeysetEndpointWrapped
The value returned by verifyZkProof method
Ƭ ZkPassOutput: [key: string]: string | number | boolean;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Defines a function for generating zkPass Proof
generateZkPassProof
▸ generateZkPassProof(userDataTokens
, dvrToken
): Promise
<string
>
Parameters
Returns
Promise
<string
>g
zkPassQueryFfiR0
• new ZkPassFfiR0(): ZkPassFfiR0
Returns
• Private
zkPassQueryFfiR0: Object
Type declaration
▸ getQueryEngineVersion(): string
Returns
string
▸ getQueryMethodVersion(): string
Returns
string
▸ verifyZkProof(receipt
): Omit
<ZkPassOutput
>
Parameters
Returns
Omit
<ZkPassOutput
>
• new UserDataRequests(user_data_verifying_key
, user_data_url?
): UserDataRequest
user_data_url
Parameters
Returns
• user_data_verifying_key: PublicKeyOption
The public key information used to verify the signature of the user data.
• Optional
user_data_url: string
The url to retrieve the user data referenced by the query.
Defines functions for proof verification
• new ZkPassProofVerifier(): ZkPassProofVerifier
Returns
▸ getQueryEngineVersionInfo(): Promise
<QueryEngineVersionInfo
>
Returns the query engine and method version information
Returns
Promise
<QueryEngineVersionInfo
>
▸ verifyZkPassProof(zkPassProofToken
, validator
): Promise
<VerifyZkPassProofResult
>
Verifies a zkPass Proof
Parameters
Returns
Promise
<VerifyZkPassProofResult
>
▸ verifyZkPassProofInternal(zkPassProofToken
): Promise
<VerifyZkPassProofResult
>
Parameters
Returns
Promise
<VerifyZkPassProofResult
>
Defines functions for digital signature and encryption
▸ decryptJweToken(key
, jweToken
): Promise
<JWTDecryptResult
>
Decrypts a JWT token
Parameters
Returns
Promise
<JWTDecryptResult
>
▸ encryptDataToJweToken(key
, data
): Promise
<string
>
Encrypts data into a JWE token
Parameters
Returns
Promise
<string
>
▸ signDataToJwsToken(signingKey
, data
, verifyingKeyJwks?
): Promise
<string
>
Signs data into a JWS token
Parameters
Returns
Promise
<string
>
▸ verifyJwsToken(key
, jwsToken
): Promise
<JWTVerifyResult
>
Verifies the signature of a JWS token
Parameters
Returns
Promise
<JWTVerifyResult
>
▸ getEncryptionKey(): Promise
<string
>
Asynchronously retrieves the service encryption public key from the getKeys
function
Returns
Promise
<string
>
▸ getVerifyingKey(): Promise
<string
>
Asynchronously retrieves the service verifying public key from the getKeys
function
Returns
Promise
<string
>
Defines a callback function for post-ZKP metadata validation on the DVR.
▸ validate(dvrId
): Promise
<MetadataValidatorResult
>
Validates the metadata of a DVR
Parameters
Returns
Promise
<MetadataValidatorResult
>
Defines functions for proof verification
• new ZkPassFfi(): ZkPassFfi
Returns
▸ abstract
getQueryEngineVersion(): string
Returns the query engine version information
Returns
string
▸ abstract
getQueryMethodVersion(): string
Returns the query method version information
Returns
string
▸ catchError<T
>(«destructured»
): T
Type parameters
Parameters
Returns
T
▸ abstract
verifyZkProof(receipt
): <ZkPassOutput
>
Verifies a zkPass Proof
Parameters
Returns
A wrapped version of KeysetEndpoint
Ƭ KeysetEndpointWrapped: Object
Type declaration
Represents a JWKS (JSON Web Key Set) end point
Ƭ KeysetEndpoint: Object
Type declaration
Comparison operators used within DVR query
Ƭ ComparisonOperators: "=="
| "!="
| "<"
| "<="
| ">"
| ">="
| "~=="
| "~!="
Operators used within DVR query
The operators include:
The result of Metadata Validator
Ƭ MetadataValidatorResult: Object
Type declaration
Proof contents payload
Ƭ ProofPayload: Object
Type declaration
Represents a public key
Ƭ PublicKey: Object
Type declaration
Represents the query engine and method version information
Ƭ QueryEngineVersionInfo: Object
Type declaration
A wrapped version of PublicKey
Ƭ PublicKeyWrapped: Object
Type declaration
Ƭ VerifyZkPassProofResult: Object
Type declaration
Contains the result of a zkPass query
Ƭ ProofMethodOutput: Object
Type declaration
The value returned by the generate_zkpass_proof API of the zkPass Service
Ƭ ZkPassProof: Object
Type declaration
Represents service signing and encryption public keys as strings.
Ƭ Keys: Object
| string
?
?
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name |
---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type | Description |
---|---|---|
Operator | Description |
---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type | Description |
---|
Name | Type | Description |
---|
Name | Type |
---|
Name | Type |
---|
Name | Type | Description |
---|
Name | Type | Description |
---|
Name | Type |
---|
Ƭ ZkPassQuery: |
Name | Type | Description |
---|
userDataTokens
{ [tag: string
]: string
}
dvrToken
string
get_query_engine_version_wrapper
ForeignFunction
<any
, []>
get_query_method_version_wrapper
ForeignFunction
<any
, []>
verify_zkproof_wrapper
ForeignFunction
<any
, [null
| string
]>
receipt
string
string?
zkPassProofToken
string
validator
zkPassProofToken
string
key
string
jweToken
string
key
string
data
signingKey
string
data
verifyingKeyJwks?
key
string
jwsToken
string
dvrId
string
T
«destructured»
GenericResponse
<T
>
receipt
string
KeysetEndpoint
jku
string
The url of the end point
kid
string
The key to locate the public key
==
Equals
!=
Not Equals
<
Less than
<=
Less than equals
>
Greater than
>=
Greater than equals
~==
Equals case-insensitive
~!=
Not equals case-insensitive
expectedDvr
expectedTtl
number
expectedVerifyingDvrKey
data
{ dvr_digest
: string
; dvr_id
: string
; dvr_title
: string
; dvr_verifying_key
: PublicKey
| KeysetEndpoint
; time_stamp
: number
; user_data_verifying_key
: PublicKey
| KeysetEndpoint
; zkproof
: string
}
data.dvr_digest
string
data.dvr_id
string
data.dvr_title
string
data.dvr_verifying_key
data.time_stamp
number
data.user_data_verifying_key
data.zkproof
string
|
|
|
|
|
|
|
| Query engine version |
|
| Query method version |
|
|
|
|
|
|
| Public key used by zkpass service to SIGN PAYLOADS |
|
| Public key used by zkpass service to ENCRYPT PAYLOAD |
Errors for DVR Digest mismatch
MismatchedDvrDigest
• new MismatchedDvrDigest(): MismatchedDvrDigest
Returns
MismatchedDvrDigest
Overrides
Errors for missing root data elements
MissingRootDataElementError
• new MissingRootDataElementError(): MissingRootDataElementError
Returns
MissingRootDataElementError
Overrides
Errors for DVR ID mismatch
MismatchedDvrId
• new MismatchedDvrId(): MismatchedDvrId
Returns
MismatchedDvrId
Overrides
Errors for DVR Title mismatch
MismatchedDvrTitle
• new MismatchedDvrTitle(): MismatchedDvrTitle
Returns
MismatchedDvrTitle
Overrides
Errors for Invalid public key
InvalidPublicKey
• new InvalidPublicKey(): InvalidPublicKey
Returns
InvalidPublicKey
Overrides
Errors for User Data Verifying Key mismatch
MismatchedUserDataVerifyingKey
• new MismatchedUserDataVerifyingKey(): MismatchedUserDataVerifyingKey
Returns
MismatchedUserDataVerifyingKey
Overrides
Errors for no implementation
NotImplementedError
• new NotImplementedError(): NotImplementedError
Returns
NotImplementedError
Overrides
Errors for DVR Verifying Key mismatch
MismatchedDvrVerifyingKey
• new MismatchedDvrVerifyingKey(): MismatchedDvrVerifyingKey
Returns
MismatchedDvrVerifyingKey
Overrides
|
|
|
|
| The hash digest of the DVR |
|
| The unique id of the DVR |
|
| The title of the DVR |
| The public key actually used by the zkPass Service to verify the signature of the DVR |
|
| The time stamp of the ZkPassProof as created by the zkPass Service |
| The public key actually used by the zkPass Service to verify the signature of the user data |
|
| The Cryptographic data blob which contains the ZK Proof |
Errors related to JOSE exceptions
JoseError
• new JoseError(message?
): JoseError
Parameters
Returns
JoseError
Inherited from
Name | Type |
---|---|
message?
string
Comparison operators comparing fields and values
Ƭ SingleOperator: { [operator in ComparisonOperators]?: [string, string | number] }
MissingApiKey
• new MissingApiKey(): MissingApiKey
Returns
MissingApiKey
Overrides