Spectre.GAM.Secret.CheckoutReceipt (Spectre v0.4.0)

Copy Markdown View Source

Ephemeral proof that one Grant was consumed into a durable Attempt.

The receipt is minted only after ledger recovery confirms the Attempt. It is exact-bound to one broker and must be claimed once by that broker before any capability is released. Receipts are never ledger records or public results.

HMAC verification makes the broker part of the trusted host boundary: a physically isolated deployment must provision the dedicated receipt key only to the sequencer and its broker.

Summary

Functions

Verifies authenticity, exact binding and the half-open validity window.

Types

t()

@type t() :: %Spectre.GAM.Secret.CheckoutReceipt{
  act_ref: String.t(),
  attempt_ref: String.t(),
  broker_ref: String.t(),
  domain_ref: String.t(),
  executor_ref: String.t(),
  expires_at: pos_integer(),
  generation: non_neg_integer(),
  grant_nonce_digest: String.t(),
  issued_at: non_neg_integer(),
  ledger_revision: pos_integer(),
  mac: String.t(),
  material_digest: String.t()
}

Functions

verify(receipt, secret, expected)

@spec verify(t(), binary(), map()) :: :ok | {:error, term()}

Verifies authenticity, exact binding and the half-open validity window.