DeFi on Bitcoin Part 2: NFT and marketplace – CoinGeek

Home » Tech » DeFi on Bitcoin Part 2: NFT and marketplace

This post was first published on Medium. Read DeFi on Bitcoin Part 1: Fungible tokens and token swap and DeFi on Bitcoin Part 3: Uniswap.
In part 2 of the series, we illustrate how to build non-fungible tokens (NFT) and sell them directly on Bitcoin.
Non-Fungible Tokens
In a basic setup, an NFT contract is simply a table with two columns: an ID, uniquely representing a non-fungible asset, and its rightful owner.
NFT Table ID and Owner
NFT Table
The following contract implements such a basic NFT contract, similar to ERC721 token standard in Ethereum.
ERC721 Contract
It is very similar to the fungible token contract we have developed. The most notable difference is the token table at Line 6, mapping ID to its owner, instead of owner to token balance.
Sell NFT
Let us sell some NFTs in exchange for bitcoins. This is akin to swapping fungible tokens. Instead, we swap an NFT for bitcoins.
In the following example, Alice only signs if the payment amount meets her price requirement, in the second output of tx2. Bob only signs if he becomes the new owner of NFT with id 1, in the first output of tx2. Again, the sale is non-custodial and atomic.
NFT Sale chart
NFT Sale
Extensions
There are a variety of ways to extend the sale. We list a few examples:
Watch: CoinGeek New York panel, Licensing IP for NFTs: Graphic Novels, Comic Books & Brands

New to Bitcoin? Check out CoinGeek’s Bitcoin for Beginners section, the ultimate resource guide to learn more about Bitcoin—as originally envisioned by Satoshi Nakamoto—and blockchain.
In the first part of this series on why it’s more advantageous to run DeFi on Bitcoin, sCrypt demonstrates how to implement fungible tokens and swap them atomically.
The top executive suggests a proof of work (PoW) mining ban as well as a switch to proof of stake (PoS) mining, which he believes “has a significantly lower energy profile.”
BitcoinSV.com has released its first batch of over 50 tools, all vetted by BSV devs to help developers build, test, and deploy their applications on the BSV blockchain.
Author ZeMing Gao created a chart-based technical analysis of the BTC and BSV block reward mining, comparing the networks’ transaction fees, background, hash power, price, and more.

source