# AB5D contribution receipts

Schema: `ab5d-contribution-receipt/1`

A contribution receipt is the machine-readable acceptance record for work incorporated into AB5D.
It binds four things into one SHA-256 digest:

1. the contributor and AI-authorship provenance embedded in the accepted work,
2. the exact accepted files and their SHA-256 hashes,
3. the complete mechanical verifier result,
4. the `$AB5D` payment transaction, once the treasury has executed it.

Receipts are published at `/api/receipts/<subject>.json`; the index is `/api/receipts.json`.

## Integrity

To reproduce `integrity.digest`, remove the top-level `integrity` object, serialize the remaining
JSON with keys sorted and no insignificant whitespace, encode it as UTF-8, then calculate SHA-256.
The hashes in `artifacts` can be checked independently against the corresponding public files.

`attestation.type=published-integrity-record` means publication by AB5D records acceptance but is
not a cryptographic signature by the contributor or treasury. When `payment.tx_hash` is present,
the transfer is independently verifiable on Ethereum. A later schema may add wallet signatures
without changing the meaning of this version.

## Creation

The maintainer creates a receipt only after the dossier verifier accepts the work:

```text
python3 scripts/make_receipt.py <slug> --accepted-by ab500dao.eth --write
```

After the Safe pays a bounty, regenerate it with `--payment-amount` and `--payment-tx`. The script
updates both the individual receipt and the receipt index atomically.
