[Ethereum] How to verify ownership to allow resale of NFTs

etheretherscannft

I have discovered NFTs and ETH recently and would like to build a marketplace like opensea but allows resale of NFTs that are already minted on various block chains(ETH, FLOW). Starting with just ETH, when some one comes to marketplace to sell their NFT, I would like to :

  • Verify the ownership of NFT that the seller is claiming to resell on my marketplace. How do I do this? Can I take the seller’s wallet’s public information and query the blockchain somehow?
  • when the seller sends the NFT to the buyer and claims that he sent it, how do i verify that the nft was safely sent to the buyer’s wallet?

From what I have read so far, etherscan seems to have a way to keep track of transactions and also extract NFT metadata to verify ownership of the NFT, how can I do the same?

Best Answer

Seems like you have two problems - the first is ownership verification and the second is trusted exchange. The first is pretty easy to solve with the OpenZeppelin docs for ERC-721. Looks like you're looking for ownerOf(tokenId), which assuming you know the address of the ERC-721 contract and the tokenId should return the address of the owner which you can match against who is sending the message.

However, if you solve the second problem, it automatically solves the first. Check out this Hacker Noon article about implementing an NFT marketplace, where the user with the NFT deposits it into an escrow smart contract (thus proving they own it; you can't deposit what you don't own) and it sits there waiting for someone else to purchase it.

Good luck!

Related Topic