> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cdp.coinbase.com/llms.txt
> Use this file to discover all available pages before exploring further.

# dataSuffix

> Append arbitrary data to transaction calldata for attribution tracking

Defined in [ERC-8021](https://eip.tools/eip/8021)

> [!NOTE]
>
> 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.

**DataSuffix Capability Properties**

**supported** `boolean`

Indicates whether the wallet supports appending data suffixes to transaction calldata.

## Example Usage

```typescript Check DataSuffix Support theme={null}
const capabilities = await provider.request({
  method: 'wallet_getCapabilities',
  params: [userAddress]
});

const dataSuffixSupport = capabilities["0x2105"]?.dataSuffix;
```

```typescript Send Transaction with DataSuffix lines wrap expandable theme={null}
const result = await provider.request({
  method: "wallet_sendCalls",
  params: [{
    version: "1.0",
    chainId: "0x2105",
    from: userAddress,
    calls: [{
      to: "0x1234567890123456789012345678901234567890",
      value: "0x0",
      data: "0xa9059cbb000000000000000000000000..."
    }],
    capabilities: {
      dataSuffix: {
        value: "0x1234567890abcdef1234567890abcdef",
        optional: true
      }
    }
  }]
});
```

```json Capability Response (Supported) theme={null}
{
  "0x2105": {
    "dataSuffix": {
      "supported": true
    }
  }
}
```

```json Capability Response (Unsupported) theme={null}
{
  "0x2105": {
    "dataSuffix": {
      "supported": false
    }
  }
}
```

## Error Handling

| Code | Message | Description |
| - | - | - |
| 4100 | Data suffix not supported | Wallet does not support data suffix functionality |
| 5700 | DataSuffix capability required | Transaction 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](https://docs.base.org/specifications/builder-codes/overview#base-builder-codes) attribution. Builder Codes are unique identifiers that allow apps to receive attribution for onchain activity they generate.

```typescript Builder Codes Attribution lines wrap expandable theme={null}
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](https://base.dev) to get your Builder Code for proper attribution.

## Best Practices

1. **Use with Builder Codes**: Register on [base.dev](https://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

> [!NOTE]
>
> For wallet developers implementing `dataSuffix` support, see [Builder Codes for Wallet Developers](https://docs.base.org/specifications/builder-codes/for-wallet-developers).

## Related Capabilities

* [paymasterService](https://docs.cdp.coinbase.com/coinbase-wallet/reference/core/capabilities/paymasterService.md) - Combine with sponsored transactions
* [atomic](https://docs.cdp.coinbase.com/coinbase-wallet/reference/core/capabilities/atomic.md) - Use with atomic batch transactions
