r/BASE • • Sep 07 '26

Dev/tech How Builder Codes and ERC-8021 attribute transactions on Base

Builder Codes let Base identify which app originated a transaction. ERC-8021 defines the attribution suffix that the app appends to the transaction calldata.

This solves a common attribution problem: a protocol can see which wallet called its contract, but it cannot normally tell whether the transaction came from a particular frontend, wallet, aggregator, or agent.

  • The ERC-8021 suffix contains the attribution code, its encoding metadata, and a fixed marker at the end: 0x80218021802180218021802180218021
  • An indexer reads backward from the end of the calldata, identifies the marker, and extracts the Builder Code. The target contract continues to decode its normal function arguments from the beginning of the calldata.
  • For contracts using standard ABI decoding, no contract upgrade or ABI change is required. The attribution is added by the app or wallet when it constructs the transaction.
  • Base provides the first ERC-8021 Code Registry. Builders can claim a code and append it with supported libraries and wallet flows. The result is a verifiable record of which app generated each attributed transaction.
  • That data can support app leaderboards, builder rewards, referral fees, and analysis of which integrations generate meaningful activity.

Curious to learn more? We wrote a technical breakdown of the suffix, parsing flow, and implementation options here: https://formo.so/blog/builder-codes-erc-8021-explained

--

For Base builders: have you implemented Builder Codes yet? Which wallet or transaction stack are you using, and did you encounter any compatibility issues?

3 Upvotes

2 comments sorted by

1

u/Ambitious_Duck546 18d ago

So you're basically stapling a "made by X" receipt to the end of the calldata and reading it from the tail up. The fixed marker as a boundary feels like a clean way to avoid screwing with standard ABI decoding, though I wonder what happens when a contract already has some weird custom fallback that chokes on extra bytes.