Getting Started
Authorization
All API requests require a bearer token in the header:
Authorization: Bearer <token>Zetrix DID Format
Example:
did:zid:0d48916e8b0f10297b023b680fb7ab2367d5eb03a1a6bb876d63d1a9f5677dcbTemplate Design Tips
Use
USERfields the holder fills in.Use
FIXEDfor fields the issuer controls.Use camelCase for keys (e.g.,
fullName)Specify field format (
STRING,NUMBER), and whether it ismandatory(true/false)
Sample VC Lifecycle
Let's walk through each stage step-by-step:
1. Template Flow (by Issuer)
Goal: Define the structure of a credential (schema).
Steps:
Submit Template Payload
Inputs:
signedTx,signerId,signerPublicKey(to authenticate/sign the template)Template metadata like
templateName,issuerDid,credentialFormat, etc.
API Call:
/cred/tds/template/blob/createBackend generates a
blobIdand ablobthat needs to be signed.
Submit signed blob
API:
/cred/tds/template/submitSigned blob is submitted to blockchain.
Output:
templateId,txHash
2. Apply VC Flow (by Holder)
Goal: A user (holder) applies for a credential based on a template.
Steps:
Submit Application
API:
/cred/v1/vc/applyInputs:
vcPayload: includestemplateId,metadata, and holder's public key/signature.
Backend Actions:
Validates the template.
Stores the VC application temporarily.
Output: VC ID and status (e.g.,
APPLIED)
3. Issue VC Flow (by Issuer)
Goal: Issuer issues a credential based on the holder’s application.
Steps:
Create VC Payload
API:
/cred/v1/vc/createInputs:
vcId,data,issuanceDate,expirationDateOutput:
ed25519Blob(data to be signed using Ed25519)bbsBlsBase64(data to be signed using BBS+ for selective disclosure)
Sign & Submit VC
API:
/cred/v1/vc/submitInputs:
ed25519PubKey,ed25519SignDatabbsBlsPubKey,bbsBlsSignDatakeyExpiry
Output: Full VC Object with proof(s)
Note: Both signature schemes (Ed25519 and BbsBls) are used to ensure W3C compliance and support for selective disclosure.
4. Download VC (by Holder/Issuer)
Goal: Download the VC before expiry.
Steps:
Submit Download Payload
API:
/cred/v1/vc/downloadInputs:
vcId,signVcId(signed value of VC ID),isIssuer(optional)
Backend fetches VC
Checks temporary storage and resolves DID document.
Returns full VC object.
5. Create VP (by Holder)
Goal: Holder creates a Verifiable Presentation (VP) to selectively share claims.
Steps:
Create VP Payload
API:
/cred/v1/vp/createInputs include selected claims and
rangeProofconditions (e.g., age > 18)
Backend generates
blobId+blobfor the holder to sign.Submit signed VP
API:
/cred/v1/vp/submitOutput: Verifiable Presentation (VP) object
6. Verify VP (by Verifier)
Goal: Verifier checks authenticity and integrity of the VP.
Steps:
Submit VP Payload
API:
/cred/v1/vp/verifyInput: Full VP object (with BbsBls signature, context)
Backend resolves DIDs
Verifier uses the DID of issuer and holder to check proof chain.
Returns: Verification result (valid/invalid)
Last updated