ERC-2615 NFT Rental and Mortgage Extension (Non-Fungible Token with mortgage and rental functions)

Stagnant · NFTs & multi-token · created 2020-04-25

Adds User and Lien Holder roles to ERC721 NFTs, allowing NFTs to be rented out or used as collateral without a security deposit or ownership escrow.

Why it is needed

ERC721 only defines an Owner role, so renting out or using an NFT as collateral required building a separate mechanism outside the standard. Trustless rental required the lessor to hold a security deposit against potential abuse by the tenant, and using an NFT as collateral meant transferring ownership of the NFT into a contract and locking it in escrow. Since most NFT services only offer functionality to the owner, an NFT locked in escrow could no longer be used. Logic for tracking and relaying rental and lien relationships was also separate from the ERC721 standard, requiring a custom implementation every time.

What to implement

In depth

Three roles: Lien Holder, Owner, User

This standard splits ERC721's single Owner structure into three roles. The Lien Holder has the right to transfer both the Owner and User roles, the Owner has the right to transfer both the Owner and User roles, and the User has the right to transfer only the User role. In other words, on a token with a lien set, the lien holder holds the broadest authority, and on a token with a tenant right set, the Owner cannot arbitrarily change the User role.

Owner/User query and transfer functions

balanceOfOwner and balanceOfUser look up the holdings for each role, while ownerOf and userOf look up the current Owner and User address of a token. Role transfers are performed via safeTransferOwner and safeTransferUser respectively, both of which provide an overload that also passes data. Approval is separated by role via approveForOwner/getApprovedForOwner and approveForUser/getApprovedForUser, and setApprovalForAll lets a specific operator be granted batch authority over all tokens.

Setting and releasing a lien

To place a lien, a specific address is first approved via approveLien, and the approved address then calls setLien to actually set the lien. getCurrentLien looks up the current lien holder, and revokeLien releases the lien. Once a lien is set on a token, the Lien Holder gains the authority to transfer both the Owner and User roles, which serves as the basis for reclaiming ownership if the loan agreement is breached.

Setting and releasing a tenant right

As a protection mechanism for rentals, a specific address is approved via approveTenantRight and the tenant right is set via setTenantRight. getCurrentTenantRight checks the current tenant right holder, and revokeTenantRight releases it. Once a tenant right is set, the Owner cannot arbitrarily change the User role, guaranteeing the tenant the right to safely use the NFT for the duration of the agreement.

ERC721-compatible extension

Implementing additional functions such as balanceOf, ownerOf, approve, getApproved, transferFrom, and safeTransferFrom allows existing ERC721 ecosystem tools to be used as-is. In this extension, the transfer family of functions transfers both the Owner and User roles together if no tenant right is set on the token, and transfers only the Owner role if a tenant right is set.

Enumerable and Metadata extensions

Optional extensions are also provided that serve the same role as ERC721's Enumerable and Metadata extensions. totalNumberOfItems, itemOfOwnerByIndex, and itemByIndex enumerate tokens, while itemURI, name, and symbol expose metadata.

Actual movement of money is out of scope

This standard itself does not handle the movement of tokens or value. Delivering loan funds, repayment, and verifying rent payments must all be handled by a separate mortgage or rental contract; ERC-2615 only standardizes the Owner/User/Lien Holder role transitions and the approval system.

A proposal still stalled

This proposal is currently in Stagnant status and is no longer being actively discussed or revised. Check its status before applying it in practice.

Things to watch out for

Original ERC · ← ERCs