Introduction

Hi, I'm cardene, a software engineer and technical writer focused on blockchain and AI.

I've also authored Japanese technical books on specification-driven development with LLMs and decentralized application (DApp) development.

I also build and publish a variety of tools, libraries, and open-source projects.

This article examines ERC-5604, a proposal defining an interface for placing and managing liens on NFTs.

The explanation below translates, summarizes, and expands on the original proposal.

I also cover a range of other EIPs.

Overview

A lien is a form of security interest in property intended to secure repayment of a debt or performance of another obligation. Liens are commonly associated with assets such as real estate and vehicles.

This ERC proposes an interface for placing and managing liens on NFTs.

  • Placing a lien
    • Establishes a lien associated with an NFT.
    • This allows the NFT to serve as collateral for a debt or other obligation, subject to the applicable enforcement mechanism.
  • Removing a lien
    • Removes a lien associated with an NFT after the relevant obligation has been satisfied.
  • Events
    • Emits event logs to notify external systems when liens are placed or removed.

Implementation considerations

  • Interface definition
    • The standard defines a common interface for placing and removing liens.
    • Other smart contracts and applications can integrate with these operations consistently.
  • Transparency and reliability
    • Recording lien placement and removal on-chain makes changes observable and can improve transparency in NFT-backed transactions.
  • Integration with legal frameworks
    • Like conventional liens, NFT liens are intended to support arrangements in which an asset secures an obligation.
    • This could enable financial services involving digital assets, including secured lending. Legal enforceability depends on the relevant agreements and law, rather than the interface alone.

The ERC proposes a new application for NFTs as digital assets. Applying the concept of liens to NFTs could support more transparent financial transactions involving digital collateral. Implementing these operations through smart contracts may have applications beyond NFT markets, including in broader financial services.

Liens

Buying a car with a lien

Suppose you want to buy a new car using a loan rather than paying the entire purchase price upfront.

  1. Applying for a loan
    • You apply for financing from a bank or another lender.
  2. Placing a lien
    • Once the loan is approved, a lien is placed on the car.
    • The lien gives the lender a security interest in the vehicle until the loan is repaid.
  3. Using the car
    • You can generally continue using the vehicle while the lien remains in place.
    • Selling or transferring the vehicle free of the lien may require repayment or the lender's consent, depending on the applicable rules.
  4. Repaying the loan
    • Once the loan has been repaid, the lien can be released.
    • The vehicle is then no longer encumbered by that lien and can be sold or transferred accordingly.

NFTs and liens

The same concept can be applied to NFTs. Suppose you want to finance the purchase of an NFT associated with a piece of digital art.

  1. Purchasing the NFT
    • You arrange to purchase the digital artwork NFT using installment payments.
  2. Placing a lien
    • The financing provider, such as an NFT platform or financial institution, places a lien on the NFT.
    • This represents a security interest associated with the NFT until the relevant debt is repaid.
  3. Using the NFT
    • Depending on the implementation, you may retain possession of the NFT and continue displaying or using it while the lien is active.
    • The application may restrict sales or transfers.
  4. Repaying the loan
    • After the loan is repaid, the lien is released.
    • The NFT can then be transferred without the restrictions associated with that lien.

The concept of a lien can thus be applied to digital assets as well as physical property. Its effectiveness depends on the contractual and technical mechanisms that enforce it.

Motivation

One use case identified for this ERC is the use of NFTs as deeds representing property interests. As with liens on real estate or vehicles, an NFT can represent an asset used as collateral in a financial transaction.

The concept of an NFT lien

An NFT lien is an interest associated with a particular NFT for the purpose of securing a loan or another obligation. For example, a borrower could offer a valuable NFT as collateral when obtaining financing.

NFTs as deeds

A deed representing an interest in real estate can play an important role when using that property as collateral. Similarly, treating an NFT as a representation of an asset could support financing arrangements involving digital art, virtual real estate, or other digital property. Whether the NFT confers enforceable rights over an underlying asset depends on the arrangement.

The interface provided by the ERC

The ERC provides an interface for placing and managing NFT liens.

  • Placing a lien
    • Associates a lien with a specified NFT, allowing it to be designated as collateral.
  • Removing a lien
    • Allows the lien to be released after the relevant contractual obligation has been satisfied, potentially restoring unrestricted transferability.

Benefits and applications

  • Transparency and reliability
    • Placing and removing liens on-chain creates observable records of these operations.
  • Development of financial services
    • The interface could support new lending and investment arrangements involving NFTs.
    • For example, users could seek financing backed by digital art or virtual real estate NFTs.
  • Compatibility with legal frameworks
    • NFT liens can be incorporated into arrangements designed to secure contractual obligations, although legal protection requires more than an on-chain record.

The ERC opens up potential applications for digital assets in collateralized financing. Using NFTs as collateral, in a manner analogous to property deeds, could give individuals and businesses access to additional lending and investment arrangements. This illustrates how blockchain applications can extend beyond simple asset transfers.

Specification

A conforming contract must implement ERC-721 and ERC-165, as well as the following interface.

For more on ERC-165, see the following article.

[ERC-165] Checking Whether a Contract Supports an Interface

For more on ERC-721, see the following article.

https://chaldene.net/erc721

ts
interface IERC_LIEN is ERC721, ERC165 {

    /// === Events ===

    /// @notice MUST be emitted when new lien is successfully placed.
    /// @param tokenId the token a lien is placed on.
    /// @param holder the holder of the lien.
    /// @param extraParams of the original request to add the lien.
    event OnLienPlaced(uint256 tokenId, address holder, bytes calldata extraParams);

    /// @notice MUST be emitted when an existing lien is successfully removed.
    /// @param tokenId the token a lien was removed from.
    /// @param holder the holder of the lien.
    /// @param extraParams of the original request to remove the lien.
    event OnLienRemoved(uint256 tokenId, address holder, bytes calldata extraParams);

    /// === CRUD ===

    /// @notice The method to place a lien on a token
    ///         it MUST throw an error if the same holder already has a lien on the same token.
    /// @param tokenId the token a lien is placed on.
    /// @param holder the holder of the lien
    /// @param extraParams extra data for future extension.
    function addLienHolder(uint256 tokenId, address holder, bytes calldata extraParams) public;

    /// @notice The method to remove a lien on a token
    ///         it MUST throw an error if the holder already has a lien.
    /// @param tokenId the token a lien is being removed from.
    /// @param holder the holder of the lien
    /// @param extraParams extra data for future extension.
    function removeLienHolder(uint256 tokenId, address holder, bytes calldata extraParams) public;

    /// @notice The method to query if an active lien exists on a token.
    ///         it MUST throw an error if the tokenId doesn't exist or is not owned.
    /// @param tokenId the token a lien is being queried for
    /// @param holder the holder about whom the method is querying about lien holding.
    /// @param extraParams extra data for future extension.
    function hasLien(uint256 tokenId, address holder, bytes calldata extraParams) public view returns (bool);
}

addLienHolder

javascript
function addLienHolder(uint256 tokenId, address holder, bytes calldata extraParams) public;

Overview

Places a lien on an NFT.

Details

This function places a new lien on the NFT identified by tokenId. The lien is associated with the specified holder. The function must fail if that holder already has a lien on the same token. The extraParams argument provides additional data for future extensions.

Arguments

  • tokenId
    • The identifier of the token on which the lien is placed.
  • holder
    • The address of the lien holder.
  • extraParams
    • Additional data reserved for extensions.

removeLienHolder

javascript
function removeLienHolder(uint256 tokenId, address holder, bytes calldata extraParams) public;

Overview

Removes a lien from an NFT.

Details

This function removes an existing lien from the NFT identified by tokenId. The caller specifies the lien holder whose lien is being removed. The intended behavior described in the original article is to fail if that holder has no existing lien. The comment in the reproduced interface appears inconsistent with this description. The extraParams argument provides additional data for extensions.

Arguments

  • tokenId
    • The identifier of the token from which the lien is removed.
  • holder
    • The address of the lien holder.
  • extraParams
    • Additional data reserved for extensions.

hasLien

javascript
function hasLien(uint256 tokenId, address holder, bytes calldata extraParams) public view returns (bool);

Overview

Checks whether a specified holder has an active lien on an NFT.

Details

This function queries whether an active lien exists for the specified token and holder. It must fail if the token ID does not exist or has no owner. The extraParams argument provides additional data for future extensions.

Arguments

  • tokenId
    • The identifier of the token being queried.
  • holder
    • The address of the lien holder being queried.
  • extraParams
    • Additional data reserved for extensions.

Return value

  • bool
    • Returns true if the specified holder has an active lien on the token, and false otherwise.

Rationale

Supporting ERC-721 NFTs only

Reasoning

For simplicity and gas efficiency, the interface is limited to ERC-721 NFTs. ERC-721 represents individually identifiable assets, with a distinct token ID for each NFT. This makes it straightforward to associate a lien with a specific token.

Other token standards outside the scope

ERC-20, which represents fungible tokens, and ERC-1155, which supports multiple token types, are outside the scope of the proposal. Future extensions could address these standards, but the current interface deliberately focuses on ERC-721.

For more on ERC-20, see the following article.

https://chaldene.net/erc20

For more on ERC-1155, see the following article.

https://chaldene.net/erc1155

Separating addLienHolder and removeLienHolder

Adding and removing liens are separate operations because their purposes and authorization requirements differ. For example, an implementation may authorize an NFT owner to add a lien holder while restricting removal according to the contractual arrangement. The interface itself does not define a complete access-control policy. Implementers must establish who can release a lien and under what conditions.

Excluding the debt amount

The interface does not specify the amount of the underlying debt. The complexity and importance of debt accounting warrant separate standardization. Although the debt amount is an important part of a collateral arrangement, implementing it correctly requires additional design decisions.

Excluding endorsement rules

The proposal also leaves out a standardized mechanism through which lien holders authorize transfers or exchanges. This is another area complex enough to warrant a separate ERC. Endorsement mechanisms can affect the liquidity of encumbered NFTs and therefore require careful design.

These design choices keep the NFT lien interface relatively small and practical. They reflect the challenges of translating complex legal concepts into blockchain applications. Additional standards may address functionality outside the scope of this proposal.

Compatibility

The ERC builds on ERC-721. Contracts implementing this lien extension must also comply with ERC-721 and support the interface defined by ERC-5604. Existing ERC-721 contracts are not automatically required to implement the extension.

Security considerations

The original proposal identifies security considerations as requiring further discussion.

Citation

Zainan Victor Zhou (@xinbenlv), Allen Zhou allen@ubiloan.io, Alex Qin alex@ubiloan.io, "ERC-5604: NFT Lien [DRAFT]," Ethereum Improvement Proposals, no. 5604, September 2022. [Online serial]. Available: https://eips.ethereum.org/EIPS/eip-5604.

Conclusion

This article covered ERC-5604, a proposed interface for placing, removing, and querying liens on NFTs.

If you have questions, feel free to reach out via Twitter DM.

Twitter @cardene777

I also publish on the following platforms.

https://chaldene.net/