Home/Blockchain/Royalties Demo/Eip 2981 Standard

πŸ“œ EIP-2981: The Royalty Standard

Learn about the official NFT royalty implementation standard

Understand how creators earn from secondary sales

πŸ“œ EIP-2981: The Universal Standard

EIP-2981 is the accepted standard for NFT royalties on Ethereum. Proposed in 2020 and widely adopted, it provides a simple interface that any marketplace can query to determine royalty payments.

🎯

Simple Interface

Just one function to implement

🌐

Universal Support

OpenSea, Rarible, Foundation, etc.

⚑

Gas Efficient

View function, no state changes

πŸ’» Interactive: Code Explorer

Explore the EIP-2981 interface, implementation, and marketplace integration code.

EIP-2981 InterfaceSolidity
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

interface IERC2981 {
    /// @notice Called with the sale price to determine royalty amount
    /// @param tokenId - the NFT asset queried for royalty information
    /// @param salePrice - the sale price of the NFT asset
    /// @return receiver - address of who should receive royalty
    /// @return royaltyAmount - the royalty payment amount for salePrice
    function royaltyInfo(
        uint256 tokenId,
        uint256 salePrice
    ) external view returns (
        address receiver,
        uint256 royaltyAmount
    );
}
πŸ’‘
How It Works

Just one simple function! Marketplaces call royaltyInfo() passing the token ID and sale price. The contract returns who gets paid and how much.

βœ… EIP-2981 Benefits

  • β€’Standardized: One interface works everywhere
  • β€’Easy to implement: Add ~15 lines of code
  • β€’Backwards compatible: Works with existing NFTs
  • β€’Flexible: Per-token or global royalty rates

⚠️ Limitations

  • β€’Single receiver address (no built-in splits)
  • β€’Can't enforce paymentβ€”relies on marketplace
  • β€’Royalty rate often fixed at deployment
  • β€’No way to verify payment actually happened

πŸ”§ Key Technical Details

Basis Points

Royalties use basis points (BPS) for precision:

  • β€’ 100 BPS = 1%
  • β€’ 1000 BPS = 10%
  • β€’ 10000 BPS = 100%
Interface Detection

Marketplaces check support via EIP-165:

supportsInterface(0x2a55205a)

Returns true if EIP-2981 is implemented

πŸ’‘ Key Insight

EIP-2981's genius is its simplicity. Rather than trying to enforce payments (impossible without protocol changes), it creates a standard way to communicate royalty terms. Any marketplace can query royaltyInfo() and know exactly who to pay and how much. This approach enables interoperability while leaving enforcement to marketplace reputation and creator community pressure.

← How Royalties Work