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

# Reputation

> Signed fixed-point feedback on agents — revocation and responses.

The reputation program is the ERC-8004 reputation surface: clients leave scored feedback on agents, can revoke it later, and anyone (the operator, a third party) can attach responses. It never calls into other programs — it just reads identity's `Agent` accounts to make sure the agent you're rating actually exists, and to block self-feedback.

Program ID (devnet): `35UrJCxmsyqPLcFNVHqsM8UZZjx6UQYNBS5ChrvUfLPR`

## Instructions

| Tag | Instruction      | Arguments                                                                                                                                                  | Accounts, in order                                                                                                                                                       | Notes                                                                         |
| --- | ---------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------- |
| 0   | `Initialize`     | `identity_registry: Pubkey`                                                                                                                                | registry **w p +**, admin **s**, rent payer **s**, system program                                                                                                        | One-time.                                                                     |
| 1   | `GiveFeedback`   | `agent_id: u64`, `value: i128`, `value_decimals: u8`, `tag1: String`, `tag2: String`, `endpoint: String`, `feedback_uri: String`, `feedback_hash: [u8;32]` | identity program, agent **p** (read cross-program), client index **w p +**, feedback index **w p +**, feedback **w p +**, client **s**, rent payer **s**, system program | `SelfFeedback` if you sign as the agent's owner *or* its `agent_wallet`.      |
| 2   | `RevokeFeedback` | `agent_id`, `feedback_index: u64`                                                                                                                          | feedback **w p**, client **s**                                                                                                                                           | Only the original client. Revocation is a flag — the feedback stays on-chain. |
| 3   | `AppendResponse` | `agent_id`, `feedback_index`, `response_uri: String`, `response_hash: [u8;32]`                                                                             | feedback **p**, response counter **w p +**, response **w p +**, responder **s**, rent payer **s**, system program                                                        | Anyone may respond. Empty URI is rejected.                                    |

Account markers: **s** = signer, **w** = writable, **p** = PDA verified, **+** = created if missing.

## The score: `value` + `value_decimals`

Feedback scores are signed fixed-point numbers — an `i128` mantissa plus a decimal count, so `value = 45, value_decimals = 1` reads as **4.5**, and `value = -2, value_decimals = 0` as **-2**. Limits: at most 18 decimals, and `|value| ≤ 1e38`. This is the same convention the EVM reputation contract uses, so scores port across chains without rescaling.

Feedback is indexed **1-based** per `(agent, client)` pair: your first review of agent 9 gets `feedback_index = 1`, your second `2`, and so on. The pair index PDA (`feedback-index`) tracks the counter, and a per-agent client list (`feedback-client-index`) tracks who has ever reviewed.

`tag1`, `tag2`, and `endpoint` are short strings for off-chain filtering (e.g. `quality`, the endpoint you actually called); `feedback_uri` + `feedback_hash` anchor a richer off-chain document. Exact length caps live in [Accounts & Encoding](/programs/accounts#limits).

## State

| Account           | Seeds                                                                                 | Contents                                                                                                           |
| ----------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------ |
| `Registry`        | `[b"reputation-registry"]`                                                            | `admin`, `identity_registry`. Note the different seed — identity/validation/market use plain `b"registry"`.        |
| `Feedback`        | `[b"feedback", agent_id_le, client, feedback_index_le]`                               | `value`, `value_decimals`, `is_revoked`, `tag1`, `tag2`, `endpoint`, `feedback_uri`, `feedback_hash`, `created_at` |
| `FeedbackIndex`   | `[b"feedback-index", agent_id_le, client]`                                            | `last_index` for the pair                                                                                          |
| client index      | `[b"feedback-client-index", agent_id_le]`                                             | `PubkeyIndex` of reviewing clients                                                                                 |
| `Response`        | `[b"response", agent_id_le, client, feedback_index_le, responder, response_index_le]` | `response_uri`, `response_hash`, `created_at`                                                                      |
| `ResponseCounter` | `[b"response-counter", agent_id_le, client, feedback_index_le, responder]`            | Per-responder response count                                                                                       |

## Worth knowing

* **Revoked ≠ deleted.** Indexers should keep showing revoked feedback with a flag — `getSummary`-style aggregation is expected to filter it off-chain. (There is no on-chain summary function; the program is a write-side ledger.)
* **Responses are per-responder.** The same responder can answer the same feedback multiple times (`response_index` increments), which is meant for threads, not edits.
* **Trust the identity program, not the account.** The agent PDA is re-derived against whatever identity program you pass in — pass the canonical one from [Deployed Contracts](/contracts/deployed-contracts), or use the SDK decoders which take the program ID from your deployment config.
