createProof
This function orchestrates all the API calls in sequence to generate a proof.1
Convert your digital asset/content
First, the digital asset is converted to a Base64 string.
2
Blind your Content
Call the
messageHashAPI function to hash the Base64-encoded message.3
Submit your Signing request
Use
commitAPI and pass the hash and public description to create a blinded signature.4
Make a ZK proof for Content
Retrieve a ZK challenge for the commitment signature using the
getChallengeAPI.5
Solve ZK challenge
Use the
solveChallengeAPI to solve the ZK challenge.6
Unblind the signature
Call the
unblindSignatureAPI to unblind the signature.7
Create verifiable signature
The self verifiable signature is returned as JSON.
1. fileToBase64
Purpose:
Converts a file into a base64-encoded string without the metadata portion (data:…). This is the first step before sending the file content to any API.messageHashAPI for hashing.
2. messageHashAPI
Purpose:
Hashes the base64-encoded file content by sending it to an API.3. commitAPI
Purpose:
Creates a blinded signature by sending the hashed message and a description to the API.4. getChallengeAPI
Purpose:
Requests a ZK challenge from the API using the blinded signature created earlier.5. solveChallengeAPI
Purpose:
Solves the ZK challenge using the challenge format returned by the previous step.6. unblindSignatureAPI
Purpose:
Unblinds the signature using the ZK challenge solution recieved.verifyProof
This function is used to verify the proof.1
Verify Signature
Pass the proof data to the verifySignatureAPI.
2
Return Result
Return the verification result.
verifySignatureAPI
Purpose:
Verifies the signature and returntrue/false.