Get started
The fastest way is to point your AI agent at the setup instructions. Copy this into Claude Code, Cursor, Codex, or any coding agent:Builder Codes are supported on EVM networks only, in the TypeScript and Go SDKs. The CDP Facilitator automatically appends its own wallet code (
cdp_facil) to every settlement that includes attribution.Get a Base Builder Code
Register at dashboard.base.org to generate your builder code. This code identifies your app in onchain transaction data.- Log in at dashboard.base.org
- Register your app name
- Add and verify your domain
- Go to Settings → Builder Codes to get your code (e.g.
bc_b7k3p9da)
^[a-z0-9_]{1,32}$ — lowercase letters, digits, and underscores only, 1–32 characters.
Types of codes
Three parties each contribute a code that is encoded into the onchain calldata suffix at settlement:| Field | Name | Set by | Description |
|---|---|---|---|
a | App code | Seller | Identifies the application that exposed the paid endpoint |
w | Wallet code | Facilitator | Identifies the facilitator that settled the payment — CDP uses cdp_facil |
s | Service code | Client (optional) | Identifies the client or intermediary that initiated the payment |
^[a-z0-9_]{1,32}$ — lowercase letters, digits, and underscores only, between 1 and 32 characters.
For sellers
Declare your app code per-route in the payment middleware configuration. The code is included in the402 Payment Required response so clients can echo it back at payment time.
- Node.js
- Go
declareBuilderCodeExtension validates the format and throws if the code doesn’t match ^[a-z0-9_]{1,32}$.
For buyers
Clients can optionally register a service code (s) to include their own attribution in every payment payload. The client SDK also automatically echoes the server’s app code (a) from the 402 response — this is required by the facilitator and happens automatically.
- Node.js
- Go
CDP Facilitator behavior
When the CDP Facilitator settles a payment that includes attribution, it:- Verifies that the client’s echoed
amatches the server’s declareda. A mismatch causes the settlement to be rejected. - Reads
a(app code) ands(service code) from the payment payload. - Adds its own wallet code:
w: "cdp_facil". - CBOR-encodes all three fields and appends the ERC-8021 Schema 2 suffix to the settlement transaction calldata.
Verifying attribution onchain
After a payment settles, you can confirm attribution in two ways:- No-code: Paste any settlement transaction hash into the Builder Code Validation Tool
- Parse calldata: Use the script below
- Node.js
- Go
The
s field (service code) will appear if the buyer integrated a Builder Code. The w field will appear if the CDP Facilitator settled the payment. The a field (app code) will only appear if the seller also declared a Builder Code extension.Dashboard
View your attribution data and app metrics at dashboard.base.org.Transaction volume and attribution data are accurate at launch. Daily transacting user (DTU) counts may be temporarily overstated while relayer attribution is being improved, as the user counts you see reflect facilitator relayer EOAs, not unique end users. This will be corrected in a follow-up update.