ERC721 Renting, Lending and Borrowing

After some time I came across EIP-4907 Rental NFT standard again. It got me thinking of the different ways ERC721 tokens can be lent, borrowed or rented.

ERC20 lending is already somewhat standardized and we have well known protocols. But when it comes to ERC721 tokens, we are yet to see a protocol or a standard that would be widely adopted, especially when it comes to renting.

So lets start with renting using EIP-4907 and then explore lending through fractionalization, collateralization, and also one different approach that I used some time ago for renting ERC721 tokens that don’t support any renting standard. For those interested in example code, I have created a few contracts here.

Before we go any further, lets first address the difference between lending, borrowing and renting:

Borrow and lend describe opposite directions of the same transaction:

  • When you borrow something, you use it for free and then return it. (Even if you must return it with interest)
  • When you lend something. you are giving it to someone else for free, and then return it. (Even if you are receiving interest)

Rent is used in both directions:

  • When you rent something, you pay money to use it for a period of time. or
  • When you rent something, you receive money by enabling someone else to use it for a period time.

You usually borrow money and rent a house. Borrowing a house is unusual. This also makes sense if we view money as ERC20 and house as ERC721.

Collateral free

EIP-4907

The standard is an extension to ERC721. It is quite new (2022), but there were projects using similar pattern before it. It adds a user role and an expiration indicator. The NFT is rented to the user until expiration indicator expires. This way the usage rights of the renter (user) are separated from the rights of the owner. So the owner can keep the control, while user can possibly use the token in a game or something similar. The idea makes sense however there are some security concerns with this standard. The owner can change user and expiration whenever he wants. user has no guarantee that his rental will last as long as it should if the owner is EOA. This is why I think for the purpose of renting, the token should be owned by a smart contract. The creators of the standard probably had the same idea. You can check out an example contract I created here.

Renting Smart Contract

Some time ago I was working for a project that needed ERC721 renting functionality. The project had it’s own NFTs like land and assets. We could just use something like the EIP-4907 and add a user to the NFTs. But we wanted to also enable renting of external assets. For example, if someone would set up a gallery on his land, he could rent art pieces from other users to display them in the gallery. So I wrote a smart contract where users can offer their pieces for rent. The asset gets locked when someone accepts an offer and the contract keeps track of who has the usage rights. The main difference from above mentioned standard is that user and expiration information can be read from the Renting Smart Contract and not from the ERC721 directly. The down side of this approach is that the rules for renting are limited to this one contract, where as with EIP-4907 you can have multiple different contracts with different sets of rules created by anyone. However, at the time there was no standard and the approach made sense for the requirements. The model is actually very similar to reNFT Collateral-free rental (didn’t know about it at that time). You can check out an example contract I created following this model here.

Wrapping

There are some protocols that enable renting through wrapping. The difference here is that the NFT gets wrapped and the renter gets a wrapped NFT instead of the original. Once the contact expires, the wrapped NFT is burned and the original owner receives his NFT back. The problem with this approach is interoperability. It is difficult to integrate wrapped NFTs into games or whatever the use case of the original NFT might be. A wrapped NFT can potentially be wrapped again and again, which means you would have to go down a rabbit hole to figure out what the original NFT is.

Collateralized

Collateralized protocols usually require ERC20 collateral to rent an ERC721, or allow ERC721 to be used as collateral to borrow ERC20 tokens.

Since it is difficult to evaluate ERC721 tokens, the protocols that use collateralization model usually require lenders and borrowers to agree on its value and how much collateral should be provided. There are also some protocols that use oracles to track floor prices of collections. One of such protocols is Papr, which I recommend checking out, as it has an interesting model. But we will stick with the simpler P2P models for now.

Collateralized renting

Collateralized renting usually requires lessee to deposit ERC20 tokens as collateral to lease an ERC721 from a lessor. Lessors can offer their NFTs on a platform like reNFT that enables renting. They can describe the rental price and how much collateral (in ERC20) they require – usually more than the value of the asset. Borrowers can then accept the offers and provide collateral + pay rental fee. If NFT is not returned before previously agreed time, the lender can take the collateral. You can check out an example contract I created following this model here.

Collateralized lending

An example of a protocol that enables this is NFTfi. They enable you to list an NFT as collateral and get ERC20 loan offers from lenders. When you accept an offer, the NFT gets locked in a smart contract for the duration of the loan, and you receive one of the ERC20 tokens that their platform supports. If you repay the loan in the required time, you get your NFT back, otherwise the lender can take it. What I like about their platform is that the lender receives an ERC721 “Promissory Note”. This note represents the loan and enables its holder to receive the repaid loan + interest, or to foreclose the loan and receive the NFT (that was provided as collateral). Because the Promissory Note is an ERC721 token, it can be traded freely. You can imagine a scenario, where the lender needs liquidity sooner than he anticipated or the price of collateral starts falling and he wants to exit. He can sell or even use the Promissory Note as collateral and borrow liquidity.

Fractionalization

There are protocols that enable fractionalization of NFTs. A simple example can go like this: owner locks ERC721 in a contract and he is minted 1000 ERC20 tokens that represent shares or fractions. These fractions can usually be burned to redeem the NFT. Also, they can be used like any other ERC20, meaning you can use it with an AMM and lending protocols. You can even execute NFT flash loans.