What You’ll Learn
- How to select and customize a credential template
- How to validate credentials against JSON schemas
- How to sign credentials with the CLI or SDK
- How to verify credential signatures
Prerequisites
Before starting, ensure you have the following installed:Required
- Node.js 18+ - Install Node.js
- Git - For cloning the beltic-spec repository
Choose Your Path
CLI Path
Use the Beltic CLI for signing and verification
SDK Path
Use the TypeScript SDK for programmatic workflows
CLI Prerequisites
Install the Beltic CLI:SDK Prerequisites
Install the TypeScript SDK:Validator (Both Paths)
Choose one JSON Schema validator: Option 1: AJV CLIStep 1: Get the Spec Repository
Clone the beltic-spec repository for schemas and templates:Step 2: Pick a Template
Choose a template based on your use case:DeveloperCredential Templates
Located inexamples/developer/v1/tests/:
valid-individual-minimal.json- Solo developer, basic verificationvalid-individual-complete.json- Individual with full KYBvalid-organization-tier1.json- Startup, basic organization infovalid-organization-tier2-complete.json- Established company with enhanced KYB
AgentCredential Templates
Located inexamples/agent/v1/tests/:
valid-simple-agent.json- Basic agent with minimal fieldsvalid-complex-agent.json- Full-featured agent with all optional fields
Step 3: Copy and Customize
Copy your chosen template and edit the key fields:my-dev-cred.json and update:
credentialId- Generate a new UUIDlegalName- Your legal name or business nameentityType-"individual"or"organization"subjectDid- Your DID (e.g.,did:web:example.comordid:key:...)issuerDid- Issuer’s DIDissuanceDate- Current date in ISO 8601 formatexpirationDate- Expiration date (typically 6-12 months from issuance)
Step 4: Validate the Credential
Validate your credential against the JSON schema before signing:Using AJV CLI
Using Python
Using npm Scripts
CLI Path
Step 5: Generate Keys
Generate a keypair for signing:Step 6: Sign the Credential
Sign your credential to create a JWS token:Step 7: Verify the Credential
Verify the signature and schema:SDK Path
Step 5: Validate with SDK
Step 6: Sign with External Library
The@belticlabs/kya SDK focuses on validation and HTTP signatures. For signing credentials, use the CLI or a JWT library like jose:
Step 7: Verify with SDK
Troubleshooting
Issue: “command not found: beltic”
Cause: The CLI binary is not in your PATH. Solution:Issue: “Schema validation failed: data must have required property ‘legalName’”
Cause: Required field is missing from your credential. Solution: Check that all required fields are present. For DeveloperCredential, required fields include:credentialId,legalName,entityType,incorporationJurisdiction,businessRegistrationStatus,taxIdExists,kybTier,sanctionsScreeningStatus,overallRiskRating,issuanceDate,expirationDate,issuerDid,subjectDid,credentialStatus
Issue: “Invalid signature”
Cause: The public key doesn’t match the private key used for signing, or the credential was modified after signing. Solution:- Ensure you’re using the matching public key file (
.pub.pemfor the private key) - Don’t modify the token after signing
- Regenerate the token if you’ve changed the credential
Issue: “Module ‘@belticlabs/kya’ not found”
Cause: The SDK is not installed. Solution:Issue: “Date ordering violation: issuanceDate must be before expirationDate”
Cause: The credential dates are in the wrong order or in an invalid format. Solution:- Ensure dates are in ISO 8601 format:
YYYY-MM-DDTHH:mm:ssZ - Verify
issuanceDate < expirationDate - Ensure
expirationDateis in the future
Next Steps
Congratulations! You’ve issued and verified your first Beltic credential. Here’s what to explore next:Core Concepts
Learn about VCs, DIDs, and trust chains
CLI Workflows
Complete CLI guide including fingerprinting
SDK Guide
Programmatic credential workflows with TypeScript
DeveloperCredential
Deep dive into developer identity verification
AgentCredential
Technical profile and safety scores
Examples
Complete workflows and real-world scenarios
Additional Resources
- CLI Installation - Detailed CLI installation guide
- Validation Guide - Detailed validation reference