Class ReceiptHashes

java.lang.Object
io.jans.lock.trace.crypto.bc.ReceiptHashes

public final class ReceiptHashes extends Object
The receipt-hash function of the receipt chain (design ยง9):
 receiptHash = "sha256:" + hex(SHA-256(JCS({
     "receipt_profile":    "tag:jans.io,2026:lock-trace-receipt-v1",
     "evidence_domain_id": domainId,
     "receipt_sequence":   receiptSequence,   // JSON integer
     "received_at":        receivedAt,        // JSON string, RFC 3339 UTC, 3 fraction digits
     "producer_id":        producerId,
     "record_id":          recordId,
     "content_digest":     contentDigest,
     "prev_receipt_hash":  prevReceiptHash
 })))
 
Member order above does not matter to the result: JCS (RFC 8785) sorts object members by key before serializing, so any verifier that builds the same eight members reproduces the same hash regardless of construction order.
Author:
Yuriy Movchan
  • Method Details

    • receiptHash

      public static String receiptHash(String domainId, long receiptSequence, long receivedAtMs, String producerId, String recordId, String contentDigest, String prevReceiptHash)
      Returns:
      the "sha256:<64 hex>" receipt hash for one receipt-chain position