Skip to content

Static Data

Assaf Shomer edited this page Oct 13, 2015 · 18 revisions

This part of the metadata includes optional static data fields. Currently the colored coins implementation recognizes the following keys:

assetId

Including the [assetId](Asset ID) in the metadata during asset transfer, while optional, can expedite processing. Note that one cannot include the Asset ID during issuance because the Asset ID was not yet determined.

assetName

Asset Name as a free string

assetGenesis

This field is required only upon re-issuance of an asset by a minter, regardless of whether the asset is locked or unlocked. The genesis field stores the block and transaction ids of the issuance transaction.

issuer

A free string describing the Asset's issuer

description

A free string describing the Asset

urls

An array of JSON objects, each containing a link to a file (hosted on some remote server) containing data about the asset.

{
    name: String,
    url: String,
    mimeType: String, // mime type of data in that url
    dataHash: String // SHA-256 hash of the data (to allow data verification)
}

the following are predefined names for use with the coloredcoins explorer:
icon - this will be the icon of the asset on asset pages and lists

large_icon - a larger version of the icon to be displayed on larger screens

Other examples:

consider a legal contract describing the issuer's promise to redeem each unit for goods or services in the real world. That legal document file can be hosted on the issuer's company website and linked using the URL data field. A hash of the document can be stored as well to ensure that the issuer (or otherwise host of the data) did not alter it. Both issuers and holders of an asset can thus refer unambiguously to the original contract against which the asset was issued.

userData

A list of free JSON objects.

meta

A special key named meta is used to allow the colored coins explorer and client side applications to display said data. The value of the meta key should be an array of {key,value,type} objects that will be displayed by the explorer.

{key: String, value: String, type: String}

Data Types that are currently parsed by the explorer:

String, Number, Boolean, Date, URL, Email

if a Type is not specified the parser defaults to the JSON datatype (String, Number or Boolean)

Examples:

{key: "user name", value: "username", type: "String"}
{key: "birthday", value: "01/01/1970", type: "Date"}

free JSON

On top of the meta key, whose values are parsed and displayed in the colored coins explorer, you can add arbitrary key value pairs.

The general syntax of the userData key is thus

userData : {
      meta: [
              {key: String, value: String, type: String},
              {key: String, value: String, type: String},
               .......
            ],
      user_key: user_value,
      user_key: user_value,
      ...
     },

Metadata Encryption

The colored coins protocol supports the use of RSA public keys for metadata encryption. Any (or all) of the free JSON user data values can be encrypted by specifying

  • The JSON key whose value is to be encrypted
  • The format: pem or der
  • The padding scheme: pkcs1 or pkcs8

To encrypt user metadata add an encryptions key whose value is an array, each element of the array is a JSON of the form

 {
   key:String, 
   pubKey:String, 
   format:String, 
   type:String
  }

Where

  • pubKey: An RSA public key
  • format: The RSA public key format (pem or der)
  • type: The RSA padding scheme ( pkcs1 or pkcs8)
  <b>encryptions</b>: [
        {key: "user_key", pubKey: 'RSA Public Key',format:'pem|der',type:'pkcs1|pkcs8' },

Here is an example.

Issuer Verification

Asset issuers can select three methods of verification to increase user confidence in the value of assets that they issue. The point is to create linkages (of various strengths) to the issuer real world identity.

Tying into a social graph

An asset issuer can use one or more social channels (e.g. Twitter, Facebook, Github) to notify about an asset issuance. A link to this social media post can then be embedded in the asset metadata, linking the asset to the entity that controls the social media accounts. Th

Placing a file behind SSL

An asset issuer (for example a company) that owns a web server with an SSL certificate can place a file with

Clone this wiki locally