taproot-assets
taproot-assets copied to clipboard
[feature]: Create "Asset Book" `tapcli` feature
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
toasset_id
- [ ] Suggested subcommands:
a
oradd
to add a new asset-name entrye
oredit
to edit an existing asset-name entryd
ordelete
to delete a asset-name entryl
orlist
to list all asset-name entriess
orsearch
to search for specific asset-names by name or keywordo
orexport
to export the entire address book to a filei
orimport
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 theasset book
(e.g.)
- [ ] Assert that only one asset_id can be assigned/mapped to an
- [ ] 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/
I recommend we consider the following points:
-
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
-
Assets already possess a
Tag
field which essentially serves as a name. We could automate the naming of assets using theseTag
values, eliminating the need for client-side tagging. -
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.