Credentials
Batch
A group of credentials signed and Merkle-anchored together in one LearnCoin issuance operation — economics of scale at the anchoring layer.
A batch is LearnCoin's unit of issuance. When a tenant calls POST /v1/batches with N credentials, LearnCoin queues them all, signs each one, builds a Merkle tree over the signatures, and writes a single anchor transaction to Base L2 with the Merkle root.
Batch size is a tenant decision. Some tenants issue one credential per batch — each completion triggers an immediate batch-of-1. Others aggregate — a university might batch a semester's diplomas into one nightly operation. Batch size affects cost per credential (one anchor tx amortizes over N credentials) and latency (small batches anchor faster; large batches are more cost-efficient).
A batch transitions through states: pending (queued), signing (KMS calls in flight), anchoring (on-chain tx submitted), anchored (tx confirmed), or failed (with reason). Tenants poll GET /v1/batches/<id> or subscribe to batch.anchored.v1 webhooks to track progress.
Idempotency keys (per the POST API) protect against duplicate batches from retries. Two requests with the same idempotency key return the same batch ID.
Related terms