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 ERC3386, a proposal for issuing ERC20 tokens by depositing ERC721 or ERC1155 NFTs into a pool.
This article translates, summarizes, and expands on the proposal below.
I have also covered a range of other EIPs.
Overview
ERC3386 proposes a smart contract interface for issuing ERC20 tokens backed by identifiable ERC721 or ERC1155 tokens locked in a pool. The resulting ERC20 tokens, referred to as derivative tokens, do not reference the unique IDs of the original NFTs. Instead, they represent the collection of NFTs locked in the pool as a whole.
Since derivative tokens comply with ERC20, they can be used by other contracts that support ERC20 tokens, such as automated market makers (AMMs), for trading, collateral, liquidity provision, and other purposes. Burning these tokens also allows holders to withdraw the underlying NFTs at the applicable exchange ratio.
Motivation
ERC20 is the most widely used token standard on Ethereum and benefits from deep liquidity. By contrast, ERC721 and ERC1155 require assets to be managed by ID, and individual token units cannot be traded fractionally. This limits the use of NFTs in asset management and DeFi.
Derivative tokens allow locked NFTs to be represented by liquid ERC20 tokens, with several benefits.
- Fractional ownership and trading of NFTs become possible.
- Swapping tokens and providing liquidity in AMMs become easier.
- NFTs can be used with protocols designed for ERC20 tokens, including collateral and reward systems.
With a fixed exchange ratio, the value of derivative tokens is also proportional to the floor price (minimum price) of the pooled NFTs. This may create arbitrage opportunities between the NFT market and the derivative token market.
Restricting the types of NFTs accepted by a pool can reduce differences in asset value within it, making participation by holders of higher-value NFTs more practical. Auction-based pricing can also enable price discovery for different NFT subclasses, allowing flexible designs in which more valuable NFTs are allocated more derivative tokens.
Specification
Interface
pragma solidity ^0.8.0;
/**
@title IWrapper Identifiable Token Wrapper Standard
@dev {Wrapper} refers to any contract implementing this interface.
@dev {Base} refers to any ERC-721 or ERC-1155 contract. It MAY be the {Wrapper}.
@dev {Pool} refers to the contract which holds the {Base} tokens. It MAY be the {Wrapper}.
@dev {Derivative} refers to the ERC-20 contract which is minted/burned by the {Wrapper}. It MAY be the {Wrapper}.
@dev All uses of "single", "batch" refer to the number of token ids. This includes individual ERC-721 tokens by id, and multiple ERC-1155 by id. An ERC-1155 `TransferSingle` event may emit with a `value` greater than `1`, but it is still considered a single token.
@dev All parameters named `_amount`, `_amounts` refer to the `value` parameters in ERC-1155. When using this interface with ERC-721, `_amount` MUST be 1, and `_amounts` MUST be either an empty list or a list of 1 with the same length as `_ids`.
*/
interface IWrapper /* is ERC165 */ {
/**
* @dev MUST emit when a mint occurs where a single {Base} token is received by the {Pool}.
* The `_from` argument MUST be the address of the account that sent the {Base} token.
* The `_to` argument MUST be the address of the account that received the {Derivative} token(s).
* The `_id` argument MUST be the id of the {Base} token transferred.
* The `_amount` argument MUST be the number of {Base} tokens transferred.
* The `_value` argument MUST be the number of {Derivative} tokens minted.
*/
event MintSingle (address indexed _from, address indexed _to, uint256 _id, uint256 _amount, uint256 _value);
/**
* @dev MUST emit when a mint occurs where multiple {Base} tokens are received by the {Wrapper}.
* The `_from` argument MUST be the address of the account that sent the {Base} tokens.
* The `_to` argument MUST be the address of the account that received the {Derivative} token(s).
* The `_ids` argument MUST be the list ids of the {Base} tokens transferred.
* The `_amounts` argument MUST be the list of the numbers of {Base} tokens transferred.
* The `_value` argument MUST be the number of {Derivative} tokens minted.
*/
event MintBatch (address indexed _from, address indexed _to, uint256[] _ids, uint256[] _amounts, uint256 _value);
/**
* @dev MUST emit when a burn occurs where a single {Base} token is sent by the {Wrapper}.
* The `_from` argument MUST be the address of the account that sent the {Derivative} token(s).
* The `_to` argument MUST be the address of the account that received the {Base} token.
* The `_id` argument MUST be the id of the {Base} token transferred.
* The `_amount` argument MUST be the number of {Base} tokens transferred.
* The `_value` argument MUST be the number of {Derivative} tokens burned.
*/
event BurnSingle (address indexed _from, address indexed _to, uint256 _id, uint256 _amount, uint256 _value);
/**
* @dev MUST emit when a mint occurs where multiple {Base} tokens are sent by the {Wrapper}.
* The `_from` argument MUST be the address of the account that sent the {Derivative} token(s).
* The `_to` argument MUST be the address of the account that received the {Base} tokens.
* The `_ids` argument MUST be the list of ids of the {Base} tokens transferred.
* The `_amounts` argument MUST be the list of the numbers of {Base} tokens transferred.
* The `_value` argument MUST be the number of {Derivative} tokens burned.
*/
event BurnBatch (address indexed _from, address indexed _to, uint256[] _ids, uint256[] _amounts, uint256 _value);
/**
* @notice Transfers the {Base} token with `_id` from `msg.sender` to the {Pool} and mints {Derivative} token(s) to `_to`.
* @param _to Target address.
* @param _id Id of the {Base} token.
* @param _amount Amount of the {Base} token.
*
* Emits a {MintSingle} event.
*/
function mint(
address _to,
uint256 _id,
uint256 _amount
) external;
/**
* @notice Transfers `_amounts[i]` of the {Base} tokens with `_ids[i]` from `msg.sender` to the {Pool} and mints {Derivative} token(s) to `_to`.
* @param _to Target address.
* @param _ids Ids of the {Base} tokens.
* @param _amounts Amounts of the {Base} tokens.
*
* Emits a {MintBatch} event.
*/
function batchMint(
address _to,
uint256[] calldata _ids,
uint256[] calldata _amounts
) external;
/**
* @notice Burns {Derivative} token(s) from `_from` and transfers `_amounts` of some {Base} token from the {Pool} to `_to`. No guarantees are made as to what token is withdrawn.
* @param _from Source address.
* @param _to Target address.
* @param _amount Amount of the {Base} tokens.
*
* Emits either a {BurnSingle} or {BurnBatch} event.
*/
function burn(
address _from,
address _to,
uint256 _amount
) external;
/**
* @notice Burns {Derivative} token(s) from `_from` and transfers `_amounts` of some {Base} tokens from the {Pool} to `_to`. No guarantees are made as to what tokens are withdrawn.
* @param _from Source address.
* @param _to Target address.
* @param _amounts Amounts of the {Base} tokens.
*
* Emits either a {BurnSingle} or {BurnBatch} event.
*/
function batchBurn(
address _from,
address _to,
uint256[] calldata _amounts
) external;
/**
* @notice Burns {Derivative} token(s) from `_from` and transfers `_amounts[i]` of the {Base} tokens with `_ids[i]` from the {Pool} to `_to`.
* @param _from Source address.
* @param _to Target address.
* @param _id Id of the {Base} token.
* @param _amount Amount of the {Base} token.
*
* Emits either a {BurnSingle} or {BurnBatch} event.
*/
function idBurn(
address _from,
address _to,
uint256 _id,
uint256 _amount
) external;
/**
* @notice Burns {Derivative} tokens from `_from` and transfers `_amounts[i]` of the {Base} tokens with `_ids[i]` from the {Pool} to `_to`.
* @param _from Source address.
* @param _to Target address.
* @param _ids Ids of the {Base} tokens.
* @param _amounts Amounts of the {Base} tokens.
*
* Emits either a {BurnSingle} or {BurnBatch} event.
*/
function batchIdBurn(
address _from,
address _to,
uint256[] calldata _ids,
uint256[] calldata _amounts
) external;
}Events
MintSingle
event MintSingle (address indexed _from, address indexed _to, uint256 _id, uint256 _amount, uint256 _value);Emitted when a single base token is transferred to the pool and derivative tokens are minted. This event is emitted when an NFT of a particular ID (ERC721 or ERC1155) moves into the pool and the corresponding amount of ERC20 tokens is issued.
Parameters
_from- The address that sent the base token.
_to- The address receiving the derivative tokens.
_id- The ID of the base token.
_amount- The quantity of base tokens transferred.
_value- The amount of derivative tokens minted.
MintBatch
event MintBatch (address indexed _from, address indexed _to, uint256[] _ids, uint256[] _amounts, uint256 _value);Emitted when multiple base tokens are transferred to the pool and derivative tokens are minted. This event is used when multiple NFTs are deposited together and the corresponding total amount of ERC20 tokens is issued in a single operation.
Parameters
_from- The address that sent the base tokens.
_to- The address receiving the derivative tokens.
_ids- An array of base token IDs.
_amounts- An array of quantities corresponding to each ID.
_value- The total amount of derivative tokens minted.
BurnSingle
event BurnSingle (address indexed _from, address indexed _to, uint256 _id, uint256 _amount, uint256 _value);Emitted when derivative tokens are burned in exchange for a single base token. This event is used when a holder burns derivative tokens to withdraw an NFT of one ID from the pool.
Parameters
_from- The address whose derivative tokens were burned.
_to- The address receiving the base token.
_id- The ID of the withdrawn base token.
_amount- The quantity of base tokens withdrawn.
_value- The amount of derivative tokens burned.
BurnBatch
event BurnBatch (address indexed _from, address indexed _to, uint256[] _ids, uint256[] _amounts, uint256 _value);Emitted when derivative tokens are burned in exchange for multiple base tokens. It represents a batch burn of derivative tokens to withdraw multiple NFTs at once.
Parameters
_from- The address whose derivative tokens were burned.
_to- The address receiving the base tokens.
_ids- An array of withdrawn base token IDs.
_amounts- An array of quantities corresponding to each ID.
_value- The total amount of derivative tokens burned.
Functions
mint
function mint(address _to, uint256 _id, uint256 _amount) external;Locks a base token of a single ID and mints derivative tokens. The sender deposits an NFT into the pool, and ERC20 tokens are issued to the recipient.
Parameters
_to- The recipient address for the derivative tokens.
_id- The ID of the base token.
_amount- The quantity of base tokens to deposit (always 1 for ERC721).
batchMint
function batchMint(address _to, uint256[] calldata _ids, uint256[] calldata _amounts) external;Locks multiple base tokens and mints derivative tokens in a single operation. Multiple NFTs are deposited at once, and ERC20 tokens are issued based on their combined value.
Parameters
_to- The recipient address for the derivative tokens.
_ids- An array of IDs of the base tokens to deposit.
_amounts- An array of quantities for each base token ID.
burn
function burn(address _from, address _to, uint256 _amount) external;Burns derivative tokens to withdraw base tokens of unspecified IDs. The caller cannot choose which NFT is returned, but receives the specified quantity of NFTs.
Parameters
_from- The source address of the derivative tokens.
_to- The recipient address for the base tokens.
_amount- The quantity of base tokens to withdraw.
batchBurn
function batchBurn(address _from, address _to, uint256[] calldata _amounts) external;Burns derivative tokens to withdraw multiple base tokens of unspecified IDs. Specific IDs are not selected; the pool returns base tokens in a batch based on the specified quantities.
Parameters
_from- The source address of the derivative tokens.
_to- The recipient address for the base tokens.
_amounts- An array of quantities of tokens to withdraw.
idBurn
function idBurn(address _from, address _to, uint256 _id, uint256 _amount) external;Burns derivative tokens to receive base tokens of a specified ID. The caller can specify the NFT ID, making this function useful for retrieving a particular NFT.
Parameters
_from- The source address of the derivative tokens.
_to- The recipient address for the base tokens.
_id- The ID of the base token to withdraw.
_amount- The quantity to withdraw (always 1 for ERC721).
batchIdBurn
function batchIdBurn(address _from, address _to, uint256[] calldata _ids, uint256[] calldata _amounts) external;Burns derivative tokens to receive base tokens of multiple specified IDs. This function is used to specify the IDs and quantities of particular NFTs and withdraw them together.
Parameters
_from- The source address of the derivative tokens.
_to- The recipient address for the base tokens.
_ids- An array of base token IDs to withdraw.
_amounts- An array of quantities for each ID.
Additional considerations
Naming conventions
The NFTs being wrapped are called base tokens. These are the original ERC721 or ERC1155 tokens. Alternatives include "underlying" and "NFT," but ERC1155 tokens can also be considered semi-fungible, so "base" was chosen as a neutral term.
The issued ERC20 tokens are called derivative tokens. Alternative terms include "wrapped" and "generic" tokens.
Function names draw on terminology used by existing projects.
mint/burn- Common terms from ERC20.
mint/redeem- Terminology used by NFTX.
deposit/withdraw- Terminology used by WrappedKitties.
wrap/unwrap- Terminology used by MoonCatsWrapped.
In particular, the name idBurn makes clear which operation involves a specified ID. The tokens actually burned are the derivative tokens.
Minting
Minting transfers base tokens into the pool in exchange for derivative tokens. After minting, the base tokens must not be transferred except through burn functions, which ensures that the derivative tokens remain backed.
As suggested in the NFTX litepaper, it is also possible to lock base tokens as non-transferable collateral and receive derivative tokens as a loan. This resembles the design of Maker Vaults.
Burning
Burning destroys the holder's derivative tokens and withdraws base tokens from the pool. Burn functions fall into two categories.
- Withdraw base tokens without specifying their IDs.
burn,batchBurn
- Withdraw base tokens by specifying their IDs.
idBurn,batchIdBurn
Since specifying IDs allows users to target higher-value NFTs, NFTX has proposed charging an additional fee in such cases.
Pricing
Pricing need not be fixed. Including the value (amount of derivative tokens) in each mint or burn event accommodates variable prices.
Existing pricing models include the following.
- Equal pricing
Each base token is equivalent to one derivative token, as used by NFTX and WrappedKitties.
- Proportional pricing
NFT20 uses a ratio of 100 base tokens to one derivative token.
- Variable pricing
NFT20 uses Dutch auctions for variable pricing. NFTX requires an extra fee for withdrawals of specified IDs.
To accommodate these different models, both mint and burn events must include value.
NFT20 is a DeFi protocol that wraps NFTs, including ERC721 and ERC1155 tokens, into liquid ERC20 assets. It primarily aims to make NFTs divisible and tradable based on their floor price by issuing ERC20 tokens that can be traded on AMMs such as Uniswap.
Inheritance design
Inheriting ERC20
The Wrapper contract may inherit ERC20 and call super.mint and super.burn directly.
If it does not inherit ERC20, the derivative token contract must be designed so that the wrapper alone has authority to mint and burn tokens.
ERC721Receiver / ERC1155Receiver
If the wrapper does not inherit these receiver interfaces, it must restrict base token transfers to the mint and burn functions.
ERC721 tokens are uniquely identified by the combination of their contract address and ID, whereas ERC1155 allows multiple units of the same ID to be held. To account for this difference, ERC3386 unifies the two as follows.
- For ERC721,
_amountmust always be1. - For ERC721,
_amountsmust be an empty list or a list containing one unit for each ID.
This convention maintains consistency with the ERC1155 event specification.
Alternative implementation patterns include the following.
- Separate interfaces dedicated to ERC721 or ERC1155, such as
ERC721WrapperandERC1155Wrapper. - Distinct functions such as
mintFromERC721.
Inheriting ERC721 or ERC1155
In designs where the wrapper issues the base tokens itself (for example, an Initial NFT Offering), the wrapper may inherit ERC721 or ERC1155. If it does not inherit these contracts, token transfers must be implemented through IERC721 or IERC1155.
Approvals
Before minting or burning, the appropriate token transfers must be authorized. There are two ways to handle this.
- Handle the approve operations for ERC20, ERC721, or ERC1155 within the wrapper.
- Have users grant approval through IERC721 or IERC1155 outside the wrapper beforehand.
Minting or burning cannot proceed unless the required approvals are in place.
Reference implementation
Backwards compatibility
ERC3386 is designed to be compatible with many existing implementations.
In particular, it is highly compatible with projects that inherit ERC20 and use the mint and burn functions.
Examples of existing implementations include the following projects.
-
Wrapped Kitties (WK)
- Mint event: DepositKittyAndMintToken
- Burn event: BurnTokenAndWithdrawKitty
-
NFTX
- Mint event: Mint
- Burn event: Redeem
The function structure and purpose of these implementations align with the standard, making adoption relatively straightforward. A common event design also enables consistent monitoring and indexing.
Security considerations
The wrapper contract should inherit ERC20 Burnable. Even if it does not, authority over the derivative token supply must be limited to the wrapper contract. This is because the value of derivative tokens must always be backed by base tokens.
Functions such as idBurn and batchIdBurn, which allow withdrawal of NFTs with specified IDs, also enable users to target more valuable NFTs.
If base token values vary significantly by ID, this creates a risk that the pool will unintentionally lose only its most valuable NFTs.
The following mitigations should therefore be considered.
- NFTX approach
- Use separate, dedicated pools for higher-value and lower-value NFTs.
- NFT20 approach
- Charge additional fees for withdrawals of specified IDs (dynamic pricing).
Strategies that account for such price differences can help preserve the pool's long-term value and fairness.
Implementing a wrapper therefore requires careful design around supply control, pricing consistency, and prevention of abuse of targeted withdrawals.
Citation
Calvin Koder (@ashrowz), "ERC-3386: ERC-721 and ERC-1155 to ERC-20 Wrapper [DRAFT]," Ethereum Improvement Proposals, no. 3386, March 2021. [Online serial]. Available: https://eips.ethereum.org/EIPS/eip-3386.
Conclusion
This article covered ERC3386, a proposal for issuing ERC20 tokens when ERC721 or ERC1155 NFTs are deposited into a pool. I hope you found it useful.
If you have any questions, feel free to contact me via Twitter DM.
I also publish on other platforms, which you can find below.



