> For the complete documentation index, see [llms.txt](https://andrewkimjoseph.gitbook.io/celina-sdk/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://andrewkimjoseph.gitbook.io/celina-sdk/guides/on-chain-attribution.md).

# On-chain attribution

Prepared and AA-submitted calldata carries an **ERC-8021 Schema 0** Celina attribution suffix so indexers and agents can identify app traffic on Celo mainnet.

## Wire format (writes)

Every tagged step appends ERC-8021 only via `appendCelinaCalldataTag` / `toDataSuffix`:

| Layer        | Contents                                                                             |
| ------------ | ------------------------------------------------------------------------------------ |
| **ERC-8021** | Schema 0 codes — always includes platform code `celina`, then lowercase custom codes |

Example: `attributionTags: ["goclaim"]` -> codes `celina`, `goclaim`.

Case rules for **custom tags** (before ERC-8021 lowercasing):

* App tags (e.g. `goclaim`, `celeste_ai`) → uppercase in normalize helpers (`GOCLAIM`, `CELESTE_AI`), then lowercase in ERC-8021 codes
* Celo Builders tags matching `celo_<12 hex>` → lowercase
* Tags are deduped in first-seen order; the literal tag `CELINA` / code `celina` is platform-only

## Where to set tags

| Client                                    | When tags apply                                     |
| ----------------------------------------- | --------------------------------------------------- |
| `createCelinaClient({ attributionTags })` | Every `prepare*` step via `appendCelinaCalldataTag` |
| `createAAClient({ attributionTags })`     | Every step with `data` in `sendPreparedFlow`        |

Omit `attributionTags` on the AA client to **pass step `data` through unchanged** (useful when `prepare*` already tagged). Passing `[]` still applies the platform-only ERC-8021 code `celina`.

Use **one consistent tag list** per send path. Setting different lists on both the Celina client and the AA client can stack or mismatch suffixes.

Hand-built flows (no `prepare*`) that still need tags:

```ts
import { appendCelinaCalldataTag } from "@andrewkimjoseph/celina-sdk";

const data = appendCelinaCalldataTag(encodeFunctionData(...), ["goclaim"]);
```

## Check vs verify

| Tool / API                                                   | Prefer when                                                                               |
| ------------------------------------------------------------ | ----------------------------------------------------------------------------------------- |
| **`check_attribution_tag`** / `checkAttributionInCalldata`   | You want all ERC-8021 `tags` in lowercase (mirrors `erc8021.codes`) or to confirm one tag |
| **`verify_attribution_tag`** / `verifyAttributionInCalldata` | You need the raw ERC-8021 layer                                                           |

See [Configuration](/celina-sdk/getting-started/configuration.md), [Prepared flows](/celina-sdk/concepts/prepared-flows.md), and [Account Abstraction](/celina-sdk/guides/account-abstraction.md).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://andrewkimjoseph.gitbook.io/celina-sdk/guides/on-chain-attribution.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
