# Proof

How every payment gets a signed, hash-chained receipt anchored on Solana, and how anyone can run the four checks without an account.

<ShortProductTruth>**Don't trust the log. Check the receipt.** Every payment gets a receipt that is canonical, hashed, signed, chained to the previous one and anchored on Solana, and anyone with the link can check it.</ShortProductTruth>


## The problem it removes [#the-problem-it-removes]

A payment history kept only in the payment provider's database is only as trustworthy as that database. Abazi Proof makes each record checkable from outside: change one character and the hash fails, remove a receipt and the chain breaks, and the anchor on Solana fixes the hash in time where Abazi cannot rewrite it.

## Who uses it [#who-uses-it]

| Who | How |
| --- | --- |
| Owners and finance | Open any payment's receipt, with its hash, signature, chain position and anchor. |
| Auditors and counterparties | Run the four checks on the public verify page, without an account. |
| Developers | Fetch the public signing keys and verify receipts in their own code. |

## How it works [#how-it-works]

1. **Build.** On confirmation Abazi writes the receipt body: what was bought, from whom, under which mandate version, the decision, the approver if any, amount, asset, network, rail, payee and settlement reference.
2. **Canonicalize and hash.** The body is serialized as canonical JSON (RFC 8785) and hashed with SHA-256.
3. **Sign.** The hash is signed with Ed25519. The public keys are published at `/.well-known/uapg-receipt-keys.json`, each with its key id.
4. **Chain.** Each organization has one chain: every receipt carries a sequence number and the previous receipt's hash. The first one points at 64 zeros.
5. **Anchor.** The hash is written to Solana in a memo transaction, `uapg:v1:` followed by the hash. The anchor is pending until that transaction is finalized.

Receipts exist for payments, refunds, installments, sweeps and revocations. A refund receipt links to the payment it reverses.

## The four checks [#the-four-checks]

| Check | Passes when |
| --- | --- |
| Hash | The SHA-256 of the canonical body equals the stated hash. |
| Signature | The Ed25519 signature verifies over the recomputed hash, against the published key with that key id. |
| Chain link | The previous-hash field equals the hash of the organization's previous receipt. |
| On-chain anchor | The memo transaction is finalized and carries this receipt's hash. Until then it reads PENDING. |

The public receipt leaves out the agent's stated purpose. See [Receipts and proof](/docs/concepts/receipts-and-proof) for the full format.

## Screens [#screens]

<Screenshot id="console-receipt-detail" />

<Screenshot id="public-verify" />

## Boundaries [#boundaries]

| Case | What happens |
| --- | --- |
| One character of the body was changed | Hash, Signature and Anchor fail: the signature and the on-chain memo are checked against the recomputed hash. Chain link still passes. |
| The key id is unknown or the signature was replaced | Signature fails. |
| A receipt was removed or reordered | Chain link fails. |
| The memo is not final yet | Anchor reads PENDING; check again later. |

Receipts are append-only. Anchor status is stored beside the receipt, never written into it. Proof records payments; it never decides them.

## API [#api]

The Receipts operations in the API reference, each with its parameters, responses and code samples:

<ApiOperationList ids={['listReceipts', 'getReceipt', 'verifyReceipt', 'verifyReceiptDocument']} />

## Next steps [#next-steps]

<Cards>
  <Card title="Verify a receipt" href="/docs/guides/verify-a-receipt" description="Run the four checks yourself on a receipt link." />
  <Card title="Receipts and proof" href="/docs/concepts/receipts-and-proof" description="Read the receipt format and try a tampered example." />
  <Card title="Ledger" href="/docs/products/ledger" description="See the balanced entries recorded beside each receipt." />
</Cards>

