Overview
Grantex publishes a W3C Decentralized Identifier (DID) document that enables any party to verify Grantex-issued Verifiable Credentials without contacting the Grantex API. The DID document contains the public keys used to sign VCs and is hosted at a well-known URL following thedid:web method.
did:web:grantex.dev
The Grantex DID follows the did:web method specification. The DIDdid:web:grantex.dev resolves to:
DID Document Structure
Verification Methods
The DID document contains two verification methods:| Key | Algorithm | Purpose |
|---|---|---|
key-1 | RS256 (RSA) | Primary signing key for grant tokens and VCs. Same key published in the JWKS endpoint. |
key-2 | Ed25519 | Secondary signing key for future use with EdDSA-based VCs. |
Relationship to JWKS
The RS256 key in the DID document is the same key available via the JWKS endpoint (/.well-known/jwks.json). The two endpoints serve different ecosystems:
| Endpoint | Format | Used by |
|---|---|---|
/.well-known/jwks.json | JSON Web Key Set | JWT libraries verifying grant tokens |
/.well-known/did.json | DID Document | VC libraries verifying Verifiable Credentials |
How Verification Works
When a verifier receives a Grantex-issued Verifiable Credential (VC-JWT), the verification process is:Example: Verifying Without the Grantex SDK
Any JWT library can verify Grantex VCs. Here is a minimal example usingjose (TypeScript) and PyJWT (Python):
Agent DIDs
Every agent registered in Grantex receives a DID in the formatdid:grantex:ag_XXXX. This DID serves as the agent’s cryptographic identity and appears in:
- The
agtclaim of grant tokens - The
credentialSubject.idfield of Verifiable Credentials - Audit log entries
Service Endpoints
The DID document declares two service endpoints:GrantexAuthService
The primary Grantex API endpoint. Verifiers can use this to access the token verification API, JWKS, and other endpoints.StatusList2021Service
The base URL for StatusList2021 credentials. Verifiers append the status list ID to check revocation.Self-Hosting
When self-hosting Grantex, the DID document is served from your own domain. Thedid:web method resolves based on the domain in the DID string:
| DID | Resolves to |
|---|---|
did:web:grantex.dev | https://grantex.dev/.well-known/did.json |
did:web:auth.example.com | https://auth.example.com/.well-known/did.json |
ISSUER_DID environment variable in your auth service deployment to set the DID that appears in issued VCs. The auth service automatically generates the DID document from the signing key.
W3C Standards Alignment
| Standard | Grantex Implementation |
|---|---|
| DID Core v1.0 | Full compliance for did:web method |
| did:web Method | /.well-known/did.json hosting |
| JsonWebKey2020 | Verification method format |
| VC Data Model v2.0 | Credential issuance and verification |
| StatusList2021 | Revocation checking |
API Reference
| Method | Endpoint | Auth | Description |
|---|---|---|---|
GET | /.well-known/did.json | None (public) | W3C DID document |
GET | /.well-known/jwks.json | None (public) | JSON Web Key Set (same RSA key) |
GET | /v1/credentials/status/:id | None (public) | StatusList2021 credential |
Next Steps
- Verifiable Credentials — issue and verify W3C VCs
- FIDO2 / WebAuthn — human presence verification
- Grant Token — the standard JWT-based grant token
- Token Verification — offline JWT verification via JWKS