Skip to content

Latest commit

 

History

History
155 lines (109 loc) · 11.1 KB

README.MD

File metadata and controls

155 lines (109 loc) · 11.1 KB

NeRINE by Neti

Neti Rental Interface for NFT Ecosystem

The problem

Hi, we are Neti - a software development boutique hooked on blockchain. We believe that NFT tokens (apart from the art) have a huge utility potential. But why would you have to buy NFT to use it? You can borrow a bike from your friend without any collateral, you can borrow a laptop or jacket. Why not NFT?

The solution

With the rescue comes NeRINE - Neti Rental Interface for NFT Ecosystem. It's the first solution on the market that offers the possibility of safely renting NFTs without the need to pay a deposit while guaranteeing both parties the return of the item on agreed terms. Most importantly, you don't need to lock any deposit; only the amount agreed for renting. Interesting?

Architecture.

  • The owner of the NFT registers the token as "ready to be rented" and specifies the deal's details: time of rent, price, etc.
  • Our "lease manager" (a smart contract) sets itself as the operator. It means it can transfer NFT to other users.
  • The token is placed on the marketplace so that everyone can borrow it just for the agreed price and for an agreed period
  • After borrowing the token, the user can use its utility for the agreed period
  • When the rental period finishes, our "leas manger" will ensure that the token is returned to the original owner.

How is this magic possible?

It works with the usage of Tezos Custom Policy, the functionality that is present only on the Tezos chain. It allows us to set the operator's role to the smart contract for the given NFT and enforce return through that mechanism later on.

What is so unique in this approach?

  • Users don't need to put collateral to borrow the NFT
  • The owner of the NFT has a guarantee that after the agreed period, the token will be returned to him.

Practical use cases for NeRINE? Let's name a few:

  • Items market in the computer gaming industry, which allows you to make money on the items you have in a safe way
  • Subscription model through renting NFT, which allows any application to behave like a Web2 SaaS platform
  • Safely borrow NFT to a friend (even for free) with the guarantee of return. The NFT can represent tickets, access to some resources, or whatever you need :)

Where we are

Well, what we built during the hackathon is just proof of technology. We know how to make it work for all NFS on the Tezos chain, and we have ideas on how the approach can be monetized and profitable for NFT creators and also users. For us, it's just the beginning of the story.

Table of Contents (for the technical details)

Technology Stack

  • SmartPy: A language for developing smart contracts on the Tezos blockchain.
  • Smartpy.io IDE: An integrated development environment for SmartPy.

Key Features

  1. NFT Registration in Lease Manager Contract:

    • Users have the capability to register their NFTs for rental purposes. Upon successful registration, the NFT's status is set to 'OPEN' for rental, and it becomes non-transferable by the owner. The transfer of the NFT is exclusively managed by the Lease Manager Contract.
  2. Renting NFTs:

    • Users can rent NFTs for a predetermined duration as defined in the Lease Manager Contract. During the rental period, the lessee has usage rights but cannot transfer the NFT to other parties.
  3. Returning NFTs:

    • Post the expiration of the rental period, the NFT is returned to its original owner by the Lease Manager Contract. Subsequently, the NFT is unlocked and deregistered from the Lease Manager Contract, enabling the owner to transfer it freely.
  • Secondary Market for NFT Rentals:
    • Future enhancements include the development of a secondary market where users can rent out NFTs they have leased to other users. This will create a dynamic and user-driven rental ecosystem. A modified Tezos wallet will be introduced to facilitate these transactions, ensuring a secure and efficient process. The system will automatically distribute fees between the original NFT owner and the Rental platform, maintaining a fair revenue-sharing model.

Installation, Setup and Testing

Use the smartpy.io environment to deploy smart contracts and run tests.

Usage: LeaseManager Contract Entrypoints

The LeaseManager contract in the NeRINE has several entrypoints, each requiring specific data inputs. Below are the details for each entrypoint.

Entrypoint: register

Description

Registers an NFT for rental.

Required Data

  • token_address: Address of the NFT token (type: sp.address)
  • token_id: Unique identifier of the NFT (type: sp.nat)
  • lease_contract: Address of the lease contract (type: sp.address)

Entrypoint: lease

Description

Allows a user to lease a registered NFT.

Required Data

  • nft_data: A record with the following fields
    • token_address: Address of the NFT token (type: sp.address)
    • token_id: Unique identifier of the NFT (type: sp.nat)
    • lease_contract: Address of the lease contract (type: sp.address)

Entrypoint: unlease

Description

Returns the leased NFT to the original owner after the rental period.

Required Data

  • nft_data: A record with the following fields
    • token_address: Address of the NFT token (type: sp.address)
    • token_id: Unique identifier of the NFT (type: sp.nat)
    • lease_contract: Address of the lease contract (type: sp.address)

Ensure that all data provided to the entrypoints follow the specified types and formats. Incorrect or invalid data may result in transaction failures or unintended behavior.

Testing the LeaseManager Contract

The LeaseManager contract includes several tests to ensure its functionality and robustness. These tests simulate various scenarios to validate the contract's behavior under different conditions. Below is an overview of what each test is designed to accomplish.

Test: Registering and Leasing NFT

Objective

To verify that an NFT can be successfully registered for leasing and then leased to a user.

Procedure

  1. A test NFT is created and registered in the LeaseManager contract.
  2. The test simulates a user leasing the NFT.
  3. Checks are performed to ensure the NFT's status changes appropriately and that it cannot be transferred outside the contract's control during the lease.

Test: Returning Leased NFT

Objective

To confirm that a leased NFT is correctly returned to the owner after the rental period.

Procedure

  1. An NFT is leased as per the first test.
  2. The test simulates the passing of the rental period.
  3. The contract's unlease function is invoked to return the NFT.
  4. Checks are performed to ensure the NFT is returned to the owner and its status updated accordingly.

Test: Invalid Transfer Attempts

Objective

To test the contract's ability to prevent invalid transfers of a leased NFT.

Procedure

  1. An NFT is leased to a user.
  2. Attempts are made to transfer the NFT to another user, which should be invalid during the lease period.
  3. Checks are performed to ensure these transfer attempts fail as expected.

Test: NFT Status Updates

Objective

To ensure that the NFT's status is accurately updated throughout the lease process.

Procedure

  1. The status of an NFT is monitored as it goes through registration, leasing, and return.
  2. Checks are performed to ensure the status reflects the current state of the NFT (e.g., 'OPEN', 'LEASED').

Contributing

Contributions to the NeRINE project are welcome. Please follow standard open-source contribution guidelines.

Contact

For more information: