Hi Ethereum Community! I wanted to get feedback on an idea for a new ERC token standard. The idea is to create a token that is limited to only being sold and bought on-chain and not allowed to be directly transferred between addresses.
TLDR
After exploring different token standards like ERC-721, ERC-1155 and ERC-2981 I could not find a suitable standard to guarantee that if an NFT token is resold the creator receives a portion of the resale value. ERC-2981 offers a standardized way to retrieve royalty payment information, however it does not provide a way to enforce this payment. Creating a new token standard that records sale price on-chain and limits the token to only being sold and bought would enable royalty payments to be collected without 3rd party involvement.
Motivation:
Digital marketplaces like the Steam Community Market are a great way for players to exchange in-game items and allow the developer (Valve in this case) to receive a portion of the resale. Having this marketplace provides a large amount of value to the players because they can trade with each other and value to the developer because they can use the fees as a way to continue developing the game.
However, these traditional centralized marketplaces have multiple problems.
- You need to trust in a central 3rd party (Valve in my example)
- You cannot take your money out of the marketplace after it has been deposited
- Players use blackmarket trading sites to avoid resale fees
Current token standards allow organizations to create marketplaces that remove problems 1 and 2, but problem 3 is still unavoidable. By allowing addresses to freely transfer tokens we cannot assume the intention of a token transfer. The transfer could have been initiated for numerous reasons other than the sale of a token allowing bad actors to handle payments off-chain. This makes it impossible to collect resale fees without 3rd party involvement.
If it were possible to record sale price on-chain and remove the ability to directly transfer tokens, it would be possible to avoid problem 3. Every token sale could be handled by a smart contract that would properly distribute funds to the intended parties. If someone tried to sell their token for much less than what it was worth, potentially handling funds off-chain for the sale, they would not be able guarantee that the person they were working with could purchase the item. Anyone listening to the chain would be able to fill the order.
Reference Implementation v0.1
/// Emitted when the sell function is called
/// @param _from The address of the token owner
/// @param _tokenId The token type being transferred
/// @param _price The price offered to sell the token
event Sell(address indexed _from, uint256 _tokenId, uint256 _price);
/// Emitted when the buy function is called
/// @param _from The address of the token owner
/// @param _tokenId The token type being transferred
/// @param _price The price the token was sold for
event Buy(address indexed _from, uint256 _tokenId, uint256 _price);
/// Modifies the token to be for sale and sets the price
function sell(address indexed _seller, uint256 _tokenId, uint256 _price);
/// Transfers token to buyer, pays seller and modifies the token to not be for sale
function buy(address indexed _buyer, uint256 _tokenId, uint256 _price) external payable;
/// Returns if the token is for sale
function forSale() public view returns (bool)
/// Returns the price needed to buy the token
function price() public view returns (uint256)
/// Returns the token that can be used for payment
function acceptablePayment() public view returns (uint256 tokenId)
/// Returns the last price the token was sold for
function lastPrice() public view returns (uint256)
/// Finds the owner of the token
function ownerOf() external view returns (address);
ERC-721 was referenced when creating this example.
Outstanding thoughts:
It seems like we would have to enforce what token the creator accepts as payment before it is minted. If we do not, then it would be easy to create a new ERC-20 token with no value and use it as payment for a sale.
Next Steps:
Thank you @ChrisWong for writing such a nice idea document that I could use as a template.