taproot-assets icon indicating copy to clipboard operation
taproot-assets copied to clipboard

[feature]: Create "Asset Book" `tapcli` feature

Open dstadulis opened this issue 10 months ago • 1 comments

Is your feature request related to a problem? Please describe. As a tapcli user I want to be able to refer to to the notional / nominal name of an asset rather than the obtuse "asset id" in order to make my UX easier

Describe the solution you'd like

Title: Create "Asset Book" Feature


Description

The purpose of this feature will be similar to an address book, allowing users to easily map human-readable, client-side-defined asset names (e.g. USDx, $marketname, stablecoin_x etc) to the Taproot Assets cryptographic protocol identifier asset_id. This will provide a convenient way for users to specify assets when using tapcli without having to use the long assetIDName or asset_id directly.

Feature deliverables:

  • [ ] A new ./cmd/tapcli/ will be added to manage the asset book
  • [ ] ./cmd/tapcli/* functions, which accept asset IDs, will be enhanced to refer to their personal asset book to map an asset name to asset_id
  • [ ] Suggested subcommands: a or add to add a new asset-name entry e or edit to edit an existing asset-name entry d or delete to delete a asset-name entry l or list to list all asset-name entries s or search to search for specific asset-names by name or keyword o or export to export the entire address book to a file i or import to import a file of asset-name data into the address book
  • [ ] The asset book should: handle multiple asset names and their corresponding asset IDs.
  • [ ] The asset book should: provide appropriate error reporting in disallowed cases:
    • [ ] Assert that only one asset_id can be assigned/mapped to an asset name in the asset book (e.g.)
  • [ ] Consider tapcli providing information if an additional asset name is assigned to an asset_id
    • i.e. an asset_id may have an unconstrained number of names associated with it (Earth, Gaja, Pale blue dot all refer to the same location)

Existing Repo Areas to be incorporate the feature into existing asset_id specification

https://github.com/lightninglabs/taproot-assets/tree/dc8932dc385aca160586a82e94f4113c717d9992/cmd/tapcli

Feature site (Suggested)

  • ./cmd/tapcli/asset-book.go
  • ./cmd/tapcli/commands/asset-book/

dstadulis avatar Apr 13 '24 22:04 dstadulis

I recommend we consider the following points:

  1. Users of stablecoins may primarily be interested in asset groups rather than individual asset IDs. It may be beneficial to default to associating asset names with groups rather than IDs. Using asset groups as primary references aligns with what we're trying to accomplish here: https://github.com/lightninglabs/taproot-assets/issues/291

  2. Assets already possess a Tag field which essentially serves as a name. We could automate the naming of assets using these Tag values, eliminating the need for client-side tagging.

  3. This could serve as an opportunity to refine the asset metadata framework, allowing an issuer to name an entire asset group instead of naming each tranche (asset ID) within the group individually.

ffranr avatar Apr 15 '24 09:04 ffranr