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

[enhancement] Migrate `Decimal Display` into TLV to induce availability and protocol-level enforcement

Open dstadulis opened this issue 1 year ago • 2 comments

Description:

To ensuring correct decimal display usage the daemon has recently added checks inside the planter (added in #952) this should catch inadvertent user errors (if a user is using a tapd daemon). This is substandard as the protocol-design need is to entwine the value with the endogenous properties of an asset -- e.g. inextricably link decimal_display into the asset.

Proposed Solution:

Move the decimal display value into the asset's TLV. This would make it an integral part of the asset's property and enforce on the protocol level consistency.

Benefits

  1. This will enforce consistency decimal display value across any taproot asset implementation (or hacky uses of tapd) and light client by making it inherent to the asset

Implementation Plan

To implement this solution, we will:

  • [ ] Update the TLV to include decimal display information.
  • [ ] Modify the RPC/API interfaces to accommodate the updated TLV structure.
  • [ ] Refactor the verification logic to utilize the TLV-based decimal display.

dstadulis avatar Jun 18 '24 18:06 dstadulis

Moving this issues out of v0.4 milestone in favor of https://github.com/lightninglabs/taproot-assets/issues/997

dstadulis avatar Jul 09 '24 13:07 dstadulis

Removing from Sprint 30 Available to be reassigned if others want to take it from @guggero

dstadulis avatar Aug 20 '24 18:08 dstadulis