Standard Bitcoin Smart Contracts for Digital Assets based on the Bitcoin Agent and SuperAsset white papers.

It is my great pleasure to announce the availability of SuperAsset SA10, which is a Bitcoin UTXO-based smart contract for Differential (Non-Fungible) Tokens (NFT).

TL;DR: Create, transfer, and update any digital asset, license, collectible, identity and any media file at the full speed of UTXOs with 100% trust-less verification and asset rules are enforced by miners in Bitcoin Script. Every asset is represented as a UTXO with a user-defined amount of Satoshis locked in as "reserve value". This acts like a price floor (think of a physical bracelet made of gold) and can be extracted only when the asset is destroyed (ie: "melt" function).  Get the library at superasset-js or use scrypt-boilerplate to start building. Licensed under GPLv3.

View Full Contract (3238 bytes compiled)

Special Thanks to Xiaohui Liu, CEO of sCrypt Inc, for helping me troubleshoot problems and also quickly adding new features that made this possible. The scrypt-sv/boilerplate resources and the sCrypt VSCode Extension have been invaluable for Bitcoin Script development.

Use Cases  

  • Turn images and files into own-able digital assets that can be passed around just like sending Bitcoins
  • Track the identity and state of any asset at the full speed of the blockchain. Supports any data format such as binary, JSON, protobuf and any files up to 4.3GB in size.
  • Perfect for software licenses, memes, games, and even representing physical property

Key Technical Points

  • Mint, transfer, update, and melt tokens that retain their identity and satoshi balance until melted
  • Separate funding inputs and change outputs with ANYONECANPAY
  • Store arbitrary data payloads (JSON, Protobuf, images, etc)
  • Lock any number of Satoshis into the asset for it's entire lifecycle to give it a "base reserve value"
  • Replay protection with globally unique ID passed on as an 'identity baton'
  • Identical trust guarantees for the authenticity of this asset as a plain UTXO
  • Users, wallets, and miner services can trivially verify authenticity and title history by requesting it in it's entirety from the seller (or proactively indexing it themselves from the blocks containing minting of SA10 assets)
  • Simplified Payment Verification (SPV) and 0-conf works as expected with all the properties afforded to the native satoshi
  • Assets cannot be accidentally spent or burned
  • If a corrupt wallet or indexing service returns bad data, then user still has the same security guarantees and protection of their assets as with any regular UTXO.

Asset Authenticity and History Verification

Satoshi intended businesses to proactively filter the UTXO set for anything of interest.

The storage of the asset history is intentionally out of scope and left to each peer (p2p) to resolve and share their asset history with the next owner. In this manner every party has the complete asset history and can verify authenticity back to the minting event. There is no other way to do 100% trust-less verification in this universe.  An asset with 10,000 transfers will amount to only ~40MB of raw transactions with a payload of ~250 bytes. Anyone can easily filter the blocks and achieve consensus with each other proactively as well should they need better performance.

To learn more about the reason and theory behind this design, refer to the section "Driving the point home..." in the Bitcoin Agent white paper.

Contract Overview

The transition rules are enforced in Bitcoin Script (L1) such as conserving the Satoshi quantity and program state layout.

Transfer Function

Mint, transfer, update the asset from one convenient function.

View Full Contract (3238 bytes compiled)
Transfer Function (Mint, Transfer and Update in one)

Melt Function

Destroy the asset and return the locked Satoshis into circulation.

View Full Contract (3238 bytes compiled)
Melt Function

Conclusion

SuperAsset SA10 is a Bitcoin UTXO-based smart contract for Non-Fungible Tokens (NFT). This is the first smart contract in the upcoming line of standard smart contract "SuperAssets". It is GPLv3 licensed and does not require any infrastructure or servers running other than the standard miner Merchant API (MAPI) connection.

  • Turn images and files into own-able digital assets that can be passed around just like sending Bitcoins
  • Track the identity and state of any asset at the speed of UTXOs. Binary, JSON, Protobuf and any data can be easily stored and updated
  • Perfect for software licenses, memes, games, and even representing physical property
  • Lock any number of Satoshis into the asset for it's entire lifecycle to give it a "base reserve value"
  • Simplified Payment Verification (SPV) and 0-conf works as expected with all the properties afforded to the native satoshi

Feel free to contact me and MatterPool for integration help. @mxtterpool.

Technical Resources

MatterPool/superasset-js
SuperAsset Javascript SDK. Start of Standard Bitcoin Smart Contracts for digital assets, collectibles, tokens, and arbitrary consensus state. - MatterPool/superasset-js
superasset-js github repository
@matterpool/superasset-js
SuperAsset Javascript SDK - matterpool.io
Install with "npm install @matterpool/superasset-js"

Read the original introduction to the Bitcoin Agent and SuperAsset.