lightninglabs / lightninglabs/taproot-assets

[bug]: need to enforce common `decimal_display` across all minted traunches of a grouped asset when validating proofs

Open
#1,503 5 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug decimal-display validation
Dominant language
Go
Stars
525
Forks
150
Avg merge
2d 15h
Merged PRs (30d)
31

Description

When minting additional traunches of a grouped asset, we have the freedom to define different metadata when minting each traunch.

`decimal_display` is stored in the asset metadata. Right now when minting, we have a simple check to see if the same `decimal_display` used for additional traunches is the same as the first traunch:

https://github.com/lightninglabs/taproot-assets/blob/main/tapgarden/seedling.go#L201-L225

However, this isn't really enforced on the client side right now when validating proofs. Therefor, a node minting assets could remove the check above and mint a second traunch with a different `decimal_display` and then the nodes using the taproot assets from multiple traunches won't really notice and then there could be confusion in the marketplace because different people are assuming different `decimal_display` values for the asset.

We need to enforce this client side when validating proofs for an asset. Although there might be uses cases for different metadata for different traunches (which is why we have the freedom to change it), `decimal_display` is one use case in the metadata that it doesn't make sense for it to be able to change from one traunch to another traunch.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the existing grouped-asset metadata check in tapgarden/seedling.go around lines 201-225, then trace the client-side proof-validation entry point for grouped assets. Determine where decimal_display values from multiple tranches are compared. Done means proofs containing inconsistent decimal_display values across tranches are rejected, with validation coverage for the mismatch.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.