Skip to content

Latest commit

 

History

History
116 lines (80 loc) · 4.94 KB

mep-600.md

File metadata and controls

116 lines (80 loc) · 4.94 KB
  MEP: 600
  Title: Sensor Data Contract
  Status: Draft
  Type: Standards
  Created: 2023-07-14

MEP-600: NFC NFT Contract

Simple Summary

Specification that allows the user to create NFT on MXC marketplace.

Abstract

MEP-600 describes the process of creation, validation and verification of functional NFTs that are connected with the real world tangible goods. The NFTs are one to one representation of those goods thanks to their connection with NFC tags that are uniquely provisioned and protected from duplication.

Motivation

The motivation behind this MEP is to create a framework for creating the functional NFTs. The purpose of those NFTs is to connect the tangible real world with the intangible world of blockchain and be able to prove that the NFT represents a real item that exists in a given location.

Terminology

  • NFT - Non-Fungible Token, representation of real world tangible goods
  • NFC Tag - Near Field Communication, based on NTAG 424 DNA (NT4H2421Gx) from NXP or a one that offers similar cryptographic features
  • N3XUS - LPWAN enabled NFC reader

Specification

The key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”, “RECOMMENDED”, “MAY”, and “OPTIONAL” in this document are to be interpreted as described in RFC 2119.

Every MEP-666 compliant contract must implement the following interface:

pragma solidity ^0.8.15;

/// @title MEP-600 NFC NFT Contract
interface IMEP600 {
  /// @notice Gets fired when a new NFT is minted
  /// @param _nftOwner address of owner of minted NFT
  /// @param _tokenId token id of the NFT
  /// @param _mintTime the time the NFT was minted
  event NFTCreated(address indexed _nftOwner, uint256 indexed _tokenId, uint256 indexed _mintTime);

  /// @notice Gets fired when NFT is listed for sale
  /// @param _nftOwner address of owner of owns NFT
  /// @param _tokenId token id of the NFT
  event NFTListedForSale(address indexed _nftOwner, uint256 indexed _tokenId);

  /// @notice Gets fired when NFT listed is purchased
  /// @param _nftOwner address of new owner of NFT
  /// @param _tokenId token id of the NFT
  event NFTPurchased(address indexed _nftOwner, uint256 indexed _tokenId);

  /// @notice Creates an NFT for MXC marketplace
  /// @param tokenURI the token URI of the NFT hosted on ipfs
  function createNFT(string memory tokenURI) external returns (uint)

  /// @notice Places an item for sale on MXC marketplace
  /// @param id the token Id of the NFT
  /// @param nftContractAddress contract address of the NFT
  function listNFTForSale(address nftContractAddress, uint256 id) external;

  /// @notice buys the item listed for sale on MXC Marketplace
  /// @param id the token Id of the NFT
  /// @param nftContractAddress contract address of the NFT
  function purchaseNFT(address nftContractAddress, uint256 id) external payable;

  /// @notice Returns all NFT on the marketplace 
  /// @dev MarketItem is a struct
  function fetchMarketNFTs() external view returns (MarketItem[] memory)

  /// @notice Returns only NFT that a user has
  /// @dev MarketItem is a struct
  function fetchMyNFTs() external view returns (MarketItem[] memory)

  /// @notice Returns the details of an NFT
  /// @dev MarketItem is a struct
  function getNFTDetails(uint256 tokenId) external view returns (MarketItem memory)

  /// @notice Returns a list of all NFTs currently listed for sale on the marketplace.
  /// @dev MarketItem is a struct
  function getNFTsForSale() external view returns (MarketItem memory)
}

interface IERC721 {
    event Transfer(address indexed _from, address indexed _to, uint256 indexed _tokenId);

    event Approval(address indexed _owner, address indexed _approved, uint256 indexed _tokenId);

    event ApprovalForAll(address indexed _owner, address indexed _operator, bool _approved);

    function balanceOf(address _owner) external view returns (uint256);

    function ownerOf(uint256 _tokenId) external view returns (address);

    function safeTransferFrom(address _from, address _to, uint256 _tokenId, bytes data) external payable;

    function safeTransferFrom(address _from, address _to, uint256 _tokenId) external payable;

    function transferFrom(address _from, address _to, uint256 _tokenId) external payable;

    function approve(address _approved, uint256 _tokenId) external payable;

    function setApprovalForAll(address _operator, bool _approved) external;

    function getApproved(uint256 _tokenId) external view returns (address);

    function isApprovedForAll(address _owner, address _operator) external view returns (bool);
}

Rationale

The NFC tag gets provisioned and the NFT will be created. The scan will read the UID of empty tag and send it to the ChirpVM.

NFC tags can be read for verification but cannot be modified or copied after they were created. Those tags can be created or verified by the use of a certified LPWAN NFC reader like N3XUS that will validate it and provide a proof of location.