Code Snippet
This section describes how we use the zkPass SDK in our demo code
Generate Proof
This code snippet generates a zkPass proof. It requires 3 parameters:
credentials
: Get yours API key and secret athttps://portal.ssi.id
user_data_tokens
: stringified signed users data.dvr_token
: signed Dvr query.
Verify Proof
This code snippet verifies a zkPass proof token. Components :
zkpass_proof_token
: check Generate Proof section for more details.expected_metadata
: this is the expected metadata of the dvr.zkvm
: zkvm used to generate proof, currently we only supportr0
.service_url
: you can usehttps://playground-zkpass.ssi.id
, or use your own endpoint if you deploy zkPass on your own server.
Generate User Data Token
This code snippet generate user data token. Components :
signing_key
: a private key used to sign user data.data
: user data in JSON format.verifying_key
: a public key to verify that user data token.
Generate DVR Token
This code snippet generate DVR token. Components :
signing_key
: a private key used to sign dvr.dvr_data
: Dvr data to sign.
Last updated