{"eip":5501,"title":"Rental \u0026 Delegation NFT - EIP-721 Extension","description":"Adds a conditional time-limited user role to EIP-721. This role can be delegated or borrowed.","authors":["Jan Smrža (@smrza)","David Rábel (@rabeles11)","Tomáš Janča \u003ctomas.janca@jtbstorage.eu\u003e","Jan Bureš (@JohnyX89)","DOBBYLABS (@DOBBYLABS)"],"status":"Stagnant","type":"Standards Track","category":"ERC","created":"2022-08-18","requires":[165,721,4400,4907],"discussionsTo":"https://ethereum-magicians.org/t/eip-tbd-rental-delegation-nft-erc-721-extension/10441","repo":"ERCs","label":"ERC-5501","officialUrl":"https://eips.ethereum.org/EIPS/eip-5501","sourceUrl":"https://github.com/ethereum/ERCs/blob/master/ERCS/erc-5501.md","url":"https://eips.huatuo.xyz/eip-5501/","tldr":{"en":"Proposed an ERC-721 `user` role with an expiry and an `isBorrowed` flag, so an NFT can be delegated to a hot wallet or rented out while it stays in the owner's wallet and the owner cannot cancel the rental early.","ja":"有効期限と `isBorrowed` フラグを持つ ERC-721 の `user` ロールを提案した。NFT をオーナーのウォレットに置いたまま、ホットウォレットへ委任したり貸し出したりでき、オーナーは貸し出しを途中で取り消せない。","ko":"만료 시점과 `isBorrowed` 플래그가 있는 ERC-721 `user` 역할을 제안했다. NFT를 소유자의 지갑에 둔 채로 핫 월렛에 위임하거나 대여할 수 있으며, 소유자는 대여를 중간에 취소할 수 없다.","zh":"提出带有到期时间和 `isBorrowed` 标志的 ERC-721 `user` 角色，使 NFT 可以在留在所有者钱包中的同时委托给热钱包或出租，并且所有者无法提前取消租约。"},"tags":["nft","erc-721","rental","delegation","gaming"],"explainers":{"en":{"lang":"en","tldr":"Proposed an ERC-721 `user` role with an expiry and an `isBorrowed` flag, so an NFT can be delegated to a hot wallet or rented out while it stays in the owner's wallet and the owner cannot cancel the rental early.","tags":["nft","erc-721","rental","delegation","gaming"],"related":[4907,4400,721,5006,165],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/eip-5501/","markdown":"## What problem does it solve?\n\nMany NFTs are useful (game items, land, tickets, memberships), and the person using one is not always the owner. [ERC-4907](/eip-4907/) added a time-limited `user` role, but the owner can reset the user at any moment. So rental marketplaces had to take custody of the NFT (staking it in a contract) to protect renters. While staked, the owner loses airdrops, free mints and other holder benefits, and cannot list the NFT for sale.\n\nEIP-5501 adds one flag, `isBorrowed`, that locks the user role for the rental period, so the NFT can stay in the owner's wallet throughout.\n\n## How it works\n\nThe `IERC5501` extension (ERC-165 ID `0xf808ec37`) adds:\n\n| Function | Purpose |\n| --- | --- |\n| `setUser(tokenId, user, expires, isBorrowed)` | Owner or approved operator sets the user, an expiry timestamp and the borrow flag |\n| `userOf(tokenId)` | Current user; should revert if unset or expired |\n| `userExpires(tokenId)` | When the user role ends |\n| `userIsBorrowed(tokenId)` | Whether the role is a locked rental |\n\nTwo modes come out of this:\n\n- **Delegation** (`isBorrowed = false`): e.g. point the user role at a hot wallet. The owner can change it at any time, and it is cleared on transfer.\n- **Rental** (`isBorrowed = true`): `setUser` must revert until `expires` has passed, and the user **survives transfers**, so the owner can even sell the NFT mid-rental.\n\nA user must never be treated as an owner: no transfers, no approvals. Optional extensions add `userBalanceOf`, `tokenOfUserByIndex`, and a **Terminable** extension where lender and borrower each call `setBorrowTermination` and then anyone can call `terminateBorrow` to end a rental early.\n\n## Sample code\n\nThe core rule, sketched on top of OpenZeppelin ERC-721 (v5):\n\n```solidity\n// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\nimport {ERC721} from \"@openzeppelin/contracts/token/ERC721/ERC721.sol\";\n\nabstract contract RentableSketch is ERC721 {\n    struct UserInfo { address user; uint64 expires; bool isBorrowed; }\n    mapping(uint256 =\u003e UserInfo) internal _users;\n    event UpdateUser(uint256 indexed tokenId, address indexed user, uint64 expires, bool isBorrowed);\n\n    function setUser(uint256 tokenId, address user, uint64 expires, bool isBorrowed) public {\n        require(user != address(0), \"zero user\");\n        _checkAuthorized(ownerOf(tokenId), msg.sender, tokenId);\n        UserInfo memory u = _users[tokenId];\n        require(!(u.isBorrowed \u0026\u0026 u.expires \u003e= block.timestamp), \"borrowed\");\n        _users[tokenId] = UserInfo(user, expires, isBorrowed);\n        emit UpdateUser(tokenId, user, expires, isBorrowed);\n    }\n\n    function _update(address to, uint256 tokenId, address auth) internal virtual override returns (address from) {\n        from = super._update(to, tokenId, auth);\n        if (from != to \u0026\u0026 !_users[tokenId].isBorrowed) {   // delegation is cleared on transfer\n            delete _users[tokenId];\n            emit UpdateUser(tokenId, address(0), 0, false);\n        }\n    }\n}\n```\n\n## Things to know\n\n- Status: **Stagnant**. [ERC-4907](/eip-4907/) (Final) is the more widely known rental standard, and apps reading `userOf` and `userExpires` can work with either.\n- A rental with a huge `expires` locks the owner out of `setUser` indefinitely unless the Terminable extension is implemented.\n- Since owner and user are both active at once, apps must decide which benefits go to which role to avoid \"double spending\" a perk.\n- Marketplaces should show whether a listed NFT is currently borrowed.\n"},"ja":{"lang":"ja","tldr":"有効期限と `isBorrowed` フラグを持つ ERC-721 の `user` ロールを提案した。NFT をオーナーのウォレットに置いたまま、ホットウォレットへ委任したり貸し出したりでき、オーナーは貸し出しを途中で取り消せない。","tags":["nft","erc-721","rental","delegation","gaming"],"related":[4907,4400,721,5006,165],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ja/eip-5501/","markdown":"## 何を解決するのか\n\n多くの NFT（ゲームアイテム、土地、チケット、メンバーシップ）は実用的ですが、それを使う人が常にオーナーとは限りません。[ERC-4907](/eip-4907/) は期限付きの `user` ロールを追加しましたが、オーナーはいつでも user をリセットできます。そのため、レンタルマーケットプレイスは借り手を守るために NFT を預かる（コントラクトにステークする）必要がありました。ステーク中は、オーナーはエアドロップ、無料 mint などの保有者特典を受け取れず、NFT を売りに出すこともできません。\n\nEIP-5501 は、貸し出し期間中に user ロールをロックするフラグ `isBorrowed` を 1 つ追加し、NFT が常にオーナーのウォレットに留まれるようにします。\n\n## 仕組み\n\n`IERC5501` 拡張（ERC-165 ID `0xf808ec37`）は次を追加します。\n\n| 関数 | 役割 |\n| --- | --- |\n| `setUser(tokenId, user, expires, isBorrowed)` | オーナーまたは承認済みオペレーターが、user、有効期限のタイムスタンプ、借用フラグを設定する |\n| `userOf(tokenId)` | 現在の user。未設定または期限切れの場合は revert すべき |\n| `userExpires(tokenId)` | user ロールが終了する時刻 |\n| `userIsBorrowed(tokenId)` | そのロールがロックされたレンタルかどうか |\n\nこれにより 2 つのモードが生まれます。\n\n- **委任**（`isBorrowed = false`）: たとえば user ロールをホットウォレットに向けます。オーナーはいつでも変更でき、転送時にクリアされます。\n- **レンタル**（`isBorrowed = true`）: `expires` を過ぎるまで `setUser` は revert しなければならず、user は**転送後も維持されます**。そのため、オーナーはレンタル中でも NFT を売却できます。\n\nuser はオーナーとして扱われてはなりません。転送も承認もできません。オプションの拡張として、`userBalanceOf`、`tokenOfUserByIndex`、さらに貸し手と借り手がそれぞれ `setBorrowTermination` を呼んだあと、誰でも `terminateBorrow` を呼んでレンタルを途中終了できる **Terminable** 拡張があります。\n\n## サンプルコード\n\nOpenZeppelin ERC-721（v5）上に、中心となるルールをスケッチしたものです。\n\n```solidity\n// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\nimport {ERC721} from \"@openzeppelin/contracts/token/ERC721/ERC721.sol\";\n\nabstract contract RentableSketch is ERC721 {\n    struct UserInfo { address user; uint64 expires; bool isBorrowed; }\n    mapping(uint256 =\u003e UserInfo) internal _users;\n    event UpdateUser(uint256 indexed tokenId, address indexed user, uint64 expires, bool isBorrowed);\n\n    function setUser(uint256 tokenId, address user, uint64 expires, bool isBorrowed) public {\n        require(user != address(0), \"zero user\");\n        _checkAuthorized(ownerOf(tokenId), msg.sender, tokenId);\n        UserInfo memory u = _users[tokenId];\n        require(!(u.isBorrowed \u0026\u0026 u.expires \u003e= block.timestamp), \"borrowed\");\n        _users[tokenId] = UserInfo(user, expires, isBorrowed);\n        emit UpdateUser(tokenId, user, expires, isBorrowed);\n    }\n\n    function _update(address to, uint256 tokenId, address auth) internal virtual override returns (address from) {\n        from = super._update(to, tokenId, auth);\n        if (from != to \u0026\u0026 !_users[tokenId].isBorrowed) {   // delegation is cleared on transfer\n            delete _users[tokenId];\n            emit UpdateUser(tokenId, address(0), 0, false);\n        }\n    }\n}\n```\n\n## 知っておくべきこと\n\n- ステータス: **Stagnant**。[ERC-4907](/eip-4907/)（Final）のほうがレンタル標準として広く知られており、`userOf` と `userExpires` を読むアプリはどちらでも動作します。\n- `expires` に非常に大きな値を指定したレンタルは、Terminable 拡張が実装されていない限り、オーナーが `setUser` を無期限に使えなくなります。\n- オーナーと user が同時にアクティブであるため、アプリは特典の「二重取り」を避けるために、どの特典をどのロールに与えるかを決める必要があります。\n- マーケットプレイスは、出品中の NFT が現在借りられているかどうかを表示すべきです。\n"},"ko":{"lang":"ko","tldr":"만료 시점과 `isBorrowed` 플래그가 있는 ERC-721 `user` 역할을 제안했다. NFT를 소유자의 지갑에 둔 채로 핫 월렛에 위임하거나 대여할 수 있으며, 소유자는 대여를 중간에 취소할 수 없다.","tags":["nft","erc-721","rental","delegation","gaming"],"related":[4907,4400,721,5006,165],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ko/eip-5501/","markdown":"## 어떤 문제를 해결하나요?\n\n게임 아이템, 토지, 티켓, 멤버십처럼 쓸모가 많은 NFT가 많은데, 이를 사용하는 사람이 항상 소유자인 것은 아닙니다. [ERC-4907](/eip-4907/)은 기간이 있는 `user` 역할을 추가했지만 소유자는 언제든 user를 초기화할 수 있습니다. 그래서 대여 마켓플레이스는 임차인을 보호하기 위해 NFT를 보관(컨트랙트에 스테이킹)해야 했습니다. 스테이킹된 동안 소유자는 에어드롭, 무료 민팅 같은 보유자 혜택을 잃고 NFT를 판매 등록할 수도 없습니다.\n\nEIP-5501은 대여 기간 동안 user 역할을 잠그는 플래그 `isBorrowed`를 하나 추가하여, NFT가 내내 소유자의 지갑에 머물 수 있게 합니다.\n\n## 어떻게 동작하나요?\n\n`IERC5501` 확장(ERC-165 ID `0xf808ec37`)은 다음을 추가합니다.\n\n| 함수 | 역할 |\n| --- | --- |\n| `setUser(tokenId, user, expires, isBorrowed)` | 소유자 또는 승인된 오퍼레이터가 user, 만료 타임스탬프, 대여 플래그를 설정 |\n| `userOf(tokenId)` | 현재 user. 설정되지 않았거나 만료되었으면 revert해야 함 |\n| `userExpires(tokenId)` | user 역할이 끝나는 시점 |\n| `userIsBorrowed(tokenId)` | 해당 역할이 잠긴 대여인지 여부 |\n\n이로써 두 가지 모드가 생깁니다.\n\n- **위임**(`isBorrowed = false`): 예를 들어 user 역할을 핫 월렛으로 지정합니다. 소유자는 언제든 바꿀 수 있으며 전송 시 초기화됩니다.\n- **대여**(`isBorrowed = true`): `expires`가 지날 때까지 `setUser`는 반드시 revert해야 하며, user는 **전송 후에도 유지됩니다**. 따라서 소유자는 대여 도중에도 NFT를 팔 수 있습니다.\n\nuser를 소유자로 취급해서는 안 됩니다. 전송도, 승인도 할 수 없습니다. 선택적 확장으로 `userBalanceOf`, `tokenOfUserByIndex`, 그리고 대여자와 차용자가 각각 `setBorrowTermination`을 호출한 뒤 누구나 `terminateBorrow`를 호출해 대여를 일찍 끝낼 수 있는 **Terminable** 확장이 있습니다.\n\n## 샘플 코드\n\nOpenZeppelin ERC-721(v5) 위에 핵심 규칙을 스케치한 코드입니다.\n\n```solidity\n// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\nimport {ERC721} from \"@openzeppelin/contracts/token/ERC721/ERC721.sol\";\n\nabstract contract RentableSketch is ERC721 {\n    struct UserInfo { address user; uint64 expires; bool isBorrowed; }\n    mapping(uint256 =\u003e UserInfo) internal _users;\n    event UpdateUser(uint256 indexed tokenId, address indexed user, uint64 expires, bool isBorrowed);\n\n    function setUser(uint256 tokenId, address user, uint64 expires, bool isBorrowed) public {\n        require(user != address(0), \"zero user\");\n        _checkAuthorized(ownerOf(tokenId), msg.sender, tokenId);\n        UserInfo memory u = _users[tokenId];\n        require(!(u.isBorrowed \u0026\u0026 u.expires \u003e= block.timestamp), \"borrowed\");\n        _users[tokenId] = UserInfo(user, expires, isBorrowed);\n        emit UpdateUser(tokenId, user, expires, isBorrowed);\n    }\n\n    function _update(address to, uint256 tokenId, address auth) internal virtual override returns (address from) {\n        from = super._update(to, tokenId, auth);\n        if (from != to \u0026\u0026 !_users[tokenId].isBorrowed) {   // delegation is cleared on transfer\n            delete _users[tokenId];\n            emit UpdateUser(tokenId, address(0), 0, false);\n        }\n    }\n}\n```\n\n## 알아둘 점\n\n- 상태: **Stagnant**. [ERC-4907](/eip-4907/)(Final)이 더 널리 알려진 대여 표준이며, `userOf`와 `userExpires`를 읽는 앱은 둘 다 사용할 수 있습니다.\n- `expires`가 매우 큰 대여는 Terminable 확장을 구현하지 않는 한 소유자가 `setUser`를 무기한 사용하지 못하게 만듭니다.\n- 소유자와 user가 동시에 활성 상태이므로, 앱은 혜택을 \"이중으로 사용\"하는 일이 없도록 어떤 혜택을 어느 역할에 줄지 정해야 합니다.\n- 마켓플레이스는 판매 등록된 NFT가 현재 대여 중인지 표시해야 합니다.\n"},"zh":{"lang":"zh","tldr":"提出带有到期时间和 `isBorrowed` 标志的 ERC-721 `user` 角色，使 NFT 可以在留在所有者钱包中的同时委托给热钱包或出租，并且所有者无法提前取消租约。","tags":["nft","erc-721","rental","delegation","gaming"],"related":[4907,4400,721,5006,165],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/zh/eip-5501/","markdown":"## 它解决什么问题？\n\n许多 NFT 很有用（游戏道具、土地、门票、会员资格），而使用它的人并不总是所有者。[ERC-4907](/eip-4907/) 增加了有时间限制的 `user` 角色，但所有者可以随时重置 user。因此，租赁市场为了保护租户，不得不托管 NFT（把它质押到合约里）。质押期间，所有者会失去空投、免费铸造等持有者福利，也不能挂牌出售该 NFT。\n\nEIP-5501 增加了一个标志 `isBorrowed`，在租期内锁定 user 角色，这样 NFT 可以全程留在所有者的钱包中。\n\n## 它如何运作\n\n`IERC5501` 扩展（ERC-165 ID 为 `0xf808ec37`）增加了：\n\n| 函数 | 用途 |\n| --- | --- |\n| `setUser(tokenId, user, expires, isBorrowed)` | 所有者或获批准的操作员设置 user、到期时间戳和借用标志 |\n| `userOf(tokenId)` | 当前 user；未设置或已过期时应 revert |\n| `userExpires(tokenId)` | user 角色何时结束 |\n| `userIsBorrowed(tokenId)` | 该角色是否为被锁定的租赁 |\n\n由此产生两种模式：\n\n- **委托**（`isBorrowed = false`）：例如把 user 角色指向热钱包。所有者可以随时更改，转移时会被清除。\n- **租赁**（`isBorrowed = true`）：在 `expires` 之前 `setUser` 必须 revert，并且 user **在转移后依然保留**，所以所有者在租赁期间甚至可以出售该 NFT。\n\n绝不能把 user 当作所有者对待：不能转移，不能授权。可选扩展增加了 `userBalanceOf`、`tokenOfUserByIndex`，以及一个 **Terminable** 扩展：出租方和借用方各自调用 `setBorrowTermination`，之后任何人都可以调用 `terminateBorrow` 来提前结束租赁。\n\n## 示例代码\n\n核心规则的草图，基于 OpenZeppelin ERC-721（v5）：\n\n```solidity\n// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\nimport {ERC721} from \"@openzeppelin/contracts/token/ERC721/ERC721.sol\";\n\nabstract contract RentableSketch is ERC721 {\n    struct UserInfo { address user; uint64 expires; bool isBorrowed; }\n    mapping(uint256 =\u003e UserInfo) internal _users;\n    event UpdateUser(uint256 indexed tokenId, address indexed user, uint64 expires, bool isBorrowed);\n\n    function setUser(uint256 tokenId, address user, uint64 expires, bool isBorrowed) public {\n        require(user != address(0), \"zero user\");\n        _checkAuthorized(ownerOf(tokenId), msg.sender, tokenId);\n        UserInfo memory u = _users[tokenId];\n        require(!(u.isBorrowed \u0026\u0026 u.expires \u003e= block.timestamp), \"borrowed\");\n        _users[tokenId] = UserInfo(user, expires, isBorrowed);\n        emit UpdateUser(tokenId, user, expires, isBorrowed);\n    }\n\n    function _update(address to, uint256 tokenId, address auth) internal virtual override returns (address from) {\n        from = super._update(to, tokenId, auth);\n        if (from != to \u0026\u0026 !_users[tokenId].isBorrowed) {   // delegation is cleared on transfer\n            delete _users[tokenId];\n            emit UpdateUser(tokenId, address(0), 0, false);\n        }\n    }\n}\n```\n\n## 需要注意\n\n- 状态：**Stagnant**。[ERC-4907](/eip-4907/)（Final）是更广为人知的租赁标准，读取 `userOf` 和 `userExpires` 的应用可以兼容两者。\n- 如果租赁的 `expires` 非常大，除非实现了 Terminable 扩展，否则所有者将被无限期锁定而无法调用 `setUser`。\n- 由于所有者和 user 同时处于活跃状态，应用必须决定哪些福利归哪个角色，以避免同一福利被\"重复使用\"。\n- 市场应该显示挂牌的 NFT 当前是否处于被借用状态。\n"}}}
