The storage layers
The credential itself is never written to the chain in readable form.
The envelope
The issuer encrypts the complete signed credential to the user’s encryption key before it leaves the issuer’s service:- It creates a one-time X25519 key pair for this credential.
- It combines the one-time private key with the user’s public X25519 key (key agreement) to get a shared secret, then derives a 256-bit key from it with HKDF-SHA256.
- It encrypts the credential with AES-256-GCM, which also produces a tag that detects any tampering.
The user decrypts by combining their X25519 private key with
encryptedKey, deriving the same AES key, and checking the tag. SD-JWT and Iden3 credentials use the same envelope.
From issuer to storage
- The issuer calls AIR’s DStorage API with the envelope, authenticated by a Partner JWT with the
issuescope. The issuer never talks to storage providers directly. - AIR writes the envelope as a storage object on Moca Chain Storage Providers, which offer an S3-style object API.
- AIR returns a storage path right away (
201), such asdstorage://vc/…, and adds the credential to its index. The bytes can be read immediately. - The primary provider stores the payload, and secondary providers in its virtual group receive replicas. Each one computes an integrity hash and signs it.
- The object is sealed on Moca Chain in the background. The primary provider submits the signed integrity hashes, and validators record the object’s metadata by consensus. Poll
GET /dstorage/vcs/status?path=<storagePath>untilstatusisSTOREDif you need to confirm it.
How availability is enforced
Validators and challenger nodes regularly challenge storage providers to prove they still hold the data they sealed. A provider that cannot answer, or that leaves the network without handing over its data, loses part of its stake. Storage providers join through a governance vote and must stake to operate.How a credential is retrieved
AIR answers discovery from its index, using only the cleartext metadata. The envelope travels to the user’s device still encrypted, and is decrypted there.Retention and deletion
- Revoking a credential does not delete it from storage. It marks it invalid.
- On-chain metadata is permanent and may remain linkable to a user even after an account is deleted.
- Copies of claims already disclosed to verifiers are outside AIR’s control.
Related
- Moca Chain storage providers for provider internals
- Keys & cryptography for exact algorithms and parameters
- Issuance API reference for the DStorage API fields