Asset creation

The first step is to create the asset identifier!

One more time, we are doing to use the hash function on three elements:

  • The utxo being spent to mint the asset.
  • Your asset’s name.
  • Meta information associated with the asset (homepage url, logo, documents…).

Here is the formula : asset_id = sha256(genesis_outpoint || asset_tag || asset_meta)

If you have the private key for the bitcoin UTXO, you cannot move Taproot assets if you don’t also have the keys for the asset scripts. The only thing you as the owner of the bitcoin UTXO can do is to commit to the same asset state again ( basically using the same Taproot Assets root hash again) or burn all the assets by not committing to any Taproot Assets root hash anymore.

This is the genesis information of an asset (This information never changes):

FieldDescription
genesis_pointThe first outpoint of the transaction that created the asset (txid:vout)
nameThe name of the asset
metaThe hashed meta data of the asset
asset_idThe asset ID that uniquely identifies the asset
output_indexThe index of the output that carries the unique Taproot Assets commitment in the genesis transaction
genesis_bootstrap_infoThe full genesis information encoded in a portable manner so it can be easily copy pasted for address creation

This how an asset is defined:

FieldDescription
genesis_pointThe genesis information
asset_typeAssert type (normal or collectible)
amountThe total amount of the asset stored in this Taproot Assets UTXO
lock_timeAn optional locktime, as with Bitcoin transactions
relative_lock_timeAn optional relative lock time, same as Bitcoin transactions
script_keyThe script key of the asset, which can be spent under Taproot semantics
asset_familyThe information related to the key family of an asset (if it exists)
chain_anchorDescribes where in the chain the asset is currently anchored

Chain anchor defines where, in the chain, the asset is currently anchored:

FieldDescription
anchor_txThe transaction that anchors the Taproot Assets commitment where the asset resides
anchor_txidThe txid of the above transaction
anchor_block_hashThe block hash the contains the anchor transaction above
anchor_outpointThe raw internal key that was used to create the anchor Taproot output key
internal_keyThe transaction that anchors the Taproot Assets commitment where the asset resides

Genesis bootstrap information

This field contains the full genesis information encoded in a portable manner. All those data are immutable.

The structure can be found here. The methods used to decrypt it are from the tlv library.

It uses Z-Base32 encoder/decoder from the specification from Phil Zimmermann.

You can find an example here: https://github.com/tv42/zbase32

FirstPrevOut (genesis_point)

It represents the outpoint of the transaction’s first input that resulted in the creation of the asset.

The OutPointDecoder method is used to decode the data.

The data is decomposed in:

  • 32 byte for the transaction id.
  • an int for the output.

Tag (name)

Tag is a human-readable identifier for the asset

OutputIndex (output_index)

The index of the output that carries the unique Taproot Assets commitment in the genesis transaction

Type (asset_type)

Assert type (Normal Type = 0 or Collectible Type = 1).