Overview

When creating or fulfilling Seaport orders via the OpenSea SDK, you can now pass in an optional string domain parameter that will attribute the order to a particular aggregator or marketplace. The SDK will hash the domain and extract the first four bytes of the hash — these four bytes represent the domain’s “tag.”

Tags are on-chain labels that, when provided, indicate either the marketplace where an order was created or where it was fulfilled:

If the domain is passed in at order creation, the tag is added to the first four bytes of the order salt.

If the domain is passed in at order fulfillment, the tag is added to the last four bytes of fulfillment calldata.

For instance, OpenSea’s domain (”opensea.io”) produces a tag of 360c6ebe; all orders created on OpenSea store this tag in the first four bytes of their salt, and all orders fulfilled on OpenSea store this tag in the last four bytes of their calldata.

Supplying a Domain via the SDK (seaport-js or opensea-js)

Adding tags to order salts:

  1. Pass in the domain as an argument to any of the following functions:
    1. createOrder() in seaport-js
    2. createBuyOrder() or createSellOrder in opensea-js
  2. The tag is extracted from the first 4 bytes of the hash of the domain.
  3. The tag is then added to the first 4 bytes of the 32-byte salt.
    1. The next 20 bytes are empty, while the last 8 bytes of the salt are random.
    2. If no domain is supplied, the salt consists of 24 empty bytes, followed by 8 random bytes.

Adding tags to fulfillment calldata:

  1. Pass in the domain as an argument to any of the following functions:
    1. fulfillOrder(), fulfillOrders(), fulfillAvailableOrders(), or matchOrders() in seaport-js
    2. fulfillOrder() or fulfillPrivateOrder() in opensea-js
  2. The tag is extracted from the first 4 bytes of the hash of the domain.
  3. The tag is then appended to the end of calldata before the call to the Seaport contract.

Adding tags to miscellaneous transactions: