Skip to main content
Every time a payment is released on Aven, the Stream Contract calls the Attestation Contract to mint a permanent, immutable record on the Stellar ledger. These records — called attestations — prove that a specific worker completed a specific amount of verified work on a specific stream. Because they live on-chain, they cannot be edited or deleted by any party, including Aven.

Purpose

Attestations serve two purposes:
  1. Proof of delivery — each attestation captures the evidence hash of the verifier’s work report, the active seconds recorded by the CLI, the exact amount paid, and whether the employer explicitly confirmed the work.
  2. Reputation input — StreamCompletion attestations (one per fully-paid stream) are read by the Reputation Contract to compute a worker’s portable score.
Two attestation records are minted per payment release when the stream is fully paid out: one WorkSession record for the individual session and one StreamCompletion record used for reputation scoring.

AttestationRecord

Every minted attestation is stored as an AttestationRecord with the following fields:

AttestationKind


Public Entrypoints

mint_attestation

Mints a new AttestationRecord and indexes it by recipient and sender.
You do not call mint_attestation directly. The contract enforces that only the registered Stream Contract address can call it — any other caller receives Error 3: Unauthorized. Aven calls it automatically when withdraw_approved succeeds.
The contract validates:
  • Only the registered Stream Contract (caller must match) can mint.
  • amount_paid must be greater than 0.
  • period_start_ledger must not exceed period_end_ledger.
  • Title must not exceed 80 bytes.
  • WorkSession records must include a non-empty request_id, non-zero active_duration_seconds, a verifier address, and a report_hash.
  • Duplicate prevention: a second WorkSession or LegacyReviewed record with the same (stream_id, request_id) pair is rejected with Error 10: DuplicateAttestation. Similarly, only one StreamCompletion record per stream is permitted.

get_attestation

Returns the full AttestationRecord for a given attestation ID.
Returns Error 4: AttestationNotFound if the ID does not exist.

get_recipient_attestations

Returns a list of attestation IDs for a given recipient address.
Returns an empty list if the address has no attestations. The list is ordered by creation and is capped at 1,000 entries per address. Use the returned IDs with get_attestation to fetch individual records.

get_sender_attestations

Returns a list of attestation IDs for a given sender address.
Useful for employers who want to verify payments they approved on-chain.

verify_attestation

Returns true if an attestation exists and has a positive amount_paid.
This is a lightweight existence check. For full verification — including confirming the stream, verifier, and report hash — use get_attestation and inspect the fields directly, or use the /verify page in the Aven dashboard.

How Attestations Are Minted

1

Payment is released

The recipient calls withdraw_approved on the Stream Contract. The contract transfers funds to the recipient.
2

Stream Contract calls the Attestation Contract

The Stream Contract immediately invokes mint_attestation as a cross-contract call. The caller is the Stream Contract’s own address — this is what passes the authorization check.
3

WorkSession record is minted

An attestation of kind WorkSession is minted with the session evidence hash, active duration, verifier address, and payment amount.
4

StreamCompletion record (if applicable)

If total_withdrawn == total_deposited, the stream is now fully paid out. The Stream Contract immediately mints a second attestation of kind StreamCompletion. This is the record read by the Reputation Contract.

Querying Your Attestations

You do not call mint_attestation directly. Aven calls it automatically when a payment is released. You can view your attestations on your dashboard profile page, or query them on-chain by calling get_recipient_attestations with your Stellar address.
From the dashboard: Navigate to /profile/[your-address] to see all your attestations, their amounts, durations, employer confirmations, and stream titles. Independently: You can call get_recipient_attestations directly against the Attestation Contract using the stellar-sdk or Stellar Laboratory. The returned list of IDs can then be fetched one-by-one with get_attestation.

Independent Verification

To verify any attestation without using the Aven frontend:
1

Visit the verify page

Navigate to /verify in the Aven dashboard and enter the attestation ID.
2

Or call verify_attestation on-chain

Call verify_attestation(attestation_id) on the Attestation Contract. A return value of true confirms the record exists with a positive amount_paid.
3

Inspect the full record

Call get_attestation(attestation_id) to retrieve all fields, including report_hash, verifier, client_confirmed, and auto_released. Cross-reference report_hash with the work report stored in the Aven verifier service for full end-to-end verification.
Third-party systems — such as hiring platforms or automated grant workflows — can call get_recipient_attestations and get_attestation directly from any Stellar SDK without any Aven-specific dependency.