RGB-WG / rgb-std

RGB standard libs for WASM & low-level integrations (no FS/networking)
https://rgb.tech
Apache License 2.0
66 stars 31 forks source link

Asset tag in transfer steps #115

Closed crisdut closed 8 months ago

crisdut commented 8 months ago

Description

Version: https://github.com/RGB-WG/rgb-std/pull/113/commits/6d2f8c0f167ca1bdbcbfc252e2711aa7ae146767

When trying to perform a transfer in version 0.11 of RGB, the cli returned the following error:

RGB: command-line wallet for RGB smart contracts
     by LNP/BP Standards Association

Loading descriptor from wallet default ... success
Loading stock ... success
Error: asset tag for state `0x0FA0` must be added before any fungible state of the same type.

From what I understand, asset tags were introduced to make RGB compatible with Liquid.

I passed this step by creating a tag before adding a new fungible state. However, I have some questions about AssetTag:

  1. Can tags be generated using any value? Regarding transfers, I combined contract_id and seal, similar to what was done when issuing the asset (concatenation between schema_id and iface_id). Is this correct, or do you suggest another combination? (From what I understand, it needs to be unique)
  2. I noticed that only fungible contracts have tags implemented. Other types like RGB21, which may have fractionation or collection UDAs, did they need tags later?

Thank you

dr-orlovsky commented 8 months ago

Asset tags are autogenerated during asset creation and should be kept in the stash (they are also passed in consignments).

This is bug that tag got missed, I will work on fix

crisdut commented 8 months ago

This is bug that tag got missed, I will work on fix

Ok, sure.

Asset tag was generated in asset issue. But I forgot to test if it is another AssignmentType during creation.

dr-orlovsky commented 8 months ago

Fixed in https://github.com/RGB-WG/rgb-std/pull/113/commits/b2ec8213fcc50dbec95f97155896c9ad5827df99