Receipt Service
The Receipt Service validates attestations and maintains the ordered transparency log.
Purpose
- Validation: 7-phase atomic validation pipeline
- Merkle tree: Ordered, verifiable attestation log
- Receipts: Cryptographic proofs of inclusion
- Persistence: Durable attestation storage
7-Phase Validation
- Schema validation - Verify structure
- Epoch validation - Check current epoch
- Identity verification - Verify sidecar
- Co-epoch attestation - Cross-verify with witness
- Monotonic counter - Ensure ordering
- Merkle append - Add to tree atomically
- Persistence - Store and return proof
Submission Endpoint
const response = await fetch('https://receipts.glacis.io/api/v1/attestations', { method: 'POST', headers: { 'Authorization': 'Bearer wt_abc123...', 'Content-Type': 'application/json' }, body: JSON.stringify({ epochId: 'epoch_2024010112', level: 'L0', blindedId: 'base64...', requestCommitment: 'sha256...', signature: 'base64...' })});Receipt Response
{ "attestationId": "att_xyz789", "merkleProof": { "root": "0x...", "index": 1247, "siblings": ["0x...", "0x..."] }}Error Codes
| Code | Description |
|---|---|
EPOCH_EXPIRED | Attestation references old epoch |
IDENTITY_MISMATCH | Signature doesn’t match sidecar |
COUNTER_REPLAY | Monotonic counter violation |