> ## Documentation Index
> Fetch the complete documentation index at: https://heyaven09.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Attestations: Immutable Proof of Paid Work on Stellar

> An attestation is an immutable on-chain record proving a worker was paid for a verified work session — minted atomically alongside the token transfer.

An attestation is an immutable on-chain record that proves a worker was paid a specific amount for a verified work session. It is not a receipt generated after the fact — it is minted in the exact same Stellar transaction as the token transfer, making it cryptographically inseparable from the payment itself. Every attestation on Aven is public, verifiable, and permanently stored on the Stellar ledger.

## What Is an Attestation?

When a client approves a work session, the `stream_contract` orchestrates two operations simultaneously: it transfers the approved token amount to the worker, and it calls the `attestation_contract` to mint an `AttestationRecord`. The attestation captures the full context of that payment — which stream it came from, how much was paid, how long the worker was active, and whether the client personally confirmed the work.

Attestations accumulate over time and become the raw material for your [reputation score](/concepts/reputation).

## Attestation Fields

<ResponseField name="id" type="integer">
  A globally unique, auto-incrementing integer identifier for this attestation record on the Stellar ledger.
</ResponseField>

<ResponseField name="stream_id" type="integer">
  The ID of the payment stream this attestation is linked to. You can use this to trace the full history of a stream.
</ResponseField>

<ResponseField name="recipient" type="string">
  The Stellar address of the worker who was paid. This is the address the reputation contract aggregates attestations for.
</ResponseField>

<ResponseField name="amount_paid" type="integer">
  The number of tokens (in the asset's smallest unit) transferred to the worker in this transaction.
</ResponseField>

<ResponseField name="kind" type="AttestationKind">
  The mechanism by which the attestation was created. See [AttestationKind categories](#attestationkind-categories) below.
</ResponseField>

<ResponseField name="client_confirmed" type="boolean">
  `true` if the client explicitly approved the work session. `false` if the payment was auto-released after the review deadline expired without client action. Client-confirmed attestations score higher in the reputation calculation.
</ResponseField>

<ResponseField name="auto_released" type="boolean">
  `true` when the payout was triggered automatically because the client's review deadline passed. When `false`, the client actively approved the work. This mirrors the inverse of `client_confirmed`.
</ResponseField>

<ResponseField name="category" type="Category">
  The work category inherited from the stream — one of `Freelance`, `Salary`, `Bounty`, `Grant`, `AgentTask`, or `Subscription`. This determines which bucket of the worker's reputation score is incremented.
</ResponseField>

<ResponseField name="sender" type="string">
  The Stellar address of the client who created the stream and funded the payment.
</ResponseField>

<ResponseField name="asset" type="string">
  The Stellar asset address used for the payment (USDC or native XLM).
</ResponseField>

<ResponseField name="minted_at_ledger" type="integer">
  The Stellar ledger sequence number at which this attestation was minted. Used by the reputation contract to calculate recency weighting.
</ResponseField>

<ResponseField name="period_start_ledger" type="integer">
  The ledger at which the work period began.
</ResponseField>

<ResponseField name="period_end_ledger" type="integer">
  The ledger at which the work period ended.
</ResponseField>

<ResponseField name="active_duration_seconds" type="integer">
  The number of active seconds reported by the CLI for this session. Zero for checkpoint and legacy withdrawal paths.
</ResponseField>

<ResponseField name="report_hash" type="string | null">
  A SHA-256 hash of the CLI verification report for `WorkSession` attestations. `null` for checkpoint and legacy paths.
</ResponseField>

## AttestationKind Categories

The `kind` field records the path through which an attestation was created:

| Kind             | Description                                                                              |
| ---------------- | ---------------------------------------------------------------------------------------- |
| `WorkSession`    | Created via the `aven-stellar` CLI work session flow with cryptographic verifier backing |
| `Checkpoint`     | Created when a milestone checkpoint inside a stream is finalized and approved            |
| `LegacyReviewed` | Created through the manual withdrawal review path (no verifier signature)                |

For reputation scoring purposes, all three kinds are treated equally. The `Category` field on the associated stream — `Freelance`, `Salary`, `Bounty`, `Grant`, `AgentTask`, or `Subscription` — determines which bucket of your reputation score is incremented.

## The Atomicity Guarantee

<Warning>
  **Payment and attestation are a single, indivisible transaction.**

  When a verified work session is approved, the `stream_contract` calls the `attestation_contract` and executes the token transfer **in the same Stellar transaction**. If the token transfer fails for any reason, no attestation is minted. If the attestation mint fails, the token transfer reverts and the worker receives nothing. There is no state where a worker is paid without an attestation, and no state where an attestation exists without a corresponding payment. These two outcomes are unified atomically — there are no half-states, no reconciliation steps, and no manual rollbacks.
</Warning>

```mermaid theme={null}
sequenceDiagram
    participant Client
    participant StreamContract
    participant AttestationContract
    participant Worker

    Client->>StreamContract: verify_work(session_id, amount)
    StreamContract->>AttestationContract: mint_attestation()
    StreamContract->>Worker: transfer(amount)
    Note over StreamContract,AttestationContract: Both succeed or both revert
    AttestationContract-->>Worker: AttestationRecord minted
```

## Portability

Because attestations live on the Stellar ledger rather than in a centralized database, you own them unconditionally. Anyone — a prospective client, a DAO, an automated system — can verify your work history by querying the attestation contract directly without asking Aven for permission.

Attestations are the foundation of the [reputation contract](/concepts/reputation), which reads your full attestation history and computes a categorized score. As you accumulate more attestations, your reputation grows in the categories that match the type of work you do.
