Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions docs/agents.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,14 @@ IMPORTANT: Prefer retrieval-led reasoning. Read relevant docs before generating
Base is an Ethereum L2 by Coinbase. Docs for: Base Chain, Smart Wallet, OnchainKit, MiniKit.
[Docs]|root:./docs
|ai-agents:index
|ai-agents/frameworks:agentkit,eliza,langchain,vercel-ai-sdk
|ai-agents/payments:accepting-payments,x402-protocol
|ai-agents/guides:agent-builder-codes
|ai-agents/payments:accepting-payments,pay-for-services-with-x402
|ai-agents/quickstart:payments,trading
|ai-agents/reference:contracts
|ai-agents/setup:agent-registration,wallet-setup
|ai-agents/skills:index
|ai-agents/skills/base-account:building-with-base-account
|ai-agents/skills/base-chain:adding-builder-codes,connecting-to-base-network,deploying-contracts,running-a-base-node
|ai-agents/skills/migrations:convert-farcaster-miniapp-to-app,converting-minikit-to-farcaster,migrating-an-onchainkit-app
|ai-agents/trading:data-fetching,trade-execution
|base-account/basenames:basename-transfer,basenames-faq,basenames-wagmi-tutorial
|base-account/contribute:contribute-to-base-account-docs,security-and-bug-bounty
Expand Down Expand Up @@ -46,4 +49,4 @@ Base is an Ethereum L2 by Coinbase. Docs for: Base Chain, Smart Wallet, OnchainK
|mini-apps/quickstart:build-checklist,building-for-the-base-app,create-new-miniapp,migrate-existing-apps,migrate-to-standard-web-app,template
|mini-apps/technical-guides:accept-payments,building-chat-agents,neynar-notifications,sharing-and-social-graph,sign-manifest
|onchainkit:migrate-from-onchainkit
|root:cookie-policy,privacy-policy,terms-of-service,tone_of_voice
|root:agents,cookie-policy,privacy-policy,terms-of-service,tone_of_voice
111 changes: 111 additions & 0 deletions docs/ai-agents/guides/agent-builder-codes.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
---
title: "Get a Builder Code for Your Agent"
description: "Register your agent on Base.dev and append a Builder Code to every transaction to measure onchain activity."
keywords: ["builder code", "Base.dev", "ERC-8021", "attribution", "onchain activity", "agent attribution", "dataSuffix", "builder codes", "Base builder codes", "agent onchain"]
tag: "NEW"
---

Base.dev is the canonical registry for agents on Base. A Builder Code ties every transaction your agent sends to your identity in that registry, giving you verifiable onchain attribution and access to analytics and leaderboard features.

## What you get

- **Builder Code** — a unique identifier (e.g. `bc_a1b2c3d4`) that you append to your onchain transactions. Base uses this to measure your agent's activity on Base Chain.

## Prerequisites

- An EVM wallet address that your agent operates from
Comment thread
soheimam marked this conversation as resolved.

---

## Get your Builder Code

One call. No auth.

```bash Terminal
curl -X POST https://api.base.dev/v1/agents/builder-codes \
-H "Content-Type: application/json" \
-d '{
"wallet_address": "0x<your-wallet-address>"
}'
```

Response:

```json Title Response
{
"builder_code": "bc_a1b2c3d4",
"wallet_address": "0x...",
}
```

<Warning>
Already registered? Calling this endpoint again with the same wallet address returns your existing builder code.
</Warning>
---

## Get a Builder Code using the Base skill

If you're using an AI coding tool (Claude Code, Cursor, Codex), install the Base skills package and let the skill handle registration end-to-end:

```bash Terminal
npx skills add base/skills
```

Then ask your agent: **"Register my agent for a builder code on Base.dev."**

The skill runs four phases:

<Steps>
<Step title="Wallet">
Asks for your agent's wallet address. If you don't have one, it sends you to the [wallet setup guide](/ai-agents/guides/wallet-setup) before continuing.
</Step>
<Step title="Registration and attribution">
Calls `POST /v1/agents/builder-codes` with your wallet address, writes the returned code to `src/constants/builderCode.ts`, installs `ox`, and wires the ERC-8021 `dataSuffix` into your transaction client (viem, ethers.js, or managed service). It also writes an `AGENT_README.md` documenting the setup.
</Step>
<Step title="Permanent rule">
Confirms the setup and instructs you that every future transaction must include the ERC-8021 suffix. Missing it causes silent, permanent attribution loss — no error, no warning.
</Step>
</Steps>

---

## Get a Builder Code with a prompt

If you're using an AI agent, point it to this page:

```text Title Prompt
Get a Builder Code for my agent on Base.dev using the documentation at [URL of this page].

My agent's wallet address: [0x...]

Run this curl command, replacing the wallet address with mine:
curl -X POST https://api.base.dev/v1/agents/builder-codes \
-H "Content-Type: application/json" \
-d '{"wallet_address": "[0x...]"}'

Return the builder_code from the response, then show me how to append it to my transactions using ERC-8021.
```
---


## What happens next
Comment thread
soheimam marked this conversation as resolved.

Once you receive your Builder Code, it becomes active right away Base will begin tracking any transactions that include it.

## API reference

### Get builder code

```
POST /v1/agents/builder-codes
```

No authentication required.

| Field | Type | Required | Description |
|---|---|---|---|
| `wallet_address` | string | Yes | Your agent's EVM wallet address (`0x...`) |

Returns the builder code for the given wallet. The same wallet address always returns the same code — safe to call multiple times.


5 changes: 5 additions & 0 deletions docs/docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -533,6 +533,11 @@
{
"group": "Setup",
"pages": [
"ai-agents/guides/agent-builder-codes",
"ai-agents/guides/x402-payments",
"ai-agents/guides/register-and-sign-in-your-agent",
"ai-agents/guides/agent-app",
"ai-agents/guides/trading",
"ai-agents/setup/wallet-setup",
"ai-agents/setup/agent-registration"
]
Expand Down
58 changes: 30 additions & 28 deletions docs/llms.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,34 @@

These resources give AI assistants direct access to Base documentation and reusable workflows.

### Base MCP server

`https://docs.base.org/mcp`

### Base skills

AI agents can use Base skills to perform onchain actions directly from their tool loop — no custom integration required. Available skills include:

[https://github.com/base/skills](https://github.com/base/skills)

Install Base skills for your AI assistant:

```
npx skills add base/base-skills
```
## Recommended starting points

Narrow context to a specific type of work:

- [AI Agents overview](https://docs.base.org/ai-agents) — Overall agent building model on Base
- [Agent frameworks](https://docs.base.org/ai-agents/core-concepts/agent-frameworks)
- [Wallets](https://docs.base.org/ai-agents/core-concepts/wallets) — Agent wallets, signing, and funded execution
- [Payments and transactions](https://docs.base.org/ai-agents/core-concepts/payments-and-transactions) — x402 payments and onchain transaction
- [Identity and auth](https://docs.base.org/ai-agents/core-concepts/identity-verification-auth) — Verification and trust between agents and services
- [Base Account quickstart for AI tools](https://docs.base.org/base-account/quickstart/ai-tools-available-for-devs) — Agent-assisted wallet and account flows
- [Deploy on Base](https://docs.base.org/base-chain/quickstart/deploy-on-base) — Contract deployment on Base
- [Build a Base app](https://docs.base.org/get-started/build-app)

### Docs index

[https://docs.base.org/llms.txt](https://docs.base.org/llms.txt)
Expand All @@ -25,7 +53,7 @@ Base is an Ethereum L2 by Coinbase. Docs for: Base Chain, Smart Wallet, OnchainK
[Docs]|root:./docs
|ai-agents:index
|ai-agents/frameworks:eliza,langchain,vercel-ai-sdk
|ai-agents/guides:agent-app,register-and-sign-in-your-agent,trading,wallet-setup,x402-payments
|ai-agents/guides:agent-app,agent-builder-codes,register-and-sign-in-your-agent,trading,wallet-setup,x402-payments
|ai-agents/introduction:choosing-a-framework
|ai-agents/quickstart:agentkit,openclaw-claude
|ai-agents/reference:contracts
Expand Down Expand Up @@ -66,34 +94,8 @@ Base is an Ethereum L2 by Coinbase. Docs for: Base Chain, Smart Wallet, OnchainK
|mini-apps/quickstart:build-checklist,building-for-the-base-app,create-new-miniapp,migrate-existing-apps,migrate-to-standard-web-app,template
|mini-apps/technical-guides:accept-payments,building-chat-agents,neynar-notifications,sharing-and-social-graph,sign-manifest
|onchainkit:migrate-from-onchainkit
|root:cookie-policy,privacy-policy,terms-of-service,tone_of_voice
|root:agents,cookie-policy,privacy-policy,terms-of-service,tone_of_voice
```

### Base MCP server

`https://docs.base.org/mcp`

### Base skills

[https://github.com/base/skills](https://github.com/base/skills)

Install Base skills for your AI assistant:

```
npx skills add base/base-skills
```

## Recommended starting points

Narrow context to a specific type of work:

- [AI Agents overview](https://docs.base.org/ai-agents) — Overall agent building model on Base
- [Agent frameworks](https://docs.base.org/ai-agents/core-concepts/agent-frameworks)
- [Wallets](https://docs.base.org/ai-agents/core-concepts/wallets) — Agent wallets, signing, and funded execution
- [Payments and transactions](https://docs.base.org/ai-agents/core-concepts/payments-and-transactions) — x402 payments and onchain transaction
- [Identity and auth](https://docs.base.org/ai-agents/core-concepts/identity-verification-auth) — Verification and trust between agents and services
- [Base Account quickstart for AI tools](https://docs.base.org/base-account/quickstart/ai-tools-available-for-devs) — Agent-assisted wallet and account flows
- [Deploy on Base](https://docs.base.org/base-chain/quickstart/deploy-on-base) — Contract deployment on Base
- [Build a Base app](https://docs.base.org/get-started/build-app)


Loading