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
Name | Type |
---|---|
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
• new UserDataRequests(user_data_verifying_key
, user_data_url?
): UserDataRequest
user_data_url
Parameters
Name | Type |
---|---|
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.
string
string
string?
Logical operators used within DVR query
Ƭ LogicalOperators: "and"
| "or"
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.
• new DataVerificationRequest(dvrTitle
, dvrId
, queryEngineVer
, queryMethodVer
, query
, userDataRequests
, dvrVerifyingKey?
): DataVerificationRequest
Parameters
Returns
• dvrId: string
The unique id of the DVR
• dvrTitle: string
The title of the DVR
• Optional
dvrVerifyingKey: PublicKeyOption
The verifying key of the DVR
• query: ZkpassQuery
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
• userDataRequests: UserDataRequests
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
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
>
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
>
The main class which implements all of the traits defined in this module.
• new ZkPassClient(zkPassServiceUrl
, zkPassApiKey
, zkVm
): ZkPassClient
Parameters
Returns
Overrides
ZkPassProofVerifier.constructor
• Private
Readonly
zkPassServiceUrl: string
Containing the URL address of the ZkPass service
• Private
Optional
Readonly
zkPassApiKey: ZkPassApiKey
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
▸ decryptJweToken(key
, jweToken
): Promise
<JWTDecryptResult
>
Decrypts a JWT token
Parameters
Returns
Promise
<JWTDecryptResult
>
Implementation of
▸ encryptDataToJweToken(key
, data
): Promise
<string
>
Encrypts data into a JWE token
Parameters
Returns
Promise
<string
>
Implementation of
ZkPassUtility.encryptDataToJweToken
▸ 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
ZkPassProofGenerator.generateZkPassProof
▸ getApiToken(): string
Retrieves the API base64 token from the API key and API secret
Returns
string
▸ getQueryEngineVersionInfo(): Promise
<QueryEngineVersionInfo
>
Returns the query engine and method version information
Returns
Promise
<QueryEngineVersionInfo
>
Implementation of
ZkPassProofVerifier.getQueryEngineVersionInfo
▸ signDataToJwsToken(signingKey
, data
, verifyingKeyJwks?
): Promise
<string
>
Signs data into a JWS token
Parameters
Returns
Promise
<string
>
Implementation of
ZkPassUtility.signDataToJwsToken
▸ verifyJwsToken(key
, jwsToken
): Promise
<JWTVerifyResult
>
Verifies the signature of a JWS token
Parameters
Returns
Promise
<JWTVerifyResult
>
Implementation of
▸ verifyZkPassProofInternal(zkPassProofToken
): Promise
<VerifyZkPassProofResult
>
Parameters
Returns
Promise
<VerifyzkPassProofResult
>
Overrides
ZkPassProofVerifier.verifyZkPassProofInternal
▸ Private
getFfiWrapper(): ZkPassFfiR0
Get the FFI Wrapper for zkVm
Returns
▸ getKeys(): Promise
<Keys
>
Asynchronously fetches and verifies public keys for service signing and encryption from a remote JWKS endpoint.
Returns
Promise
<Keys
>
▸ 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 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
>
Comparison operators used within DVR query
Ƭ ComparisonOperators: "=="
| "!="
| "<"
| "<="
| ">"
| ">="
| "~=="
| "~!="
Operators used within DVR query
The operators include:
Operator | Description |
---|
Defines functions for proof verification
• new 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
Verifies a zkPass Proof
Parameters
Returns
Represents a JWKS (JSON Web Key Set) end point
Ƭ KeysetEndpoint: Object
Type declaration
Name | Type | Description |
---|
A wrapped version of KeysetEndpoint
Ƭ KeysetEndpointWrapped: Object
Type declaration
Name | Type |
---|
The result of Metadata Validator
Ƭ MetadataValidatorResult: Object
Type declaration
Name | Type |
---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type |
---|---|
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 |
---|
▸ abstract
verifyZkProof(receipt
): <>
Name | Type |
---|
<>
string
string
string
string
string
ZkpassQuery
| string
pem
string
verifyingKeyJWKS?
json
string
«destructured»
any
get_query_engine_version_wrapper
ForeignFunction
<any
, []>
get_query_method_version_wrapper
ForeignFunction
<any
, []>
verify_zkproof_wrapper
ForeignFunction
<any
, [null
| string
]>
receipt
string
zkPassProofToken
string
validator
zkPassProofToken
string
string
string
key
string
jweToken
string
key
string
data
userDataToken
{ [tag: string
]: string
}
dvrToken
string
signingKey
string
data
verifyingKeyJwks?
key
string
jwsToken
string
zkPassProofToken
string
key
string
jweToken
string
key
string
data
signingKey
string
data
verifyingKeyJwks?
key
string
jwsToken
string
| Equals |
| Not Equals |
| Less than |
| Less than equals |
| Greater than |
| Greater than equals |
| Equals case-insensitive |
| Not equals case-insensitive |
|
|
|
|
|
|
| The url of the end point |
|
| The key to locate the public key |
|
|
| { [tag: |
|
|
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
Logical operators composing nested ZkPassQueries
Ƭ MultipleOperator: { [operator in LogicalOperators]?: ZkPassQuery[] }
Primitive data types
Ƭ Primitive: boolean
| number
| string
| object
The value returned by verifyZkProof method
Ƭ ZkPassOutput: [key: string]: string | number | boolean;
|
|
|
|
|
Proof contents payload
Ƭ ProofPayload: Object
Type declaration
Name | Type |
---|---|
Contains the result of a zkPass query
Ƭ ProofMethodOutput: Object
Type declaration
Name | Type | Description |
---|---|---|
Represents a public key
Ƭ PublicKey: Object
Type declaration
Name | Type | Description |
---|---|---|
Represents the query engine and method version information
Ƭ QueryEngineVersionInfo: Object
Type declaration
Name | Type | Description |
---|---|---|
A wrapped version of PublicKey
Ƭ PublicKeyWrapped: Object
Type declaration
Name | Type |
---|
Ƭ ZkPassQuery: |
Comparison operators comparing fields and values
Ƭ SingleOperator: { [operator in ]?: [string, string | number] }
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
result
boolean
result
is a boolean value for the result of the query
x
string
x
represents the x parameter of the public key.
y
string
y
represents the y parameter of the public key.
queryEngineVersion
string
Query engine version
queryMethodVersion
string
Query method version
Errors for ZkPass Proof expiration
ExpiredZkPassProof
• new ExpiredZkPassProof(): ExpiredZkPassProof
Returns
ExpiredZkPassProof
Overrides
Errors for DVR Digest mismatch
MismatchedDvrDigest
• new MismatchedDvrDigest(): MismatchedDvrDigest
Returns
MismatchedDvrDigest
Overrides
|
The value returned by the generate_zkpass_proof API of the zkPass Service
Ƭ ZkPassProof: Object
Type declaration
Name | Type | Description |
---|---|---|
Errors related to JOSE exceptions
JoseError
• new JoseError(message?
): JoseError
Parameters
Name | Type |
---|---|
Returns
JoseError
Inherited from
Represents service signing and encryption public keys as strings.
Ƭ Keys: Object
Name | Type | Description |
---|
dvrDigest
string
The hash digest of the DVR
dvrId
string
The unique id of the DVR
dvrTitle
string
The title of the DVR
dvrVerifyingKey
The public key actually used by the zkPass Service to verify the signature of the DVR
timeStamp
number
The time stamp of the ZkPassProof as created by the zkPass Service
userDataVerifyingKey
The public key actually used by the zkPass Service to verify the signature of the user data
zkProof
string
The Cryptographic data blob which contains the ZK Proof
message?
string
|
| Public key used by zkpass service to SIGN PAYLOADS |
|
| Public key used by zkpass service to ENCRYPT PAYLOAD |
|
|
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 User Data Verifying Key mismatch
MismatchedUserDataVerifyingKey
• new MismatchedUserDataVerifyingKey(): MismatchedUserDataVerifyingKey
Returns
MismatchedUserDataVerifyingKey
Overrides
Ƭ VerifyZkPassProofResult: Object
Type declaration
Name | Type |
---|---|
output
zkPassProof
Errors for DVR Verifying Key mismatch
MismatchedDvrVerifyingKey
• new MismatchedDvrVerifyingKey(): MismatchedDvrVerifyingKey
Returns
MismatchedDvrVerifyingKey
Overrides