Thème
Build on X Layer

Builder Codes#

Attribute onchain activity to your app or wallet with Builder Codes on X Layer.

What Are Builder Codes#

X Layer Builder Codes are an ERC-721 NFT collection where unique 16-character codes (e.g. 8k3m1v0q7z2c9a5x) identify builders onchain. Each code has a "payout address" in its metadata — this is where potential rewards are sent.

Builder Codes give you:

  • Rewards: Attribute transactions back to your app and unlock rewards as the program expands.
  • Analytics: Track onchain usage, user acquisition, and conversion metrics in the OKX developer portal.
  • Visibility: Apps with Builder Codes can appear in discovery surfaces like App Leaderboards and ecosystem spotlights.

Get your Builder Code: Go to the OKX developer portal, verify your address, then create your Builder Code on the Builder Code page.

How It Works#

When a transaction is sent, an ERC-8021 attribution suffix is appended to the end of the calldata. The suffix contains your Builder Code and is extracted by offchain indexers — it does not affect contract execution. No smart contract changes are required.

The suffix adds negligible gas: 16 gas per non-zero byte.

Wallets that support the dataSuffix capability append it to calldata before signing. EOAs and ERC-7702 smart wallets are supported. ERC-4337 user operations are not yet supported.

Note: Automatic Builder Code injection is not yet available in OKX Wallet. You need to configure dataSuffix in your app as described in the integration guide.

Get Started#

App developers

  1. Go to the OKX developer portal, verify your address, then create your Builder Code on the Builder Code page.
  2. Follow the Integration Guide to add attribution to your app.

Wallet providers

See the Wallet Provider Guide.

Verify Attribution#

Option 1 — OKLink Explorer

  1. Find your transaction on OKLink.
  2. Open the input data field.
  3. Verify the last 16 bytes are the 8021 repeating pattern, and check the decoded attribution data for your Builder Code.

Option 2 — Open Source Tool

  1. Open the Builder Code Validation tool.
  2. Copy and paste the transaction input data.
  3. Click Check Attribution.

Builder Code Contracts#