Tradeable Atomic Asset

  • status: published
  • version: 1.0.0

Abstract

An atomic asset is a unique package that includes data, labels (also known as tags), and a specific agreement, all under a single, unchangeable identifier. This allows applications and users to access the data, labels, and agreement by using just this one identifier.

To enable trading of the Atomic Asset, we must connect it to something called a SmartWeave Token. This connection transforms the asset into what's known as an Atomic Token and allows it to be exchanged or traded.

The SmartWeave Token has a special feature called a balances object that keeps track of who owns the tokens related to that particular asset. This ensures that ownership and trades are recorded and managed accurately.

Motivation

This specification is designed to give detailed instructions on how to create atomic assets within the permanent web ecosystem. The ability to trade these assets is a crucial feature for online communities and networks.

What's innovative about this approach is that it allows the tradeability of an asset to be controlled within the asset itself. This is a new way of handling digital economies and is particularly effective for managing digital licenses. In other words, it offers a streamlined and self-contained method for controlling how digital assets can be bought, sold, or exchanged.

Specification

When data is published on Arweave, specific tags are assigned to the information. These tags serve as metadata, enabling the data to be discovered through Arweave gateways. Additionally, these tags can signify that the associated transaction is a SmartWeave contract. The required tags for describing this are as follows:

  • Gateway Identifiers
  • Asset Identifiers
  • Contract Identifiers
  • License Identifiers

Gateway Capability Identifiers

Name Description Optional
Content-Type Describes the content using a mime-type, this flag instructs the gateway web server how to appropriately tag this information. False

Asset Discoverability Identifiers

Name Description Optional
Type Type of asset. One or more of: meme, image, video, podcast, blog-post, social-post, music, audio, token, web-page, profile, contract, presentation, document, collection, app, other False
Title A maximum of 150 characters used to identify the content, this title can provide a quick eye catching description of the asset False
Description A longer description of 300 characters that can provide a set of details further describing the asset False
Topic* Zero to many topics that can be used to locate assets of a given type by a specific topic. For example: an asset of type meme might have the following two topics, Funny, Sports. True

For more information about the Discoverability Spec - https://specs.arweave.dev/?tx=SYHBhGAmBo6fgAkINNoRtumOzxNB8-JFv2tPhBuNk5c

Contract Identifiers

Name Description Example/Value Optional
App-Name Flags this TX as a SmartWeave Contract SmartWeaveContract False
App-Version The version of SmartWeave that is supported 0.3.0 False
Contract-Src The source code for the contract Of9pi--Gj7hCTawhgxOwbuWnFI1h24TTgO5pw8ENJNQ False
Init-State The starting state of the contract { "ticker": "ATOMIC", "name": "asset-name", "balances": { "address": 100 }, "claimable": [] } - this is an example, but it is important to include these properties as your initial state for your asset. False
Contract-Manifest the manifest required to properly evaluate {"evaluationOptions":{"sourceType":"redstone-sequencer","allowBigInt":true,"internalWrites":true,"unsafeClient":"skip","useConstructor":true}} False
Indexed-By the tag to work with universal market place ucm False

License Tags

Name Description Example/Value Optional
License The license you are using udlicense False
Access Access Rights public or restricted True
Access-Fee Fee for access One-Time-0.1 or Monthly-0.001 True
Derivation Derived Works see license for options allowed-with-license-fee True
Derivation-Fee Derived Rights Fee public or restricted True
Commercial is commercial access allowed? allowed True
Commercial-Fee commercial license fee One-Time-0.1 True
Payment-Mode type of payment for owners Global-Distirbution or Random-Distribution True

When these tags are included with a digital asset, you have a tradeable asset that can be consumed by any application on the permaweb and clearly provide the rights on how to access as well as who to pay for the access.

For more information about SmartWeave Contracts check out https://academy.warp.cc - For more infomation about UDLicense check out https://udlicense.arweave.dev For more information about Asset Discoverability check out https://specs.g8way.io

Code Example

import Bundlr from '@bundlr-network/client'
import { WarpFactory } from 'warp-contracts'
import { DeployPlugin } from 'warp-contracts-plugin-deploy'
import fs from 'fs'

const ATOMIC_TOKEN_SRC = 'Of9pi--Gj7hCTawhgxOwbuWnFI1h24TTgO5pw8ENJNQ'
const warp = WarpFactory.forMainnet().use(new DeployPlugin())

export async function main() {
  const jwk = JSON.parse(fs.readFileSync(walletFile, 'utf-8'))
  const bundlr = new Bundlr.default('https://node2.bundlr.network', 'arweave', jwk)
  
  const tags = [
       { name: 'Content-Type', value: asset.fileType },
        { name: 'App-Name', value: 'SmartWeaveContract'},
        { name: 'App-Version', value: '0.3.0'},
        { name: 'Contract-Src', value: ATOMIC_TOKEN_SRC},
        { name: 'Contract-Manifest', value: '{"evaluationOptions":{"sourceType":"redstone-sequencer","allowBigInt":true,"internalWrites":true,"unsafeClient":"skip","useConstructor":true}}'},
        { name: 'Init-State', value: JSON.stringify({
          balances: {
            "K92n-x2kHiRIBmS0yRGz5ii3OEXFw58__742Qu0DTgA": 100
          },
          name: "Title of Asset",
          description: "Description of Asset",
          ticker: 'ATOMIC',
          claimable: []
        })},
        { name: 'Title', value: "Title of Asset" },
        { name: 'Description', value: "Description of Asset" },
        { name: 'Type', value: "asset" },
        { name: 'Indexed-By', value: 'ucm'},
        { name: "License", value: 'udlicense'},
        { name: "Access", value: "restricted"},
        { name: "Access-Fee", value: "One-Time-0.001" },
        { name: "Derivation", value: "allowed-with-license-fee" },
        { name: "Derivation-Fee", value: "One-Time-0.1" },
        { name: "Commercial": value: "allowed" },
        { name: "Commercial-Free", value: "One-Time-0.5" },
        { name: "Payment-Mode", value: "Global-Distribution" }
  ]

  const result = await bundlr.uploadFile('./asset.png', { tags })
  await warp.register(result.id, 'node2')
}

main()

This example is a guide, but may not work depending on your platform and development tooling, please check the latest documentation of Bundlr and Warp.