Introduction

Hi, I'm cardene, a software engineer and technical writer focused on blockchain and AI.

I've also authored Japanese technical books on specification-driven development with LLMs and decentralized application (DApp) development.

I also build and publish a variety of tools, libraries, and open-source projects.

This article examines ERC4910, a proposed standard for managing NFT royalty accounts, balances, payouts, and sales.

This explanation translates, summarizes, and expands on the following specification.

I have also written about other ERCs.

Overview

The proposal extends the ERC721 smart contract model by associating NFTs with royalty accounts. Its objective is to prevent centralized intermediaries from manipulating or bypassing payments owed to rights holders within the defined transaction workflow.

For more about ERC721, see the following article.

https://chaldene.net/erc721

The proposal builds on the OpenZeppelin Smart Contract Toolbox architecture. It adds royalty-account CRUD operations, balance and payout management, and basic trading functions such as listing, delisting, and purchasing NFTs. It also provides mechanisms for tracking exchange-mediated sales. Royalty accounts can form hierarchical structures called royalty trees. A parent NFT can be linked to child NFTs, which can recursively have children of their own.

The proposal associates ERC721-style NFTs with royalty entitlements to facilitate transparent payment allocation. Its architecture extends the OpenZeppelin contract model with royalty-account management, balances, payouts, trading, and exchange transaction tracking.

Motivation

Royalty management is a longstanding problem involving complex agreements, limited transparency, and potential fraud.

The challenges are particularly apparent in hierarchical royalty structures. One or more assets may derive from an original asset, such as prints of a painting, music incorporating an earlier composition, or distribution rights and compensation managed through several partners.

In the following example, the artist who created the original work is entitled to a share of proceeds from the sale and resale of its prints.

eip-4910-print-families.png Source: https://eips.ethereum.org/EIPS/eip-4910

The following diagram illustrates the basic idea of hierarchical royalties based on ancestry.

eip-4910-royalties.png Source: https://eips.ethereum.org/EIPS/eip-4910

Royalties from derivative assets, such as prints, can be allocated to parties associated with their ancestral assets, such as the original artwork. For example, the original artist may receive a specified share whenever a print is sold or resold through the supported mechanism. This establishes a hierarchical royalty relationship between an asset and its derivatives.

Sales of descendant assets can allocate royalties to the specified creators and other beneficiaries according to the configured rules.

Here, an ancestor means an NFT higher in the derivation tree, not a previous owner of the same NFT.

The proposal introduces an approach to resolving complex hierarchical royalty inheritance. For a tree of depth N, it decomposes the recursive problem into individual layers. This supports traversal from the bottom layer toward the root.

Traversal Traversal means visiting elements of a data structure or tree. It involves following relationships within the structure and performing the required operations. Here, traversal proceeds upward through the royalty hierarchy, performing the required calculations at each level.

This can help creators and distributors of derivative works receive a share of revenue. NFTs may consequently represent economic entitlements in addition to their other attributes.

The proposed method divides the royalty tree into layers and processes royalty allocation at each layer. This allows participants to manage their shares according to the configured hierarchy. The authors expect these mechanisms to support additional economic uses for NFTs.

Specification

Overview

This section introduces concepts extending the ERC721 model.

  • Royalty account (RA)
    • A royalty account is associated with an NFT through its unique tokenId.
    • An RA contains subaccounts representing individual beneficiaries or other royalty accounts.
    • Each RA has an account identifier.
  • Account type
    • Indicates whether an RA subaccount represents an individual beneficiary or another RA.
    • If a subaccount represents another RA, its allocated amount must be redistributed among that RA's subaccounts.
  • Royalty split
    • Specifies the proportion of NFT sale proceeds allocated to each RA subaccount.
  • Royalty balance
    • Represents the aggregate royalty balance associated with an RA.
  • Subaccount royalty balance
    • Represents the royalty balance of an individual RA subaccount.
    • Only individual-beneficiary accounts can retain payable balances. A subaccount representing another RA must ultimately have a zero balance after redistribution.
  • Token type
    • Identifies a supported payment asset, such as ETH or DAI.
  • Asset ID
    • The tokenId of the NFT associated with the RA.
  • Parent
    • Identifies the immediate parent of the NFT associated with the RA.

Data structures

  • Royalty accounts and subaccounts
    • Each NFT has an RA containing one or more subaccounts.
    • Subaccounts represent individuals or other royalty accounts and have associated identifiers.
  • Association between token IDs and royalty-account identifiers
    • Associates each NFT's tokenId with its royalty-account identifier.
  • Parent-child NFT mapping
    • Records relationships between parent NFTs and their immediate children.
    • This allows the NFT hierarchy to be traversed.
  • Supported payment tokens and last observed balances
    • Records payment-token types, such as ETH, and their last observed balances.
    • Tracks information relevant to sales and royalty payments.
  • Registered payments
    • Records payments processed through executePayment for subsequent verification in safeTransferFrom.
    • Remove a payment record after successful settlement and distribution.
  • NFT sale listings
    • Allows authorized user addresses to list NFTs for direct purchases outside an exchange.

Royalty-account functions

  • Royalty-account RUD (Read, Update, Delete) functions and interfaces
    • Define operations for reading, updating, and deleting royalty accounts.
    • RAs are created during minting, so a separate creation function is unnecessary.

Minting NFTs with royalties

Minting creates the corresponding RA and associates it with the NFT, its beneficiary, and any applicable ancestral RAs. The proposed mint function uses ERC721's _safeMint mechanism and applies business rules to its inputs.

Listing and delisting NFTs

Authorized users can list NFTs for direct sale and remove listings when permitted. This supports management of direct purchases and sales.

Payments from buyers to sellers

The payment workflow differs between native ETH and ERC20 payment assets.

ERC20 payments
  1. The buyer grants the NFT contract an allowance on the selected ERC20 token contract for the purchase price.
    • This authorizes the NFT contract to collect the necessary tokens from the buyer.
  2. The buyer calls executePayment on the NFT contract.
    • The NFT contract processes the purchase using the selected ERC20 token.
    • The buyer initiates the payment through the NFT contract, which interacts with the ERC20 contract to collect the funds.
Native-token payments
  • When using the native protocol token, the buyer sends ETH to the NFT contract.
    • The transaction calldata encodes the purchased NFT IDs as a uint256[], together with the required payment information.

Requiring payment to the NFT contract rather than directly to the seller is intended to prevent royalty avoidance within the supported sale workflow. Seller proceeds are allocated through royalty accounting and can subsequently be withdrawn.

Modified NFT transfer function carrying royalty payment data

The modified transfer function enforces the payment and royalty-allocation conditions before completing the sale. It also supports transactions involving multiple NFTs. The required stages are described below.

Validate inputs

Validate the input parameters before processing the transfer. Reject transfers with invalid data.

Validate payment parameters

Verify that the buyer's payment satisfies the requirements. The payment is made to the NFT contract and allocated to the seller through royalty accounting.

Allocate royalties

Once the payment is verified, allocate the proceeds according to the configured royalty splits. This accounts for the hierarchy of royalty accounts associated with the NFT and its ancestors.

Pay the outgoing beneficiary and update the royalty-account ownership

Settle the outgoing beneficiary's balance and update the relevant subaccount to the incoming beneficiary.

Transfer the NFT's beneficial control

After allocation, transfer beneficial control of the NFT to the purchaser through the proposal's approval-based ownership model. This establishes the new beneficiary while the NFT contract remains the ERC721-recorded owner.

Remove the registered payment after successful transfer

Remove the corresponding registeredPayment entry after settlement succeeds. This prevents reuse of the same registered payment.

The distribution mechanism decomposes the connected royalty-account hierarchy into layers, following NFT ancestry until it reaches the root RA. This supports allocation according to the configured splits.

Royalty payout to the outgoing beneficiary in safeTransferFrom

The following describes the payout mechanism. There are public and internal versions of the payout function.

The public function interface is shown below.

javascript
function royaltyPayOut(uint256 tokenId, address RAsubaccount, address payable payoutAccount, uint256 amount) public virtual nonReentrant returns (bool)

The function accepts tokenId, the RA subaccount address, payoutAccount, and amount. The proposed function is protected against reentrancy using nonReentrant.

Payout processing involves the following steps.

  1. Locate the subaccount using RAaccount and subaccountPos.
    • Retrieve its royalty balance.
  2. Retrieve the subaccount's tokenType.
    • This identifies the payment asset.
  3. Withdraw the specified amount from the subaccount and send it to payoutAccount.
    • The amount must not exceed the available balance.

These steps implement payouts to the authorized beneficiary.

Data structures

Royalty accounts and royalty subaccounts

Extend the ERC721 data model with connected structures linking NFTs and royalty accounts and supporting efficient lookups.

[R1]

One or more royalty subaccounts must be associated with an RA.

[R2]

Each RA's raAccountId must be unique. Different accounts must not share an identifier.

[R3]

Associate the NFT's tokenId with its corresponding raAccountId. This links each NFT to its royalty account.

Identifying child NFTs

Manage parent-child relationships and applicable constraints at each level. Maintain links between parent NFTs and their immediate children.

[R4]

A direct parent-child link is required.

NFT payment tokens

The NFT contract must participate in sales in order to allocate royalties. It needs payment information and a mechanism identifying supported payment assets.

[R5]

Maintain a list of supported token types. The NFT contract must identify which assets are accepted.

The contract tracks the last observed balances of supported payment assets for royalty distribution, payouts, and sales.

[R6]

Maintain references to the last observed balances of allowed tokens held by the contract. Track each payment asset's balance for use in the relevant accounting operations.

NFT listings and payments

Because the contract participates in the sale process, it needs a mechanism for listing one or more NFTs.

[R7]

Maintain a list of NFTs offered for sale. This identifies the assets available for direct purchase.

[R8]

Each listing must have a unique identifier. The identifier distinguishes individual listings.

The contract must manage sales in addition to listings. This includes registering payments for immediate settlement or later execution, such as in an auction.

[R9]

Maintain a list of registered payments. It records payments awaiting settlement.

[R10]

Each registered payment must have a unique identifier. This distinguishes one payment record from another.

Constructor, global variables, and update functions

The proposal extends the ERC721 constructor and adds global configuration to account for creator roles and the contract's participation in sales and royalty management.

[R11]

The minimum constructor includes the following inputs.

javascript
///
/// @dev Definition of the contract constructor
///
/// @param name as in ERC-721
/// @param symbol as in ERC-721
/// @param baseTokenURI as in ERC-721
/// @param allowedTokenTypes is the array of allowed tokens for payment

constructor(
    string memory name,
    string memory symbol,
    string memory baseTokenURI,
    address[] memory allowedTokenTypes
) ERC721(name, symbol) {...}

Royalty-account management

This section describes the management of royalty accounts.

Royalty accounts are created during NFT minting. A separate account-creation function is therefore unnecessary.

Retrieving a royalty account

Retrieve a royalty account and its subaccounts using the token ID referenced by the royalty account's ancestry information. One retrieval function is sufficient.

[R12]

The getRoyaltyAccount interface is shown below.

javascript
/// @dev Function to fetch a Royalty Account for a given tokenId
/// @param tokenId is the identifier of the NFT to which a Royalty Account is attached
/// @param RoyaltyAccount is a data structure containing the royalty account information
/// @param RASubAccount[] is an array of data structures containing the information of the royalty sub accounts associated with the royalty account

function getRoyaltyAccount (uint256 tokenId) public view virtual returns (address,
    RoyaltyAccount memory,
    RASubAccount[] memory);

It returns the royalty account associated with the specified tokenId, including its subaccounts. This allows account information to be read.

[R13]

The following business rule applies to getRoyaltyAccount.

  • The tokenId must exist and must not have been burned.

Check this condition when calling getRoyaltyAccount. The specified NFT must still exist. The described retrieval interface does not permit retrieval for a burned NFT. This constrains retrieval to valid existing tokens.

Updating a royalty account

To update an RA, the caller supplies both the token ID and the account information. These inputs specify changes to the existing royalty account.

[R14]

The updateRoyaltyAccount interface is defined below.

javascript
/// @dev Function to update a Royalty Account and its Sub Accounts
/// @param tokenId is the identifier of the NFT to which the Royalty Account to be updated is attached
/// @param RoyaltyAccount is the Royalty Account and associated Royalty Sub Accounts with updated values  

function updateRoyaltyAccount (uint256 _tokenId, `RoyaltyAccount memory _raAccount) public virtual returns (bool)

This function updates the royalty-account information associated with an NFT. Supply the NFT's tokenId and the revised account data (_raAccount). Authorized beneficiaries can modify their royalty-account configuration subject to the following restrictions.

[R15]

The update business rules are as follows.

  1. NFT asset identifier

    • The NFT's token ID cannot change.
  2. NFT ancestry

    • Ancestry information cannot change.
  3. Accepted payment token type

    • The NFT's accepted payment asset cannot change.
  4. Royalty subaccount balances

    • Existing royalty balances cannot be modified through the configuration update.
  5. Inherited parent-to-child royalty split

    • The royalty split inherited from the parent cannot change.
  6. New royalty split values

    • Each new value must satisfy the applicable configured lower or upper bounds, where present.
  7. Number of royalty subaccounts

    • The total number of existing and newly added subaccounts must not exceed the configured limit, if any.
  8. Sum of all royalty splits

    • The total split must always equal one, or its scaled numerical representation.
  9. msg.sender

    • msg.sender must match the account identifier of an eligible subaccount of the account being updated; that subaccount must not represent the parent NFT.
    • The caller's subaccount must not be deleted.
    • The caller's royalty share may only decrease, with other existing shares increasing as needed to keep the total equal to one or its scaled representation.
      • Alternatively, add one or more subaccounts under rule 10.
    • Existing royalty balances must remain unchanged.
    • Account identifiers must not be null.
  10. When msg.sender matches a royalty subaccount identifier

    • When the caller reduces its royalty share to allocate part of it to new subaccounts, the new subaccounts must have zero starting balances, and the redistributed shares, including the caller's remaining share, must equal the caller's previous share.
    • New account identifiers must not be null.
  11. Successful account update

    • Return true for a successful update and false otherwise, according to the described interface.

Deleting a royalty account

Deleting an RA may be useful in some cases but can be expensive in gas. Use deletion only when the following conditions are satisfied.

[R16]

The deleteRoyaltyAccount interface is defined below.

solidity
/// @dev Function to delete a Royalty Account
/// @param tokenId is the identifier of the NFT to which the Royalty Account to be updated is attached

function deleteRoyaltyAccount (uint256 _tokenId) public virtual returns (bool)
[R17]

The function's business rules are as follows.

  • The specified _tokenId must have been burned.
    • There must be no current owner, represented by a zero owner value in the applicable storage model.
  • The NFT identified by _tokenId must be burned and have no owner.
    • All associated ancestral and descendant token IDs must also have been burned, under the described deletion conditions.
  • All royalty subaccount balances must be zero.

The account cannot be deleted unless these conditions hold.

Minting NFTs

In addition to ERC721 minting, create the relevant royalty account and subaccounts during NFT issuance. Establish structures enforcing constraints such as the maximum number of child NFTs.

[R18]

Associate the newly minted NFT with its royalty account, subaccounts, and beneficiary. If the NFT has ancestors, establish the links to the relevant ancestral royalty accounts. These relationships support subsequent allocation of royalties.

[D1]

The mint function should support minting multiple NFTs in one call. This enables batch minting.

[R19]

The NFT contract itself is the ERC721-recorded owner of newly minted tokens. This unusual ownership model allows the contract to mediate payment and royalty accounting as escrow.

[R20]

The external beneficiary is represented by an approved address rather than by ERC721 ownerOf. That address can perform the operations permitted by the proposed model. This associates the beneficiary with payment and royalty accounting.

[R21]

Use a compact input structure while accounting for token-specific metadata. This supports efficient minting.

javascript
/// @param parent is the parent tokenId of the (child) token, and if set to 0 then there is no parent.
/// @param canBeParent indicates if a tokenId can have children or not.
/// @param maxChildren defines how many children an NFT can have.
/// @param royaltySplitForItsChildren is the royalty percentage split that a child has to pay to its parent.
/// @param uri is the unique token URI of the NFT
[R22]

The mint interface is defined below.

javascript
/// @dev Function creates one or more new NFTs with its relevant meta data necessary for royalties, and a Royalty Account with its associated met data for `to` address. The tokenId(s) will be automatically assigned (and available on the emitted {IERC-721-Transfer} event).
/// @param to is the address to which the NFT(s) are minted
/// @param nfttoken is an array of struct type NFTToken for the meta data of the minted NFT(s)
/// @param tokenType is the type of allowed payment token for the NFT

function mint(address to, NFTToken[] memory nfttoken, address tokenType) public virtual
[R23]

The input business rules specify the conditions for minting. They are as follows.

  • Number of tokens to mint
    • The requested mint quantity must be at least one.
    • At least one NFT must be minted.
  • Roles
    • The caller must have MINTER_ROLE or CREATOR_ROLE, which identifies the creator of the initial NFT.
  • Destination address
    • to must not be the zero address.
    • Supply a valid nonzero recipient.
  • Contract destination addresses
    • If the recipient is a contract, it must be allowlisted under the described policy.
  • tokenType
    • tokenType must be supported by the contract.
    • The specified payment asset must be accepted.
  • royaltySplitForItsChildren
    • royaltySplitForItsChildren must not exceed 100%, or its numerical equivalent, subject to constraints such as platform fees.
  • NFTs that cannot have children
    • Set royaltySplitForItsChildren to zero if no child NFTs are permitted.
  • NFTs with a parent
    • The parent token ID must exist.
  • Parent ancestry level
    • The parent's level must be below the configured maximum generation count.
    • This keeps the new NFT within the permitted hierarchy depth.
  • Permitted child count
    • The permitted number of children for a minted NFT must satisfy the configured maximum-child constraint.

Validate mint inputs according to these rules.

Listing and delisting NFTs for direct sale

Distinguish at least two types of sales.

  1. Exchange-mediated sales
  2. Direct sales

For exchange-mediated sales, the NFT contract does not need to maintain the external exchange listing. The exchange initiates the required payment and transfer transactions with the NFT contract. Direct sales require the NFT contract to mediate the individual stages.

[R24]

Listing and delisting for direct sale take place through the NFT contract.

Authorized beneficiary addresses can list NFTs for sale. The following business rules apply.

[R25] The listNFT interface must follow this definition
javascript
/// @dev Function to list one or more NFTs for direct sales
/// @param tokenIds is the array of tokenIds to be included in the listing
/// @param price is the price set by the owner for the listed NFT(s)
/// @param tokenType is the payment token type allowed for the listing

function listNFT (uint256[] calldata tokenIds, uint256 price, address tokenType) public virtual returns (bool)

The Boolean return value is true on success and false on failure.

[R26]

The listNFT business rules are as follows.

  • None of the NFTs in the proposed listing may already have a listing.
    • Check that no listed NFT is duplicated in an existing listing.
  • For every NFT in the listing, seller must equal getApproved(tokenId[i]).
    • This verifies the seller's authority under the approval-based beneficiary model.
  • The contract must support tokenType.
    • Verify that the selected payment asset is accepted.
  • price must be greater than zero.
    • Reject a zero or invalid listing price.
[R27]

When the conditions in [R26] are satisfied, update the NFT listing records.

[R28]

The removeNFTListing interface must follow this definition.

solidity
/// @dev Function to de-list one or more NFTs for direct sales
/// @param listingId is the identifier of the NFT listing

function removeNFTListing (uint256 listingId) public virtual returns (bool)

The Boolean return value is true on success and false on failure.

[R29] Business rules for removeNFTListing
  • There must be no registered payment for the listing.
    • Check that an outstanding payment record does not exist.
  • msg.sender must equal getApproved(tokenId) for the relevant listed NFTs.
    • Verify authorization to remove the listing.
[R30]

When the conditions in [R29] are satisfied, remove the listing.

NFT sale payments

[R31]

The buyer pays the NFT contract directly rather than paying the seller. Seller proceeds are allocated through royalty accounting, with a later payout to the seller's wallet.

Payment requires one or two steps.

  • ERC20 payments
    • The buyer authorizes the NFT contract to spend the purchase price in the selected ERC20 token.
    • The buyer calls executePayment.
  • Native protocol-token payments
    • The buyer calls the payable fallback with nonempty msg.data containing the required information.
[R32]

For ERC20 payment assets, the executePayment interface follows this definition.

javascript
/// @dev Function to make a NFT direct sales or exchange-mediate sales payment
/// @param receiver is the address of the receiver of the payment
/// @param seller is the address of the NFT seller 
/// @param tokenIds are the tokenIds of the NFT to be bought
/// @param payment is the amount of that payment to be made
/// @param tokenType is the type of payment token
/// @param trxnType is the type of payment transaction -- minimally direct sales or exchange-mediated

function executePayment (address receiver, address seller, uint 256[] tokenIds, uint256 payment, string tokenType, int256 trxnType) public virtual nonReentrant returns (bool)

The Boolean result is true on success and false on failure.

[R33]

Regardless of transaction type (trxnType), the following input business rules apply.

  1. All NFTs in tokenIds must exist and must not have been burned.
  2. The selected tokenType must be supported.
  3. trxnType must be 0 for direct sales, 1 for exchange-mediated sales, or another supported type.
  4. The original description distinguishes a null receiver from the zero address; a concrete Solidity implementation must define its optional-receiver encoding consistently and reject invalid destination addresses.
  5. seller must match the applicable listing address.
  6. The caller must not be a contract unless allowlisted by the NFT contract, under the described policy.
[R34]

For trxnType = 0, validate payment information against the listing as follows.

  1. The NFTs must be listed.
  2. The payment must be at least the listing price.
  3. The listed NFTs must match those in the payment data.
  4. The seller must control the listed NFTs.
[R35]

If [R33] and [R34] pass, executePayment collects payment in the selected ERC20 token into address(this). The original text calls this transfer, but spending the buyer's allowance requires transferFrom or an equivalent authorized token operation.

Note The NFT contract uses the allowance granted by the buyer to collect payment.

[R36]

For trxnType = 1, register successful payment information in registeredPayment, returning true on success and false otherwise according to the interface.

[R37]

For trxnType = 0, invoke the internal safeTransferFrom implementation. On success, grant the buyer MINTER_ROLE if the buyer does not already have it, as specified by the proposed business rules.

Note The proposed internal _safeTransferFrom has the same general structure but omits input checks already performed by the caller; its use must be restricted to validated internal paths.

[R38]

For direct sales, remove the listing after a successful transfer.

[R39]

When using the native protocol token, the buyer sends payment to the NFT contract as escrow, with msg.data encoding the paid-for NFT IDs (uint256[] tokenIds) and other required fields.

[R40]

Implement a payable fallback function (fallback() external payable) to receive these payments.

Note The payment must identify the NFTs being purchased, so a simple empty-calldata receive path is insufficient. A payable fallback can accept and decode nonempty calldata.

[R41]

The fallback's calldata must contain at least the following information.

  • address seller
  • uint256[] _tokenId
  • address receiver
  • int256 trxnType
[R42]

Revert if trxnType is neither 0, 1, nor another supported type.

[R43]

For types 0 and 1, satisfy the applicable requirements [R33] through [R38]; otherwise revert.

[R44]

The proposal requires a mechanism to reverse an unsettled payment after a failed direct sale or when the buyer withdraws from an exchange-mediated purchase before settlement. The function interface is shown below.

javascript
/// @dev Definition of the function enabling the reversal of a payment before the sale is complete
/// @param paymentId is the unique identifier for which a payment was made
/// @param tokenType is the type of payment token used in the payment
function reversePayment(uint256 paymentId, string memory tokenType) public virtual returns (bool)
[R45]

The reversePayment business rules are as follows.

  • A registered payment must exist for the specified paymentId and tokenType.
    • Verify that the payment record exists.
  • msg.sender must match the buyer address in the registered payment.
    • Only the recorded buyer may request the reversal.
  • The payment amount must be greater than zero.
    • A refund requires a positive amount.
    • If payment is absent or zero, the reversal fails.
  • Delete the registered payment after a successful reversal.
    • Remove its stored information on success.
    • If the reversal fails, retain the record.

Because reversePayment handles funds, appropriate reentrancy protection such as OpenZeppelin's nonReentrant is strongly recommended, together with safe accounting.

Modified NFT transfer function

The proposal modifies the ERC721 safeTransferFrom function as described below.

javascript
function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory _data) external virtual override
Satisfying the requirements

Complete the NFT sale only after the royalties have been allocated as required. The proposed workflow also supports multiple NFTs, although ERC721's standard transfer interface identifies a single token. Use the first NFT's token ID in the ordinary parameter and encode additional transaction data in _data.

High-level requirements

The transfer workflow has the following requirements.

  • Validate the payment parameters encoded in _data.
  • The seller and the NFTs must exist, and the seller must have the required beneficial control under the proposal's ownership model.
  • The caller must be the seller or otherwise authorized.
  • Allocate the payment received by the NFT contract to the eligible royalty subaccounts.
  • Complete the transfer of beneficial control only after the appropriate subaccounts have been credited.
Preventing royalty avoidance

The proposed design allows only the designated sale-transfer entry point to prevent bypassing its royalty workflow. This enforces the configured allocation rules for supported sales, but cannot prevent every form of off-chain exchange.

[R46]

Disable transferFrom and the overload of safeTransferFrom without data. For example, override these functions to revert. This prevents token movement through those entry points.

[R47]

The function's input requirements are as follows.

  • from must not be address(0).
    • Supply a valid nonzero address.
  • from must have the required ownership or approval authority for tokenId and the other tokens encoded in _data.
  • from must not be a contract unless allowlisted under the described policy.
    • A contract address must be expressly permitted.
  • Every token in the operation must have an associated royalty account.
  • _data must not be null or empty.
    • It must contain valid transaction data.
  • The caller must equal from, have the required approval, or be an allowlisted contract as permitted by the design.

Note The source highlights calls from contracts under construction as a limitation of code-presence checks. Other contract-account and delegation patterns must also be considered; such checks do not reliably establish that an address is controlled only by an EOA.

[R48]

The _data object must contain at least the following payment information.

  • Seller address (seller).
    • Type: address.
  • Buyer address (buyer).
    • Type: address.
  • Recipient address (receiver).
    • Type: address.
  • Token identifiers (tokenId).
    • Type: uint256[].
  • Payment-token type (tokenType).
    • Type: uint256.
  • Amount paid to the NFT contract (payment).
    • Type: uint256.
  • Registered payment identifier.
  • Chain identifier (block.chainid).
[R49]

The encoded payment information must satisfy the following business rules.

  • seller must equal from.
  • tokenId[0] must match the first token ID supplied to the transfer function.
  • Each token in the supplied list must have an associated royalty account.
  • The supplied chain ID must equal block.chainid.
  • buyer must match the buyer in the registered payment identified by paymentId.
  • receiver must equal to.
  • The token recipient must not be the seller.
  • The recipient must not be a contract unless allowlisted.
  • Each tokenId[i] must match registeredPayment[paymentId].boughtTokens[i].
  • The payment token type must be supported.
  • allowedToken[tokenType] must not be null.
  • tokenType must equal registeredPayment[paymentId].tokenType.
  • The source lists a comparison against lastBalanceAllowedToken[allowedToken[listingId]]. This expression is ambiguous as a payment-validity check; implementations must verify actual received funds and consistent token accounting rather than rely on it without review.
  • payment must equal registeredPayment[paymentId].payment.

These checks are intended to bind the transfer to the corresponding payment and prevent inconsistent settlement.

Royalty allocation within the transfer function

[R50]

The distributePayment function decomposes hierarchical royalty accounts and processes allocations layer by layer.

javascript
/// @dev Function to distribute a payment as royalties to a chain of Royalty Accounts
/// @param tokenId is a tokenId included in the sale and used to look up the associated Royalty Account
/// @param payment is the payment (portion) to be distributed as royalties

function distributePayment (uint256 tokenId, uint265 payment) internal virtual returns (bool)

It follows the ancestry relationship from the NFT through connected royalty accounts to the root.

Use the given tokenId to identify its royalty account and allocate payment. The internal function returns a Boolean result. It returns true on success and false on failure.

Calculate each allocated amount using the payment and applicable royalty split. Multiply the relevant payment portion by the royalty rate and divide by the scale representing 100%. Account for overflow, underflow, precision, and rounding. This supports accurate allocation according to the configured shares.

The allocation function is central to the sale mechanism and requires careful arithmetic and security review.

[R51]

The proposed distributePayment logic is as follows.

  1. Load the RA associated with the supplied token ID and its subaccounts.

  2. Apply the following rules to each subaccount.

    • If isIndividual is true:
      1. Apply its royalty rate to the payment and add the resulting amount, for example royaltyAmountTemp, to its royaltybalance.
      2. Emit the payment-related event with assetId, accountId, tokenType, and royaltybalance.
      3. Add royaltyAmountTemp to the RA's aggregate balance.
    • If isIndividual is false:
      1. Apply the royalty rate to the payment and store the resulting amount temporarily, for example as RApaymenttemp, leaving this non-individual subaccount's royaltybalance at zero.
      2. Follow the ancestor relationship to the associated RA, for example through the Royalty Account mapping.
      • Load the next RA.
    • Apply the individual-account rule to individual subaccounts in that RA.
    • Recursively apply the non-individual-account rule to subaccounts representing other RAs.
  3. Repeat until reaching an RA with no ancestor and only individual subaccounts.

    • Apply the individual-account rule to each of its subaccounts.

The procedure allocates proceeds through the configured royalty hierarchy.

Updating subaccount ownership and paying the outgoing beneficiary

[R52]

To simplify the transfer, first pay the outgoing beneficiary represented by the approved from address its applicable royalty balance. Then update the relevant royalty subaccount to the incoming beneficiary to. Repeat for each NFT included in the transfer.

The business rules in [R52] are as follows.

  • The internal royaltyPayOut mechanism pays the entire relevant subaccount royalty balance to from.
    • This settles amounts accrued to the outgoing beneficiary.
  • Change the subaccount beneficiary to to only after payout succeeds and its royaltybalance is zero.
    • Future royalties for that share accrue to the new beneficiary.
[R53]

The final step is to assign beneficial control of the purchased NFT to to.

The business rules in [R53] are as follows.

  • For each purchased NFT, set to as the approved address using the ERC721 approval mechanism.
    • In the proposed design, this changes the beneficiary controlling the NFT.
  • The NFT contract remains the ERC721-recorded owner.
    • Thus ordinary ownerOf does not report the purchaser as owner; the approved address represents beneficial control in this model.

Removing the registered payment after successful settlement

After the approved address has been updated successfully, remove the payment record so the NFT can be offered for sale again.

[R54]

Delete registered payment information after successful assignment to to. This completes settlement and allows subsequent listings. Removing the used record prevents reuse of that payment for another transfer.

Royalty payouts to the sending address in safeTransferFrom

[R55]
  • royaltyPayOut exposes the public payout interface.
  • It allows an authorized subaccount beneficiary to request payment to a specified recipient.
  • The function uses reentrancy protection and returns true on success.
    • It returns false on failure according to the described interface.
  • Inputs include tokenId, RAsubaccount, payoutAccount, and amount.
  • Execution must satisfy the applicable authorization and balance conditions.
[R56]
  • The following requirements apply to the inputs of royaltyPayOut.
  • msg.sender must match RAsubaccount.
  • The token ID must exist and must not have been burned.
  • The token ID must have an associated royalty account.
  • RAsubaccount must be a valid accountId within that royalty account.
  • The subaccount's isIndividual must be true.
  • amount must not exceed the subaccount's royaltybalance.
  • Reject the operation if the conditions are not satisfied.
[R57]
  • The internal _royaltyPayOut function accepts similar inputs and implements the public payout operation.
  • The payout path must have appropriate reentrancy protection and reports success as true.
    • It reports failure as false under the described convention.
[R58]

The internal _royaltyPayOut operation performs the following actions.

  1. Send the payment to payoutAccount.
  2. Update the relevant subaccount's royalty balance on successful payment. In production, ensure effects and external interactions are ordered safely and failed transfers cannot leave inconsistent accounting.
[R59]

The proposed payout workflow is as follows.

  1. Identify the royalty subaccount.
  2. Retrieve its tokenType.
  3. Send the payment in the corresponding asset to payoutAccount.
    • Depending on the token type, this may be ETH, another native protocol asset, or a supported ERC20 token.
  4. Deduct amount from the subaccount balance upon successful settlement and report true.
    • If payment fails, report false under the described convention and preserve consistent balances.

This workflow supports payouts of recorded royalty balances to authorized recipients.

Additional considerations

NFT royalties often arise from licensing arrangements. Purchasers may obtain rights to content or assets, but the scope of reproduction, modification, and delegation depends on the actual license. The proposal therefore accounts for royalties in hierarchies of assets derived from original works. Its design addresses multilayer inheritance and recursive allocation.

It decomposes the royalty tree of depth N into N layers. This allows traversal from descendant accounts toward the root. The distributePayment mechanism and hierarchical NFT data structures support the traversal. Examples include ancestry, royaltyAccount, and RAsubaccount.

To avoid immediately paying every beneficiary in a large tree, which could exceed the block gas limit, the proposal maintains royalty balances in an accounting system. The system uses royalty-account and subaccount structures with associated management operations. Individual or requested payouts are processed through royaltyPayout.

The NFT contract needs sale and purchase information to allocate royalties. Sales can be mediated directly by the NFT contract or through an intermediary. An intermediary may introduce centralized dependencies. The purchase design accounts for both modes.

For direct sales, allow authorized users to list NFTs so the contract has the necessary sale information. For intermediary-mediated sales, register payment information before completing the purchase.

To prevent bypass of royalty allocation within the designated workflow, require buyers to pay the NFT contract rather than the seller directly. The proposed contract retains the NFT itself as ERC721 owner and represents beneficial control through the approved address.

Payment processing also differs between ETH and ERC20 assets.

For ERC20 payments, the buyer grants the NFT contract an allowance and calls executePayment. The NFT contract coordinates payment by interacting with the ERC20 token contract.

For native-token payments, the buyer sends ETH and the encoded listing and payment information to the NFT contract.

executePayment handles both direct and exchange-mediated sales. A transaction-type indicator distinguishes the two modes.

The payment function coordinates the applicable transfer and purchase-cleanup steps. These include royalty allocation, seller payout, assignment to the recipient, and removal of used listings or payment records.

The proposed design disables ordinary transfer paths to enforce its royalty-payment workflow. It permits the data-bearing safeTransferFrom overload as the designated entry point. Validate its parameters and allocate royalties before completing the sale. The direct and exchange-mediated modes have different settlement sequences.

The proposal also provides for minting and burning NFTs within its modified ownership model. Create and associate royalty accounts during minting. If ancestors exist, establish links to their royalty accounts. The proposed mint function uses _safeMint with additional input business rules.

NFTs with royalty accounts may be burned subject to the specified conditions. Settle royalties associated with the NFT and any descendants. Burn descendants before burning an ancestor where required by the hierarchy rules. Otherwise, the royalty tree could become inconsistent or leave unpaid balances.

Backward compatibility

The proposal retains ERC721-related interface signatures while introducing additional interfaces and altered sale and ownership semantics. The original proposal asserts backward compatibility, but existing integrations may assume that ownerOf identifies the beneficiary and that ordinary transfers are available. These assumptions are not preserved by the described escrow and approval-based model.

Tests

The tests are available in the following GitHub repository.

Reference implementation

The reference implementation is available in the following GitHub repository.

Security considerations

The following describes major security risks and proposed mitigations.

In addition to using security-analysis tools, audit each concrete implementation.

Payment and payout security

Reentrancy

Apply appropriate reentrancy protection to payment and payout paths. OpenZeppelin provides reference implementations of relevant guards.

Payouts requested by unauthorized accounts

At minimum, verify that the caller is authorized for the royalty subaccount whose funds are being withdrawn.

executePayment failure

For exchange-mediated sales, an unsettled payment can be refunded through reversePayment when permitted. For direct sales, the described workflow invokes reversal internally when appropriate; a reverted transaction instead rolls back its state changes.

Royalty avoidance

Off-chain key transfers

  • Risk
    • Beneficial control may be exchanged off-chain through a transfer of control over an account.
  • Mitigation
    • The token contract cannot fully prevent off-chain changes of control. Recognize this limitation and apply suitable operational controls.

NFT control through smart contract wallets

  • Risk
    • A contract wallet can change its controlling parties without changing its address.
  • Mitigation
    • The proposal suggests restricting contract-wallet participation to explicitly permitted cases. Address-code checks alone cannot reliably establish beneficial control.

Denial of royalty settlement

  • Risk
    • Unbounded royalty subaccount counts and descendant structures may exceed available gas during settlement.
  • Mitigation
    • Bound the number of subaccounts per NFT and the applicable royalty-rate parameters.

Listing function resource limits

  • Risk
    • Very large listings can make executePayment exceed practical gas limits.
  • Mitigation
    • Limit the number of NFTs per listing.

Generation count configuration

  • Risk
    • Excessive hierarchy depth can cause royalty distribution to exceed gas limits or fail during execution.
  • Mitigation
    • Enforce a suitable upper bound on maxNumberGeneration.

General considerations

Creators of NFT families should configure parameters carefully for their business model. These include generation depth, subaccount count, number of prints, listing size, and permitted royalty split ranges.

Phishing

NFT phishing can induce a beneficiary to authorize unintended account approvals or other operations.

Mitigation

The proposed ownership model reduces exposure to the particular ordinary-owner approval path described by the source, but it is not immune to phishing. The NFT contract remains the recorded owner, and sales use the designated workflow. The beneficiary changes through an internal _approve operation after purchase. Under the described restrictions, a beneficiary cannot simply grant arbitrary approvals through the ordinary owner-only public approval path.

Phishing may instead target the listing workflow by inducing the beneficiary to list an NFT on unfavorable terms.

Mitigation

Consider a settlement delay with a secure cancellation mechanism, allowing a beneficiary to correct an unintended listing before execution. Additional authentication policies can be integrated into wallet software or an appropriate authorization system. A conventional authenticator application is not itself an on-chain verification mechanism without supporting integration.

These measures can reduce phishing risk but do not guarantee prevention.

References

Andreas Freund (@Therecanbeonlyone1969), "ERC-4910: Royalty Bearing NFTs," Ethereum Improvement Proposals, no. 4910, March 2022. [Online serial]. Available: https://eips.ethereum.org/EIPS/eip-4910.

Conclusion

This article examined ERC4910's proposed mechanisms for NFT royalty accounts, balance management, payouts, and sales. I hope it helped clarify the architecture.

If you have questions, feel free to reach out through Twitter DM.

Twitter @cardene777

I also publish articles on the following platforms.

https://chaldene.net/