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

> ## Agent Instructions
> This page is part of the Solana developer documentation at https://solana.com/developers/docs. Append `.md` to any docs URL, or send `Accept: text/markdown`, to get the page as Markdown.
> Index of all pages: https://solana.com/llms.txt. Per-section indexes such as https://solana.com/developers/docs/payments/llms.txt are smaller; prefer them when working on one task.
> Coding agents: install the official Solana skill for current APIs and conventions with `npx skills add https://github.com/solana-foundation/solana-dev-skill` (also served at https://solana.com/SKILL.md).
> Code in the cookbook and task pages comes from tested example files. Prefer it over writing API calls from memory.

# Attestation-based compliance

> Attest that a KYC, sanctions, or travel-rule check happened without putting personal data onchain, and wire the attestation to the token's gate.

<Info>
Run the KYC, sanctions, and travel-rule checks offchain, as they run today.
Publish only the _result_ onchain, as an attestation asserting a narrow claim:
"this address passed sanctions screening, valid until this date." The token's
gate reads the attestation. The evidence behind the claim stays in your systems
or your provider's.
</Info>

## Personal data and a public ledger

A gated token needs an onchain answer to "may this address hold the token?"
The inputs to that answer (identity documents, screening hits, and
beneficial-ownership records) are personal data, which data-protection
obligations may keep off a public ledger.

Attestations separate the check from its evidence. The check runs where it
always ran, inside your compliance function or your vendor's. What lands
onchain is a signed statement that the check ran and what it concluded.

<Warning>
Attestation data is stored onchain and is public and permanent. The pattern
protects personal data only because you choose to attest a narrow conclusion.
Putting a name, a document number, a date of birth, a residential address, or
a raw screening payload into an attestation publishes it permanently. Attest
booleans and coarse categories, never the inputs.
</Warning>

## The three objects

[Solana Attestations](/developers/docs/tools/attestations) is built from three
onchain objects. Mapped to who owns what in an issuance:

| Object          | What it is                                                        | Who owns it in practice                                                                                    |
| --------------- | ----------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- |
| **Credential**  | An attestation authority, with a list of authorized signers       | The institution standing behind the check: you, or your KYC provider                                       |
| **Schema**      | The structure and field types a valid attestation must conform to | One credential: its authority creates the schema, and only that credential's signers can attest against it |
| **Attestation** | A signed claim about a subject, conforming to a schema            | Created by an authorized signer of the credential, one per address per claim                               |

An attestation carries an expiration timestamp and a unique nonce, and can
optionally be issued in tokenized form, held in the recipient's token account.
See [credentials](/developers/docs/tools/attestations/credentials),
[schemas](/developers/docs/tools/attestations/schemas), and
[attestations](/developers/docs/tools/attestations/attestations) for the
mechanics.

### Who signs

The credential's list of authorized signers is a compliance decision. A schema
belongs to the one credential it was created under, and an attestation must use
the credential that owns its schema: a signer from another credential can't
attest against it (the program rejects it with `InvalidCredential`). Three
arrangements:

- **You attest.** Your compliance function holds the credential and signs. You
  are asserting your own conclusion.
- **Your provider attests in your format.** You hold the credential and its
  schema, and add your KYC or screening vendor's signing key to the credential's
  authorized signers. Every attestation uses one shared format, and you can
  remove the vendor's key when the engagement ends.
- **Your provider attests under its own credential.** Your vendor holds a
  credential and its own schema, and signs. You rely on their claim and their
  format.

Several credentials can coexist for one token, for example a sanctions
attester and an accreditation attester, each with its own schema.

## Designing the schema

Schema design determines how much the pattern exposes. Keep every field to the
narrowest thing that supports the gate decision.

Reasonable fields:

- A boolean: screening passed, accreditation confirmed, eligibility met.
- A coarse jurisdiction code, where the rule varies by jurisdiction.
- A tier or category, where holding limits differ by investor class.
- A validity window, which the expiration timestamp already gives you.
- An opaque reference to your own case file, meaningful only inside your
  systems and not derivable from onchain data.

Fields to keep out: anything identifying a person, anything describing the
evidence, and anything precise enough to re-identify someone in combination. A
birth date plus a postcode can identify a person even though neither field is
a name.

Version the schema from the start. Rules change, and a schema that cannot be
superseded without invalidating every existing attestation forces a migration.

## Wiring an attestation to the gate

The claim can be enforced in two places, with different costs.

|                   | Drive the allowlist                                                                                          | Check inside a transfer hook                                                                                                                                                    |
| ----------------- | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| How it works      | A service adds attested addresses to the allowlist; holders thaw against it                                  | A [transfer hook](/developers/docs/tokens/extensions/transfer-hook) reads the attestation account at transfer time and rejects the transfer if it is missing, expired, or revoked |
| Cost per transfer | None; the check happens before any transfer                                                                  | Compute on every transfer, plus extra accounts the sender must supply                                                                                                           |
| Revocation        | Removing the address stops new thaws but **does not freeze an already-thawed account**; freeze it explicitly | Takes effect on the next transfer, which fails                                                                                                                                  |
| Operations        | An offchain service, kept running and monitored, with latency between an attestation and the list update    | The hook program, audited and maintained                                                                                                                                        |
| Use for           | Eligibility claims about the holder                                                                          | Rules that need a current claim at transfer time                                                                                                                                |

See [gate the holders](/developers/docs/tokenization/tutorials/issuing/gate-the-holders)
for the allowlist mechanics.

```mermaid
flowchart LR
  accTitle: From a credential to an enforced claim
  accDescr: An authorized signer of a credential creates an attestation that conforms to a schema. The attestation is enforced either by a service that adds attested addresses to the allowlist, or by a transfer hook that reads it at transfer time.
  C["Credential<br/>Authority with authorized signers<br/>You, or your KYC provider"] -->|an authorized signer creates| A["Attestation<br/>Signed claim about a subject<br/>One per address per claim"]
  A -->|conforms to| S["Schema<br/>Structure and field types<br/>Belongs to one credential"]
  A --> W1["Drive the allowlist<br/>A service adds attested addresses<br/>Removal stops new thaws only"]
  A --> W2["Check inside a transfer hook<br/>Reads the attestation at transfer time<br/>Rejects if missing, expired, or revoked"]
  class A focal
```

<div className="sol-mermaid" data-fallback="mermaid" data-mermaid="8c178ccdf59d">
  <img className="block dark:hidden" src="/docs-assets/assets/docs/mermaid/8c178ccdf59d-light.svg" alt="From a credential to an enforced claim. An authorized signer of a credential creates an attestation that conforms to a schema. The attestation is enforced either by a service that adds attested addresses to the allowlist, or by a transfer hook that reads it at transfer time." />

  <img className="hidden dark:block" src="/docs-assets/assets/docs/mermaid/8c178ccdf59d.svg" alt="From a credential to an enforced claim. An authorized signer of a credential creates an attestation that conforms to a schema. The attestation is enforced either by a service that adds attested addresses to the allowlist, or by a transfer hook that reads it at transfer time." />

  <img className="block dark:hidden" src="/docs-assets/assets/docs/mermaid/8c178ccdf59d-sm-light.svg" alt="From a credential to an enforced claim. An authorized signer of a credential creates an attestation that conforms to a schema. The attestation is enforced either by a service that adds attested addresses to the allowlist, or by a transfer hook that reads it at transfer time." />

  <img className="hidden dark:block" src="/docs-assets/assets/docs/mermaid/8c178ccdf59d-sm.svg" alt="From a credential to an enforced claim. An authorized signer of a credential creates an attestation that conforms to a schema. The attestation is enforced either by a service that adds attested addresses to the allowlist, or by a transfer hook that reads it at transfer time." />
</div>

## Lifecycle

An attestation records a check at one point in time. Decide these before you
launch:

- **Expiry.** Set an expiration that matches your re-screening cycle.
- **Re-attestation.** Who re-runs the check, on what schedule, and does the
  holder have to do anything? Prefer renewal that completes without holder
  action over a lapse discovered at transfer time.
- **Revocation.** Plan for a sanctions hit against an existing holder; see
  [wiring an attestation to the gate](#wiring-an-attestation-to-the-gate) for
  how each pattern handles it.
- **A holder whose attestation lapses while holding a balance.** They still
  hold the asset. A lapse does not change the account's state by itself; the
  options are a freeze, transfers only to redeem, or a grace period.

## Limits

- **It is not proof the check was done well.** An attestation is a signature
  on a claim. Its value depends on the standing of whoever signed it.
- **It does not carry travel-rule data.** Where a travel rule applies,
  originator and beneficiary information moves between institutions, and
  regimes may differ. That is personal data and stays offchain, on your
  existing rails. What an attestation can do is assert that the counterparty
  is an institution you have a travel-rule arrangement with.
- **It does not hide who holds the token.** Addresses, balances, and the fact
  that an address carries an attestation are all public. If holder
  relationships need to stay private, see
  [privacy and transfer controls](/developers/docs/tokenization/compliance/privacy-and-transfer-controls).
- **It does not resolve identity across chains or institutions.** An
  attestation is about an address, not a person. Two addresses attested by the
  same provider are not linked by the attestations themselves, though issuance
  patterns may still support inference, and a case-file reference reused
  across both would link them directly.

## Related

- [Gate the holders](/developers/docs/tokenization/tutorials/issuing/gate-the-holders):
  the allowlist end to end
- [Token ACL](/developers/docs/tokenization/token-acl): the gate the allowlist
  path thaws against
- [Attestations](/developers/docs/tools/attestations): the program reference
