EIP-2981 (Ethereum Improvement Proposal 2981) is a royalty standard that defines a simple, gas-efficient function—royaltyInfo(uint256 tokenId, uint256 salePrice)—that returns the recipient address and the royalty amount for a given token and sale price. This function allows any marketplace, aggregator, or secondary sales platform to programmatically query and honor creator royalties during a sale. Prior to its introduction, royalty implementations were fragmented and often relied on off-chain metadata or platform-specific agreements, leading to inconsistent enforcement and creator revenue loss.
EIP-2981 (NFT Royalty Standard)
What is EIP-2981 (NFT Royalty Standard)?
EIP-2981 is a standardized, on-chain method for non-fungible token (NFT) smart contracts to communicate royalty payment information to marketplaces and other ecosystem participants.
The standard supports both fixed-fee and percentage-based royalties, calculated as a portion of the final sale price. A key technical feature is its per-token configurability, meaning royalties can be set uniquely for individual tokens within a collection or uniformly for the entire contract. This flexibility is crucial for complex NFT projects where different assets may have different creators or revenue-sharing agreements. The royalty information is embedded directly in the smart contract's code, making it permissionless and verifiable by any third party without relying on a centralized registry.
While EIP-2981 has become the dominant on-chain standard, its enforcement is not automatic; it requires voluntary adoption by marketplaces and platforms that process secondary sales. The standard provides the information but not the mechanism for payment collection. This has led to a landscape where some platforms respect the standard fully, others offer it as an optional feature, and a few bypass it entirely. Consequently, the ecosystem has seen supplementary proposals, like EIP-5496 for multi-privilege management, to create more robust and enforceable royalty models.
How EIP-2981 Works
EIP-2981 is a standardized interface for on-chain royalty payments on the Ethereum blockchain, enabling smart contracts to programmatically specify and distribute fees to creators on secondary sales.
EIP-2981, formally titled "NFT Royalty Standard," is an Ethereum Improvement Proposal that defines a simple, gas-efficient function for royalty information. At its core, it introduces a single, mandatory function called royaltyInfo(uint256 _tokenId, uint256 _salePrice) that returns the recipient address and the royalty amount for a given token and sale price. This standardization allows marketplaces, aggregators, and other smart contracts to query any compliant NFT contract to discover and honor creator royalties in a predictable way, without requiring custom integration for each collection.
The standard operates by decoupling the royalty logic from the marketplace logic. When a secondary sale occurs on a compliant platform, the marketplace contract calls the NFT's royaltyInfo function, passing the _tokenId and the final _salePrice. The NFT contract's implementation of this function performs a calculation—typically a percentage of the sale price—and returns the amount owed and the address to pay. This mechanism supports both fixed fees and percentage-based royalties, and the royalty can be directed to a single wallet or a more complex payment splitter contract.
A key technical feature is that the royalty amount is returned as a raw value (e.g., in wei), not a percentage. This places the calculation logic—and the associated gas cost—on the NFT contract itself, not the marketplace. This design ensures the royalty rules are immutable and enforceable by the smart contract code that defines the asset. The standard also includes a supportsInterface check using the interface ID 0x2a55205a, allowing platforms to easily detect if an NFT collection implements EIP-2981.
While EIP-2981 provides a powerful on-chain signal, its enforcement is ultimately opt-in for marketplaces; it is a permissionless standard, not a protocol-level enforcement mechanism. This has led to the development of supplementary standards and royalty enforcement techniques. Nevertheless, it remains the foundational, widely adopted technical specification that enables programmable creator economics across the Ethereum ecosystem and compatible EVM chains like Polygon, Arbitrum, and Avalanche.
Key Features of EIP-2981
EIP-2981 defines a standardized, on-chain method for NFT smart contracts to communicate royalty payment information to marketplaces and other secondary sale platforms.
Royalty Info Function
The core of the standard is the royaltyInfo function, which any contract can implement. It takes a tokenId and a salePrice as inputs and returns two outputs:
- Recipient address: Where the royalty payment should be sent.
- Royalty amount: The exact amount to be paid, calculated from the sale price. This provides a predictable, programmatic way for exchanges to query and execute payments.
On-Chain Enforcement
Unlike off-chain metadata, EIP-2981 embeds royalty logic directly into the smart contract's code. This makes the rules immutable and verifiable by any party. Marketplaces that integrate the standard can programmatically respect these terms, moving royalties from a social consensus to a technical requirement for compliant platforms.
Flexible Royalty Models
The standard supports various royalty calculation models through its function logic:
- Fixed Percentage: The most common model (e.g., 5% of sale price).
- Tiered or Dynamic: Royalties can vary based on
tokenId, sale price, or other on-chain conditions. - Multiple Recipients: Logic can split payments between several addresses (e.g., artist and platform).
Backwards Compatibility
EIP-2981 is designed as an extension to existing NFT standards like ERC-721 and ERC-1155. An NFT collection can add EIP-2981 support in a new contract or via a proxy pattern, allowing older collections to upgrade. It does not break existing functionality, enabling gradual adoption.
Marketplace Integration
For the standard to be effective, secondary marketplaces must integrate it. A compliant marketplace will:
- Call the
royaltyInfofunction for each NFT sale. - Receive the payment amount and recipient address.
- Automatically route the calculated royalty during settlement. This removes the need for manual royalty configuration by sellers.
Limitations & Considerations
Key practical considerations include:
- Optional Enforcement: Marketplaces can choose not to query the function.
- Gas Costs: The
royaltyInfocall adds a minor gas overhead to transactions. - Immutable Logic: Once deployed, royalty rules cannot be changed unless built-in upgrade mechanisms exist.
- Complementary Standards: Often used with EIP-5516 (Royalty Registry) for fallback lookups.
Code Example: The `royaltyInfo` Interface
A technical breakdown of the core function defined by EIP-2981 for querying royalty payments on-chain.
The royaltyInfo function is the mandatory interface defined by EIP-2981: NFT Royalty Standard. Its signature is function royaltyInfo(uint256 _tokenId, uint256 _salePrice) external view returns (address receiver, uint256 royaltyAmount). This function is called by a marketplace or other intermediary at the point of sale to determine where and how much royalty should be paid. It takes the token's _tokenId and the _salePrice as inputs and returns two values: the receiver address to send the royalty and the royaltyAmount to be paid, calculated based on the sale price.
Implementing royaltyInfo requires the smart contract to contain internal logic for determining the royalty parameters. A common pattern is to store a global royaltyBasisPoints (e.g., 500 for 5%) and a royaltyReceiver address. The function then calculates royaltyAmount as (_salePrice * royaltyBasisPoints) / 10000. More advanced implementations can support per-token or per-collection royalty schemes by reading from a mapping or using an external oracle. The key requirement is that the function must be view and must not revert under normal conditions to ensure seamless marketplace integration.
For developers, proper implementation is critical for interoperability. Major marketplaces like OpenSea and LooksRare call this function to facilitate automatic royalty payments. A faulty implementation—such as one that reverts, returns an excessive amount, or uses a non-standard signature—can break compatibility, leading to listings failing or royalties not being paid. Testing with various sale prices and token IDs is essential. The returned royaltyAmount should always be a portion of the _salePrice, and the standard recommends that the sum of the royalty and the seller's proceeds should not exceed the sale price.
Beyond the basic implementation, the royaltyInfo function can be extended for complex scenarios. For instance, a contract could implement tiered royalties based on sale price, time-based royalty rates, or even delegate the logic to a separate, upgradeable contract. However, any extension must maintain the exact function signature and return types to remain EIP-2981 compliant. The elegance of the standard lies in this simple, single-function interface that provides a universal hook for royalty enforcement across the NFT ecosystem without dictating the underlying business logic.
Ecosystem Adoption and Usage
EIP-2981 is an Ethereum standard that defines a universal interface for NFT royalty payments, enabling smart contracts to programmatically specify and distribute fees to creators on secondary market sales.
Core Mechanism
The standard introduces a single, mandatory function: royaltyInfo(uint256 _tokenId, uint256 _salePrice). This function returns the royalty recipient address and the royalty amount to be paid for a given token and sale price. It enables marketplaces to query and execute payments without prior knowledge of the creator's payment structure.
Adoption by Major Marketplaces
Leading NFT marketplaces have integrated EIP-2981 to enforce creator royalties. Key adopters include:
- OpenSea: Uses it as the primary method for honoring creator-set fees on its Seaport protocol.
- LooksRare & Blur: Query the standard, though their enforcement policies vary.
- Rarible: Supports it within its marketplace aggregator. This widespread integration creates a baseline for royalty compliance across the ecosystem.
Implementation in Smart Contracts
NFT collections implement EIP-2981 by adding the royaltyInfo function to their token contract (e.g., ERC-721 or ERC-1155). Common patterns include:
- Fixed Percentage: A global royalty for all tokens (e.g., 5%).
- Token-Level Customization: Royalties stored per token in a mapping.
- Tiered Systems: Royalty rates based on token traits or collection tiers.
Libraries like OpenZeppelin's
ERC2981provide a base implementation for developers.
Limitations and Workarounds
EIP-2981 is an on-chain standard but is not automatically enforced; compliance depends on marketplace integration. Key limitations have led to supplementary solutions:
- Operator Filter Registries (EIP-2981+): Allow creators to block sales on non-compliant marketplaces.
- Royalty Enforcement Layers: Protocols like Manifold's Royalty Registry act as an on-chain directory for overriding or supplementing the basic standard.
- Off-Chain Agreements: Some ecosystems use signed messages to define terms outside the smart contract.
Impact on Creator Economics
By providing a predictable, automated revenue stream, EIP-2981 fundamentally shifts NFT business models. It enables:
- Sustainable Income: Creators earn a percentage of all secondary sales in perpetuity.
- Programmable Splits: Royalties can be split between multiple parties (e.g., artist, studio, DAO) directly within the
royaltyInfofunction. - Transparent Attribution: The on-chain record clearly links revenue to the original creator's address.
Related Technical Standards
EIP-2981 interacts with and is often extended by other Ethereum Improvement Proposals:
- ERC-721 & ERC-1155: The core NFT standards it augments.
- EIP-5516: A proposed standard for soulbound tokens that could integrate royalty logic.
- EIP-5496: A proposed standard for multi-privilege management, which could govern royalty settings. Understanding these relationships is key for developers building complex NFT ecosystems.
Security and Implementation Considerations
EIP-2981 defines a standardized, on-chain method for NFT contracts to communicate royalty payment information to marketplaces. While it solves a key interoperability problem, its design and implementation have important security and operational implications.
Royalty Enforcement is Not Guaranteed
EIP-2981 is an informational standard, not an enforcement mechanism. It provides a royaltyInfo function that returns a recipient address and amount, but it does not automatically transfer funds. Enforcement depends entirely on the marketplace or protocol integrating the standard. This creates a trust dependency on secondary market operators to honor the returned values.
Implementation Security: Reentrancy & Gas
The royaltyInfo function is called during a sale transaction, making it a potential attack vector. Key considerations:
- Reentrancy Guards: The function should be
view/pureto prevent state changes, but custom logic must be audited. - Gas Limits: Complex royalty calculation logic (e.g., tiered royalties) can run out of gas, causing transaction failures. Implementations should be gas-efficient and have predictable upper bounds.
- Input Validation: The function must safely handle the
_salePriceparameter and any other inputs.
Upgradability and Admin Key Risks
Royalty parameters (recipient, basis points) are often set by a contract owner or admin. This introduces centralization risks:
- Privileged Function Control: A compromised admin private key could redirect all future royalty payments.
- Upgradeable Contracts: While useful for fixing bugs, upgradeable implementations add complexity and potential proxy contract vulnerabilities.
- Immutable Alternatives: Some projects use immutable, constructor-set royalty parameters to eliminate admin risk, sacrificing future flexibility.
Interoperability with Other Standards
EIP-2981 must coexist with core NFT standards, leading to integration challenges:
- ERC-721 & ERC-1155: The royalty function is an optional extension. Marketplaces must check for interface support (
IERC2981). - Conflicting Standards: Competing royalty proposals (like Manifold's) can cause fragmentation. Contracts may implement multiple standards, but logic must be consistent to avoid returning different values.
- Marketplace Adoption: The standard's effectiveness is directly tied to its integration by major marketplaces like OpenSea, Blur, and LooksRare.
Front-Running and Oracle Manipulation
Dynamic royalty schemes that rely on external data are vulnerable to manipulation:
- On-Chain Data: Using a value like the current ETH/USD price from an oracle introduces oracle risk. A manipulated price feed could distort royalty amounts.
- Off-Chain Logic: If the
salePriceis not the sole determinant (e.g., royalties based on trader reputation), the logic becomes more complex and potentially exploitable. - Front-Running: While the function is
view, transactions that depend on its output could be front-run if the state changes between simulation and execution.
Testing and Verification Best Practices
Robust implementation requires thorough testing strategies:
- Unit Tests: Verify
royaltyInforeturns correct values for various sale prices and token IDs. - Integration Tests: Test interactions with marketplace mock contracts to ensure proper payment flow.
- Fuzz Testing: Use tools like Echidna or Foundry's fuzzing to test with random, high-volume
_salePriceinputs. - Formal Verification: For high-value contracts, consider using formal methods to mathematically prove the correctness of royalty logic.
Comparison: EIP-2981 vs. Alternative Royalty Models
A technical comparison of on-chain royalty standards and common alternative approaches, focusing on implementation, enforcement, and compatibility.
| Feature / Metric | EIP-2981 (Standard) | Custom Registry (e.g., EIP-2981 + Extension) | Transfer-Hook Enforcement | Off-Chain / Social Enforcement |
|---|---|---|---|---|
Standardization | ||||
On-Chain Royalty Info | Optional | |||
Automatic Payouts | ||||
Marketplace Agnostic | ||||
Gas Cost Impact | Low | Medium | High | None |
Secondary Sale Enforcement | Voluntary | Voluntary | Forced (via hook) | Voluntary |
Creator Updatability | ||||
Primary Use Case | Universal Standard | Advanced Ecosystems | Specific Collections | Community-Driven Projects |
Evolution and Context
The development of EIP-2981 represents a pivotal moment in the NFT ecosystem, establishing a universal protocol for on-chain royalty enforcement.
EIP-2981 (NFT Royalty Standard) is an Ethereum Improvement Proposal that defines a standardized, on-chain method for non-fungible token (NFT) smart contracts to signal royalty payment information to marketplaces and other platforms. Prior to its introduction, royalty implementation was fragmented, relying on off-chain metadata or platform-specific agreements, which led to inconsistent enforcement and frequent royalty non-payment. This standard provides a simple, gas-efficient function, royaltyInfo(uint256 tokenId, uint256 salePrice), that returns the recipient address and the royalty amount for a given sale, creating a predictable technical foundation for creator compensation.
The proposal, authored by Zach Burks, James Morgan, Blaine Malone, and James Seibel, was created in direct response to the growing problem of "royalty bypass," where traders used decentralized exchanges or modified contracts to avoid paying creator fees. By embedding royalty logic directly into the NFT's smart contract, EIP-2981 aims to make royalty payments permissionless and composable, meaning any marketplace or application can query and honor them without requiring a separate business deal. This shift moved royalties from a social consensus enforced by major platforms to a more robust technical standard.
Adoption of EIP-2981 has been widespread but not universal. Major marketplaces like OpenSea and LooksRare integrated support, automatically reading the on-chain data to facilitate payments. However, its effectiveness is not absolute, as it remains an opt-in standard for both NFT collections and marketplaces; a platform can technically choose to ignore the returned data. Furthermore, the standard only signals the royalty information—it does not enforce payment atomically within the transfer transaction itself, a limitation addressed by more complex proposals like EIP-5216 or application-layer solutions.
Frequently Asked Questions (FAQ)
EIP-2981 is a standard interface for NFT royalties, enabling smart contracts to return royalty payment information. This FAQ addresses common questions about its purpose, implementation, and impact on the NFT ecosystem.
EIP-2981 is an Ethereum Improvement Proposal that defines a standardized, on-chain method for Non-Fungible Token (NFT) smart contracts to communicate royalty payment information to marketplaces and other platforms. It works by introducing a simple function, royaltyInfo(uint256 tokenId, uint256 salePrice), which returns the recipient address and the royalty amount (calculated from the sale price) that should be paid. This allows any secondary market, aggregator, or application to programmatically discover and honor creator royalties without relying on off-chain data or centralized lists. The standard is permissionless and backwards compatible, meaning it can be added to existing NFT contracts and does not force royalties, but provides the data for platforms that choose to respect them.
Get In Touch
today.
Our experts will offer a free quote and a 30min call to discuss your project.