Overview
Base Builder Codes are unique identifiers that attribute onchain activity, such as transactions and user operations, back to your app. They’re built on ERC-8021, a standard for appending a small attribution suffix to transaction calldata. Indexers on Base read the suffix to credit your app with the activity it generates. CDP Embedded Wallets support Builder Codes natively via thedataSuffix parameter on sendUserOperation. No contract changes are needed; the suffix is appended to the callData of each user operation and is invisible to smart contract execution.
Benefits
- Rewards: Builder Codes let Base automatically attribute onchain usage back to your app, unlocking rewards as the program expands.
- Analytics: Track onchain activity, user acquisition, and conversion metrics at base.dev.
- Visibility: Apps with Builder Codes can appear in discovery surfaces like App Leaderboards, the Base App store, and ecosystem spotlights.
Prerequisites
- A Builder Code from base.dev (register, then find your code under Settings → Builder Code)
@coinbase/cdp-core,@coinbase/cdp-hooks, andoxinstalled
Generate your attribution suffix
Use theox/erc8021 package to convert your Builder Code into the hex-encoded suffix that gets appended to transactions. Do this once at module level, and reuse it across all your calls.
Add Builder Codes to user operations
PassdataSuffix to sendUserOperation (or useSendUserOperation). The SDK appends the suffix to the user operation’s callData before it’s signed and submitted.
React hook
Core SDK (non-React)
Parameters
| Parameter | Type | Description |
|---|---|---|
dataSuffix | 0x${string} | Hex-encoded ERC-8021 attribution suffix generated from your Builder Code. Generate with Attribution.toDataSuffix from ox/erc8021. |
Full end-to-end example
Complete example with wallet setup
Complete example with wallet setup
Verify attribution
After sending a transaction, confirm your Builder Code is being attributed correctly using any of the following methods. 1. Check base.dev- Visit base.dev
- Select Onchain from the transaction type dropdown
- Attribution counts increment as transactions with your code are processed
- Find your transaction hash
- View the input data field
- Verify the last 16 bytes contain the
8021repeating pattern - Decode the suffix to confirm your Builder Code is present
- Use the Builder Code Validation Tool
- Select transaction type and enter the transaction or UserOperation hash
- Click Check Attribution
FAQ
Do I need to modify my smart contracts?
No. The attribution suffix is appended to the end ofcallData. Smart contracts execute normally and ignore the extra bytes. Attribution is extracted by offchain indexers after the fact. Any existing contract automatically supports ERC-8021 with no upgrades or re-deployments required.
How much additional gas do Builder Codes cost?
The ERC-8021 suffix adds a negligible amount of gas (16 gas per non-zero byte appended).Does this work with EOAs too?
Yes. ERC-8021 works with both EOAs and smart contract wallets. For EOA transactions (not user operations), the suffix is appended totx.data instead of userOp.callData. See the For App Developers guide on Base docs for EOA-specific setup using Wagmi or Viem.
Will Builder Codes expose my users’ identities?
No. Builder Codes associate transactions with your application only; they don’t expose any wallet information that isn’t already public onchain.Additional resources
- Base Builder Codes overview — full program details, rewards, and FAQ
- ERC-8021 specification
- Builder Code Validation Tool
- ox/erc8021 package docs
- Register for a Builder Code
Have questions or feedback? Join the discussion in the Coinbase Developer Discord.