Skip to main content
Defined in ERC-8021
The dataSuffix capability allows apps to append arbitrary hex-encoded bytes to transaction calldata. This enables attribution tracking, allowing platforms to identify which app originated a transaction and distribute rewards accordingly.

Parameters

value
`0x${string}`
required
Hex-encoded bytes to append to the transaction calldata. This value is appended to the end of the calldata for each call in the batch.
optional
boolean
When true, the wallet may ignore the capability if it doesn’t support it. When false or omitted, the wallet must support the capability or reject the request.

Returns

dataSuffix
object
The data suffix capability configuration for the specified chain.

Example Usage

const capabilities = await provider.request({
  method: 'wallet_getCapabilities',
  params: [userAddress]
});

const dataSuffixSupport = capabilities["0x2105"]?.dataSuffix;
{
  "0x2105": {
    "dataSuffix": {
      "supported": true
    }
  }
}

Error Handling

CodeMessageDescription
4100Data suffix not supportedWallet does not support data suffix functionality
5700DataSuffix capability requiredTransaction requires dataSuffix but wallet doesn’t support it

How It Works

When a wallet receives a dataSuffix capability, the suffix is appended to userOp.callData. The suffix bytes are concatenated directly to the end of the calldata, making them available for onchain parsing and attribution.

Use Cases

Builder Codes Attribution

The primary use case for dataSuffix is Builder Codes attribution. Builder Codes are unique identifiers that allow apps to receive attribution for onchain activity they generate.
import { Attribution } from "ox/erc8021";

// Example: Using Builder Code with dataSuffix.
// Using the ox/erc8021 package to generate the ERC-8021 suffix from your builder code.
const builderCodeSuffix = Attribution.toDataSuffix({
  codes: ['bc_foobar'], // Get your code from base.dev
});

await provider.request({
  method: "wallet_sendCalls",
  params: [{
    version: "1.0",
    chainId: "0x2105",
    from: userAddress,
    calls: [{
      to: contractAddress,
      value: "0x0",
      data: swapCallData
    }],
    capabilities: {
      dataSuffix: {
        value: builderCodeSuffix,
        optional: true
      }
    }
  }]
});
Register on base.dev to get your Builder Code for proper attribution.

Best Practices

  1. Use with Builder Codes: Register on base.dev to get your Builder Code for proper attribution
  2. Set optional appropriately: Use optional: true if your app can function without attribution tracking
  3. Keep suffixes small: Larger suffixes increase gas costs
For wallet developers implementing dataSuffix support, see the For Wallet Developers section in the Builder Codes guide.