ERC-5058 Lockable NFT standard (Lockable Non-Fungible Tokens)

Stagnant · NFTs & multi-token · created 2022-04-30

A standard that locks an NFT in place in the wallet without transferring it to another contract, allowing safe participation in NFTFi services such as collateralized lending or staking.

Why it is needed

Using existing NFT lending (NFTFi) or collateralized loan services requires transferring the NFT to the service contract. This creates the risk of losing or having the NFT stolen if the contract has a bug or vulnerability. Moving the NFT out of the owner's wallet also means losing utility value such as use as a profile picture or proof of eligibility for a specific community. In addition, airdrops paid to that NFT can no longer be received directly by the owner, causing them to be missed or delayed. The EIP-721 standard itself has no native locking feature, so avoiding these problems required building a separate escrow structure every time.

What to implement

In depth

Lock approval structure

The NFT owner grants lock authority to a trusted operator via lockApprove() or setLockApprovalForAll(). lockApprove() applies to a single specified token, while setLockApprovalForAll() applies to the entire collection of tokens held in that wallet. When a user participates in an NFTFi project, the project contract calls lock() to lock the user's NFT, and the locked NFT cannot be transferred.

Lock and unlock authority

Only an approved project contract can lock an NFT via the lock function, and a locked NFT cannot be transferred until the lock period ends. The project contract also has the authority to release the lock early via the unlock function before the period ends. However, only the party that locked the NFT (the locker) has the authority to unlock it.

How the lock period is specified

When locking an NFT, the block number at which the lock ends (expired) must be specified, and this value must be greater than the current block number. Once the current block number passes the specified expiration block number, the NFT is automatically unlocked without any additional call and can be transferred again.

Bound NFT extension

Bound NFT is a concept that extends this standard, allowing a boundNFT with identical metadata to be issued while the NFT is locked. The boundNFT is transferable, exists only during the original NFT's lock period, and is destroyed once the lock is released. The boundNFT can be used as proof of a loan or of staking against a contract, and can either remain with the user or be used for renting out.

Bound NFT Factory

Similar to Uniswap's EIP-20 pair factory, the Bound NFT Factory is a shared factory that uses the create2 method to generate a deterministic boundNFT contract address for each NFT contract. The resulting boundNFT contract can only be controlled by the original NFT contract.

Compatibility with EIP-721

This standard is designed to be compatible with EIP-721, functioning as an extension interface that adds locking functionality to existing EIP-721 tokens.

Proposal status

This EIP is currently in Stagnant status, meaning it is no longer actively discussed or progressing. Its content may change or may never be adopted.

Things to watch out for

Original ERC · ← ERCs