ERC-5604 NFT Lien Standard (NFT Lien)

Draft · NFTs & multi-token · created 2022-09-05

Defines a common interface for placing, removing, and querying a lien on an ERC-721 NFT. It allows a right securing debt recovery or obligation fulfillment to be recorded on top of the NFT.

Why it is needed

A lien is a widely used device in finance, as with cars or real estate. It is a way for another party to hold a claim against a piece of property until a debt is repaid or an obligation is fulfilled. As NFTs come to represent assets like real estate deeds, NFTs need the same device. But without a common standard, each service records liens in its own way, and there is no consistent way for other apps or wallets to check who holds a claim on a given NFT. This standard defines functions to place a lien, remove it, query it, and events for them in a single interface, so anyone can implement and read lien holder relationships the same way.

What to implement

In depth

Compliance requirement: implement ERC-721 and ERC-165

A compliant contract MUST implement ERC-721 and ERC-165, and MUST also implement the IERC_LIEN interface above. Because this standard is designed as an extension of ERC-721, a compliant contract must fully conform to ERC-721. In other words, the structure keeps the existing NFT's ownership and transfer functions intact while adding lien related functions and events on top. Key words such as MUST and SHOULD in the specification are interpreted according to RFC 2119.

addLienHolder: placing a lien

Adds the holder address as a lien holder on the token pointed to by tokenId. If the same holder already has a lien on the same token, it MUST throw an error. extraParams is additional data for future extension. If the placement succeeds, the OnLienPlaced event MUST be emitted, carrying tokenId, holder, and the extraParams from the original request.

removeLienHolder: removing a lien

Removes holder's lien on the token pointed to by tokenId. If the removal succeeds, the OnLienRemoved event MUST be emitted. The original comment for this function states that it "MUST throw if the holder already has a lien," which has the same wording as the condition for the placement function, so the meaning here is unclear. This should be read together with the fact that this proposal is still at the Draft stage.

hasLien: querying a lien

A view function that returns a bool indicating whether a specific holder has an active lien on the given token. It MUST throw an error if tokenId does not exist or is not owned. The query function also has extraParams for future extensibility.

Design choice: why it supports only ERC-721 and separates the functions

For simplicity and gas efficiency, it supports only ERC-721 NFTs. Other standards such as ERC-20 or ERC-1155 were not considered and are left for future extension. It also separates addLienHolder and removeLienHolder instead of combining them into a single changeLienholder, because adding and removing are fundamentally different in nature and usually require different access control. For example, it notes that a token holder should be able to add someone else as a lien holder.

What this standard does not cover

The amount of debt is not defined by this interface, since it is complex enough on its own to warrant a separate ERC. For the same reason, it also does not define how a lien holder signals endorsement of a token's transfer or exchange. The Security Considerations section is only noted as "Needs discussion," so specific precautions have not yet been worked out.

Proposal status: Draft

This proposal was created on September 5, 2022 and is currently in Draft status. It has not yet been finalized, so the interface and rules may change.

Original ERC · ← ERCs