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

# On-Chain Attestations and Portable Work Reputation

> Every approved Aven work session mints a tamper-proof on-chain attestation. Your collection of attestations builds a verifiable, portable reputation score.

When a payment is released on Aven, the stream contract does two things simultaneously: it transfers the tokens to the recipient's wallet, and it calls the attestation contract to mint a **permanent on-chain record** of that payment. This attestation is the proof — independent of any platform account — that a specific piece of verified work was delivered, reviewed by the employer, and paid.

***

## What an Attestation Is

An attestation is an immutable record stored in the Aven attestation contract on Stellar. It is minted automatically at the moment a session payment is released via `withdraw_approved`. No separate action is required from the worker or employer.

Each attestation captures the full context of the completed session:

| Field | Description |
| - | - |
| `id` | Sequential attestation ID, unique across the contract |
| `kind` | `WorkSession` for verified npm sessions; `StreamCompletion` for the final stream record |
| `stream_id` | The stream the session was delivered against |
| `sender` | Stellar address of the employer who funded the stream |
| `recipient` | Stellar address of the worker who received payment |
| `amount_paid` | Exact token amount released, in Stellar fixed-point (stroops) |
| `asset` | Token contract address — XLM native SAC or USDC |
| `active_duration_seconds` | Verified active seconds from the npm session tracker |
| `period_start_ledger` | Ledger sequence at the start of the work period |
| `period_end_ledger` | Ledger sequence at the end of the work period |
| `report_hash` | SHA-256 hash of the work session report (on-chain evidence anchor) |
| `client_confirmed` | `true` if the employer explicitly approved; `false` if auto-released on timeout |
| `minted_at_ledger` | Ledger sequence at which this attestation was created |
| `verifier` | Address of the server-side verifier that signed the payment calculation |
| `category` | Stream work category: `Freelance`, `Salary`, `Bounty`, `Grant`, `AgentTask`, or `Subscription` |
| `title` | Human-readable stream title, copied from the stream record |

***

## Attestation Kinds

The attestation contract records two kinds of attestations for the work-session flow:

* **`WorkSession`** — minted for every individual approved session payment. Linked to a specific `request_id` (the session UUID) so duplicates are prevented at the contract level.
* **`StreamCompletion`** — minted once when the stream's total withdrawals equal the total deposited amount. This is the record that the reputation contract reads to calculate a score. It represents the completed project as a whole.

> [!NOTE]
>
> Attestations are permanent and cannot be deleted. Testnet attestations are not production credentials.

***

## Portability

Attestations are indexed by the **recipient's Stellar address**, not by any Aven account, session, or platform identifier. This means your work history is:

* **Independent of the Aven platform** — the records exist on-chain and can be read by any application that queries the attestation contract.
* **Transferable** — if you use the same Stellar address across projects, all attestations accumulate in one verifiable history.
* **Publicly auditable** — anyone with your Stellar address can look up your attestations without your permission or involvement.

The attestation contract exposes `get_recipient_attestations(address)` to retrieve all attestation IDs for an address, and `get_attestation(id)` to read the full record for any individual attestation.

***

## The Reputation Contract

The reputation contract aggregates `StreamCompletion` attestations for a given address into a **reputation score**. Scores are calculated on-chain, on demand, without any off-chain indexing or aggregation.

The score is computed as follows for each completed stream:

1. A **base score** of 10 points per completed stream.
2. A **payment bonus** of up to 100 points based on the total amount paid (1 point per 10 XLM paid, capped at 100).
3. A **category multiplier** — Grant streams score at 130%, Bounty at 120%, Freelance at 110%, all others at 100%.
4. A **confirmation multiplier** — employer-confirmed payments score at 100%; auto-released (timeout) payments score at 50%.

The total score is capped at **10,000 points** across all completed streams.

The reputation contract also returns a `ScoreBreakdown` that shows the score split by category (`freelance`, `salary`, `bounty`, `grant`, `agent_task`, `subscription`).

***

## Public Profiles and Verification

> **[Public Profile](https://aven-docs.mintlify.site/guides/reputation-profile.md)**
>
> Every Stellar address has a public profile page at `/profile/[address]` on the Aven dashboard. It displays all work-session attestations for that address, the computed reputation score, and the score breakdown by category. No login required to view a profile.

> **[Verify an Attestation](https://aven-docs.mintlify.site/guides/verify-attestation.md)**
>
> The `/verify` page lets anyone independently confirm that an attestation exists on-chain by entering its attestation ID. The contract's `verify_attestation` function returns `true` if the record exists and has a valid `amount_paid`.

***

## The `/agents` Page

The `/agents` page provides a reputation lookup interface for any Stellar address. It is designed for scenarios where a worker's reputation needs to be assessed before assigning work — including automated pipelines and AI worker screening. Enter any address to retrieve the current reputation score and breakdown without needing a wallet connection.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.