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 ERC4393, a proposal for sending ERC20-denominated tips to holders of ERC721 NFTs and ERC1155 tokens.

This article translates, summarizes, and expands on the proposal below.

I have also covered a range of other EIPs.

Overview

ERC4393 defines a contract interface for sending tips (micropayments) to ERC721 NFTs and ERC1155 multi-tokens. Holders (controllers) of the NFTs or multi-tokens can withdraw the tips as ERC20 rewards.

Here, a tip primarily means a micropayment: a small reward associated with a particular NFT or multi-token. The more general term "controller" accommodates NFTs that represent not only digital assets but also non-digital assets or services.

Motivation

The primary objective of ERC4393 is to make tipping NFTs and multi-tokens inexpensive. It defines a gas-efficient tip token contract and provides a tipBatch function for sending multiple tips in a single batch.

The interface is deliberately simple so that it can be integrated into a broad range of applications. Potential use cases include the following.

  • Payments for in-game items and virtual goods.
  • Tips for posts, music, and videos.
  • Donations and crowdfunding.
  • Distribution of copyright revenue.
  • Pay-per-click advertising rewards.
  • Incentives for using services.
  • Reward systems such as loyalty cards and coupons.

These use cases can benefit from blockchain security, timely settlement, and transparency.

Specification

ERC4393 defines a general-purpose mechanism for tipping ERC721 NFTs and ERC1155 multi-tokens through the ITipToken interface. The interface is intentionally minimal to accommodate as many use cases as possible.

Contracts implementing ITipToken must satisfy the following requirements.

  • Implement every function defined by the interface.
  • Emit all required events correctly.
  • Implement the ERC165 supportsInterface function and return true for the applicable interface identifier. The original article lists 0xE47A7022, while the interface comment below lists 0x985A3267; implementers should verify the identifier against the exact function signatures.

Note that the term nft in the code may also refer to fungible ERC1155 tokens.

For more on ERC165, see the following article.

[ERC165] How to check whether a contract supports a specific interface

Interface

ITipToken.sol
interface ITipToken {
    /**
        @dev This emits when the tip token implementation approves the address
        of an NFT for tipping.
        The holders of the 'nft' are approved to receive rewards.
        When an NFT Transfer event emits, this also indicates that the approved
        addresses for that NFT (if any) is reset to none.
        Note: the ERC-165 identifier for this interface is 0x985A3267.
    */
    event ApprovalForNFT(
        address[] holders,
        address indexed nft,
        uint256 indexed id,
        bool approved
    );

    /**
        @dev This emits when a user has deposited an ERC-20 compatible token to
        the tip token's contract address or to an external address.
        This also indicates that the deposit has been exchanged for an
        amount of tip tokens
    */
    event Deposit(
        address indexed user,
        address indexed rewardToken,
        uint256 amount,
        uint256 tipTokenAmount
    );

    /**
        @dev This emits when a holder withdraws an amount of ERC-20 compatible
        reward. This reward comes from the tip token's contract address or from
        an external address, depending on the tip token implementation
    */
    event WithdrawReward(
        address indexed holder,
        address indexed rewardToken,
        uint256 amount
    );

    /**
        @dev This emits when the tip token constructor or initialize method is
        executed.
        Importantly the ERC-20 compatible token 'rewardToken_' to use as reward
        to NFT holders is set at this time and remains the same throughout the
        lifetime of the tip token contract.
        The 'rewardToken_' and 'tipToken_' MAY be the same.
    */
    event InitializeTipToken(
        address indexed tipToken_,
        address indexed rewardToken_,
        address owner_
    );

    /**
        @dev This emits every time a user tips an NFT holder.
        Also includes the reward token address and the reward token amount that
        will be held pending until the holder withdraws the reward tokens.
    */
    event Tip(
        address indexed user,
        address[] holder,
        address indexed nft,
        uint256 id,
        uint256 amount,
        address rewardToken,
        uint256[] rewardTokenAmount
    );

    /**
        @notice Enable or disable approval for tipping for a single NFT held
        by a holder or a multi token shared by holders
        @dev MUST revert if calling nft's supportsInterface does not return
        true for either IERC721 or IERC1155.
        MUST revert if any of the 'holders' is the zero address.
        MUST revert if 'nft' has not approved the tip token contract address as operator.
        MUST emit the 'ApprovalForNFT' event to reflect approval or not approval.
        @param holders The holders of the NFT (NFT controllers)
        @param nft The NFT contract address
        @param id The NFT token id
        @param approved True if the 'holder' is approved, false to revoke approval
    */
    function setApprovalForNFT(
        address[] calldata holders,
        address nft,
        uint256 id,
        bool approved
    ) external;

    /**
        @notice Checks if 'holder' and 'nft' with token 'id' have been approved
        by setApprovalForNFT
        @dev This does not check that the holder of the NFT has changed. That is
        left to the implementer to detect events for change of ownership and to
        take appropriate action
        @param holder The holder of the NFT (NFT controller)
        @param nft The NFT contract address
        @param id The NFT token id
        @return True if 'holder' and 'nft' with token 'id' have previously been
        approved by the tip token contract
    */
    function isApprovalForNFT(
        address holder,
        address nft,
        uint256 id
    ) external returns (bool);

    /**
        @notice Sends tip from msg.sender to holder of a single NFT or
        to shared holders of a multi token
        @dev If 'nft' has not been approved for tipping, MUST revert
        MUST revert if 'nft' is zero address.
        MUST burn the tip 'amount' to the 'holder' and send the reward to
        an account pending for the holder(s).
        If 'nft' is a multi token that has multiple holders then each holder
        MUST receive tip amount in proportion of their balance of multi tokens
        MUST emit the 'Tip' event to reflect the amounts that msg.sender tipped
        to holder(s) of 'nft'.
        @param nft The NFT contract address
        @param id The NFT token id
        @param amount Amount of tip tokens to send to the holder of the NFT
    */
    function tip(
        address nft,
        uint256 id,
        uint256 amount
    ) external;

    /**
        @notice Sends a batch of tips to holders of 'nfts' for gas efficiency
        @dev If NFT has not been approved for tipping, revert
        MUST revert if the input arguments lengths are not all the same
        MUST revert if any of the user addresses are zero
        MUST revert the whole batch if there are any errors
        MUST emit the 'Tip' events so that the state of the amounts sent to
        each holder and for which nft and from whom, can be reconstructed.
        @param users User accounts to tip from
        @param nfts The NFT contract addresses whose holders to tip to
        @param ids The NFT token ids that uniquely identifies the 'nfts'
        @param amounts Amount of tip tokens to send to the holders of the NFTs
    */
    function tipBatch(
        address[] calldata users,
        address[] calldata nfts,
        uint256[] calldata ids,
        uint256[] calldata amounts
    ) external;

    /**
        @notice Deposit an ERC-20 compatible token in exchange for tip tokens
        @dev The price of tip tokens can be different for each deposit as
        the amount of reward token sent ultimately is a ratio of the
        amount of tip tokens to tip over the user's tip tokens balance available
        multiplied by the user's deposit balance.
        The deposited tokens can be held in the tip tokens contract account or
        in an external escrow. This will depend on the tip token implementation.
        Each tip token contract MUST handle only one type of ERC-20 compatible
        reward for deposits.
        This token address SHOULD be passed in to the tip token constructor or
        initialize method. SHOULD revert if ERC-20 reward for deposits is
        zero address.
        MUST emit the 'Deposit' event that shows the user, deposited token details
        and amount of tip tokens minted in exchange
        @param user The user account
        @param amount Amount of ERC-20 token to deposit in exchange for tip tokens.
        This deposit is to be used later as the reward token
    */
    function deposit(address user, uint256 amount) external payable;

    /**
        @notice An NFT holder can withdraw their tips as an ERC-20 compatible
        reward at a time of their choosing
        @dev MUST revert if not enough balance pending available to withdraw.
        MUST send 'amount' to msg.sender account (the holder)
        MUST reduce the balance of reward tokens pending by the 'amount' withdrawn.
        MUST emit the 'WithdrawReward' event to show the holder who withdrew, the reward
        token address and 'amount'
        @param amount Amount of ERC-20 token to withdraw as a reward
    */
    function withdrawReward(uint256 amount) external payable;

    /**
        @notice MUST have identical behaviour to ERC-20 balanceOf and is the amount
        of tip tokens held by 'user'
        @param user The user account
        @return The balance of tip tokens held by user
    */
    function balanceOf(address user) external view returns (uint256);

    /**
        @notice The balance of deposit available to become rewards when
        user sends the tips
        @param user The user account
        @return The remaining balance of the ERC-20 compatible token deposited
    */
    function balanceDepositOf(address user) external view returns (uint256);

    /**
        @notice The amount of reward token owed to 'holder'
        @dev The pending tokens can come from the tip token contract account
        or from an external escrow, depending on tip token implementation
        @param holder The holder of NFT(s) (NFT controller)
        @return The amount of reward tokens owed to the holder from tipping
    */
    function rewardPendingOf(address holder) external view returns (uint256);
}

Events

ApprovalForNFT
js
event ApprovalForNFT(
    address[] holders,
    address indexed nft,
    uint256 indexed id,
    bool approved
);

Emitted when an NFT or multi-token is approved or disapproved for tipping. This event indicates that specified holders (controllers) of a particular NFT contract and token ID have been granted or denied the right to receive tips. When NFT ownership changes, the approval must be treated as reset; the implementation is responsible for detecting the ownership change.

Parameters

  • holders
    • An array of NFT holder addresses approved to receive tips.
  • nft
    • The address of the relevant ERC721 or ERC1155 token contract.
  • id
    • The relevant token ID.
  • approved
    • A Boolean indicating approval (true) or revocation (false).
Deposit
js
event Deposit(
    address indexed user,
    address indexed rewardToken,
    uint256 amount,
    uint256 tipTokenAmount
);

Emitted when a user deposits reward tokens in exchange for tip tokens. This event records a deposit of ERC20-compatible tokens and the corresponding issuance of tip tokens.

Parameters

  • user
    • The address of the depositing user.
  • rewardToken
    • The address of the ERC20-compatible token deposited.
  • amount
    • The amount of ERC20 tokens deposited.
  • tipTokenAmount
    • The amount of tip tokens issued.
WithdrawReward
js
event WithdrawReward(
    address indexed holder,
    address indexed rewardToken,
    uint256 amount
);

Emitted when an NFT holder withdraws reward tokens. It records that an NFT or multi-token holder has withdrawn pending ERC20 rewards.

Parameters

  • holder
    • The address of the NFT holder withdrawing the reward.
  • rewardToken
    • The address of the ERC20-compatible reward token.
  • amount
    • The amount of reward tokens withdrawn.
InitializeTipToken
js
event InitializeTipToken(
    address indexed tipToken_,
    address indexed rewardToken_,
    address owner_
);

Emitted when a tip token contract is initialized. It records the tip token address, reward token address, and owner configured during initialization.

Parameters

  • tipToken_
    • The address of the tip token.
  • rewardToken_
    • The address of the ERC20-compatible token used as the reward.
  • owner_
    • The address of the contract owner.
Tip
js
event Tip(
    address indexed user,
    address[] holder,
    address indexed nft,
    uint256 id,
    uint256 amount,
    address rewardToken,
    uint256[] rewardTokenAmount
);

Emitted when a user sends a tip to the holder or holders of an NFT or multi-token. It records that a user has used tip tokens to allocate rewards to NFT holders. If multiple holders exist, the reward allocated to each holder is also recorded.

Parameters

  • user
    • The address of the user sending the tip.
  • holder
    • An array of NFT holder addresses receiving the reward.
  • nft
    • The target NFT contract address.
  • id
    • The token ID.
  • amount
    • The amount of tip tokens spent.
  • rewardToken
    • The address of the ERC20-compatible reward token.
  • rewardTokenAmount
    • The amount of reward tokens allocated to each holder.

Functions

setApprovalForNFT

js
function setApprovalForNFT(
    address[] calldata holders,
    address nft,
    uint256 id,
    bool approved
) external;

Grants or revokes approval for designated holders of an NFT or multi-token to receive tips. It specifies the holders eligible to receive tips for a given ERC721 or ERC1155 contract and token ID. The operation must revert if the tip token contract has not been approved as an operator, a holder is the zero address, or the token contract does not support the required interface. An ApprovalForNFT event is emitted after the update.

Parameters

  • holders
    • An array of holder addresses to approve for receiving NFT or multi-token rewards.
  • nft
    • The address of the relevant NFT or multi-token contract.
  • id
    • The relevant token ID.
  • approved
    • true to grant approval or false to revoke it.
isApprovalForNFT
javascript
function isApprovalForNFT(
    address holder,
    address nft,
    uint256 id
) external returns (bool);

Checks whether a specified NFT holder has been approved to receive tips. It reports whether approval was previously granted using setApprovalForNFT. Note, however, that ownership of the NFT may have changed since approval was granted.

Parameters

  • holder
    • The NFT holder address to check.
  • nft
    • The NFT or multi-token contract address.
  • id
    • The relevant token ID.

Return value

  • bool
    • true if approved, or false otherwise.
tip
js
function tip(
    address nft,
    uint256 id,
    uint256 amount
) external;

Sends a tip to the holder or holders of an NFT or multi-token. Tip tokens are spent for the specified token, and reward tokens are allocated to its holders. The call reverts if the target NFT has not been approved for tipping. For an ERC1155 token with multiple holders, rewards are allocated in proportion to each holder's balance.

Parameters

  • nft
    • The address of the NFT or multi-token contract associated with the tip.
  • id
    • The relevant token ID.
  • amount
    • The amount of tip tokens to spend.
tipBatch
js
function tipBatch(
    address[] calldata users,
    address[] calldata nfts,
    uint256[] calldata ids,
    uint256[] calldata amounts
) external;

Sends tips from multiple users to the holders of multiple NFTs in a batch. Multiple tipping operations are processed within one transaction. All input arrays must have the same length. If any operation contains invalid data, the entire batch reverts. A Tip event is emitted for each tipping operation.

Parameters

  • users
    • An array of addresses of users sending tips.
  • nfts
    • An array of NFT or multi-token contract addresses identifying the destinations.
  • ids
    • An array of the corresponding token IDs.
  • amounts
    • An array of the amounts of tip tokens to spend.

deposit

js
function deposit(address user, uint256 amount) external payable;

Allows users to deposit ERC20-compatible reward tokens in exchange for tip tokens. Users deposit the token that will later be used for rewards. Tip tokens are issued based on the deposited amount and the applicable conversion rate. The deposit token is specified when the contract is initialized. Each contract handles only one reward token type.

Parameters

  • user
    • The address of the depositing user.
  • amount
    • The amount of reward tokens to deposit.
withdrawReward
js
function withdrawReward(uint256 amount) external payable;

Allows an NFT holder to withdraw reward tokens. Holders use this function to withdraw their pending rewards. The operation reverts if the pending balance is insufficient. The amount withdrawn is deducted from the pending reward balance.

Parameter

  • amount
    • The amount of reward tokens to withdraw.
balanceOf
js
function balanceOf(address user) external view returns (uint256);

Returns the tip token balance of a specified user. It behaves like the ERC20 balanceOf function. It reports the quantity of tip tokens the user holds.

Parameter

  • user
    • The address whose balance is being queried.

Return value

  • uint256
    • The user's tip token balance.
balanceDepositOf
js
function balanceDepositOf(address user) external view returns (uint256);

Returns the user's remaining deposited reward token balance. It reports the amount of deposited ERC20 tokens still available to allocate as rewards.

Parameter

  • user
    • The address of the relevant user.

Return value

  • uint256
    • The remaining deposit balance available for rewards.
rewardPendingOf
js
function rewardPendingOf(address holder) external view returns (uint256);

Returns the amount of reward tokens pending for an NFT holder. It reports the total quantity of reward tokens owed to the account but not yet withdrawn.

Parameter

  • holder
    • The NFT holder's address.

Return value

  • uint256
    • The amount of pending reward tokens.

How tips and rewards flow

Users deposit the applicable ERC20 token in exchange for tip tokens. Spending tip tokens on a particular NFT or multi-token allows its holders to withdraw ERC20 rewards, which are funded by the deposits held by the implementation.

Tip token transfers and valuation

Tip tokens are issued in exchange for ERC20 deposits. Implementers are free to determine the tip token exchange rate. For example, region-specific fixed rates could help reduce socioeconomic bias when tips are used as a measure of appreciation.

Sending a tip involves the following operations.

  • The user's tip tokens are burned.
  • The corresponding ERC20 value is allocated to the NFT or multi-token holders' pending reward accounts.

The formula below means that the ERC20 reward equals the user's remaining ERC20 deposit balance multiplied by the tip amount, divided by the user's total available tip token balance.

text
ERC20報酬 = (ユーザーのERC20総残高 × チップ額) ÷ ユーザーのチップトークン総残高

In other words, issuing free tip tokens to a user dilutes the reward value represented by each tip token.

ERC20 compatibility

  • If the tip token implements ERC20, users can transfer it directly to each other.
  • Otherwise, the implementation must still emit the appropriate Transfer events for minting and burning, using the same signature as ERC20.

Royalty and reward distribution

Multiple holders may own units of the same ERC1155 token ID. In that case, tips are allocated in proportion to their holdings. For example, if A holds 25 units and B holds 75, A receives 25% of the reward and B receives 75%.

An example mapping structure is shown below.

js
mapping(address => mapping(uint256 => address[])) private _tokenIdToHolders;
mapping(address => uint256) private _depositBalances;
mapping(address => uint256) private _rewardsPending;

This supports both the single-holder case for ERC721 and the multiple-holder case for ERC1155.

Important considerations

A tip token contract supports only one ERC20 reward token. To support multiple ERC20 tokens, deploy a separate ITipToken implementation for each one.

The ERC20 reward tokens must be available when holders withdraw their rewards.

Locking them in the contract is the recommended approach.

Because some ERC20 tokens deduct fees from transfers, the actual amount received should be checked to ensure internal accounting matches the received funds.

ERC4393 does not define a refund function for deposits or tip tokens; refunds are left to implementers.

Minimizing gas costs

Tips can be accumulated off-chain and submitted together through tipBatch to reduce per-transaction overhead. If the same user tips the same NFT repeatedly, aggregating those tips into a single operation can provide further savings. If multiple users tip the same NFT, grouping operations can minimize repeated checks, such as NFT verification.

Such optimizations are implementation-specific, but the sender, recipient, and relevant NFT information must remain reconstructable from the emitted Tip events. The original prose also mentions a TipBatch event, which is not declared in the interface shown above.

Additional considerations

A minimal interface

The ITipToken interface consists of a minimal set of functions, making it general-purpose and practical.
It supports the basic functionality of micropayments to NFT holders while remaining adaptable to different applications. A minimal interface is easier to implement and can offer security and gas efficiency benefits.

NFTs as anchors for value

An NFT is a digital asset uniquely identified on a blockchain by its contract address and token ID.
An on-chain token record or a committed content hash can provide a tamper-evident anchor for verifying digital art, licenses, tickets, service agreements, and other assets. Whether the associated content is immutable depends on the implementation.

An NFT can therefore represent ownership or usage rights associated with a digital or non-digital asset and provide a convenient mechanism for tipping its holder.

Creating new business models

For example, as the music industry moved from physical media such as CDs to streaming services, centralized revenue distribution models operated by large companies emerged.
In such models, creator compensation is determined by the allocation of subscription revenue.

With ITipToken, fans can tip a particular track represented by an NFT, allowing the corresponding creator or other eligible holder to receive rewards in ERC20 tokens.
This could support a more fan-driven music industry, bring creators closer to their audiences, and open additional sources of revenue.

The same mechanism could be applied in other industries, encouraging a shift from centralized control of revenue toward direct support or intermediary-assisted support models.

Auditable transaction history

Many dApps currently rely on conventional databases and blockchain explorer APIs to manage and search data.
ERC4393 requires event logs that enable the state of tip and reward token accounting to be reconstructed.

External databases and explorers can therefore index and search tipping and reward histories using event logs, supporting transparency and verifiability.
With a compliant implementation, this enables an accurate ledger to be reconstructed from on-chain events and supports more verifiable application design.

Compatibility

Compatibility with ERC20

By implementing ERC20, a tip token can support direct transfers between users through functions such as transfer, just like a conventional token.
For example, when inheriting OpenZeppelin's ERC20 implementation, the tip token can reuse the parent contract's balanceOf functionality.

This allows tipping functionality to be integrated while maintaining compatibility with existing wallets and infrastructure.

Functionality outside the standard

ERC4393 does not itself introduce spender functionality such as approve or transferFrom for spending another user's tip tokens. This reflects the assumption that tips rarely need to be transferred by another party.

Secondary-market trading in which tip tokens are identified by name is also outside the scope of the standard and may be supported separately by implementers as needed.

Security considerations

Handling deposits

Deposited ERC20 reward tokens should be locked in the tip token contract or in a trusted external escrow.
These tokens are reserved for paying rewards to NFT holders and should not be diverted to other purposes.

However, this custody arrangement is a recommendation, with the implementation left to developers. The implementation must make the tokens available when users withdraw their rewards.

Approval required before tipping

Before a user sends a tip to an NFT, the relevant NFT holders must have authorized receipt of tips through the tip token contract.
ERC4393 specifies that the rewards resulting from tipping must be allocated to the eligible NFT holders.

The reward flow should be clearly identifiable in the code, and opaque implementations or confusing accounting should be avoided.
Any fees charged should be disclosed to users in advance.

Malicious implementations

The proposal also considers the risk of a malicious implementation that diverts funds intended as tips.
Because tipping is expected to occur frequently, irregularities may be detected relatively quickly.
Users and monitoring services can inspect event logs to identify and respond to improper behavior, although logs alone do not prove that an implementation is correct.

Citation

Jules Lai (@julesl23), "ERC-4393: Micropayments for NFTs and Multi Tokens [DRAFT]," Ethereum Improvement Proposals, no. 4393, October 2021. [Online serial]. Available: https://eips.ethereum.org/EIPS/eip-4393.

Conclusion

This article covered ERC4393, a proposal for sending ERC20-denominated micropayments to holders of ERC721 NFTs and ERC1155 tokens. I hope you found it useful.

If you have any questions, feel free to contact me via Twitter DM.

Twitter @cardene777

I also publish on other platforms, which you can find below.

https://chaldene.net/