lightninglabs / lightninglabs/taproot-assets

ListGroups: commit to one canonical group-key encoding in responses

Open
#2,079 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

documentation enhancement universe
Dominant language
Go
Stars
525
Forks
150
Avg merge
2d 15h
Merged PRs (30d)
31

Description

Observation

`ListGroups` returns `map<string, GroupedAssets>` where the map key is
the group key. Today those keys have historically appeared in two
different forms depending on code path:

  • 33-byte compressed, serialised as hex (what the current code does).
  • 32-byte x-only, serialised as hex (what some legacy paths returned).

The tap-sdk had to land a targeted fix (`parseGroupRefKey`) to
preserve compressed keys through x-only parsing — odd-Y keys get
flipped when round-tripped through Schnorr serialisation, which broke
balance lookups for a fraction of minted groups.

See https://github.com/lightninglabs/tap-sdk/blob/feat/integration-tests/itest/assets.go#L128
for the full workaround.

Proposal

  • Commit the API to one encoding in the response (preferably 33-byte
    compressed hex, matching `AssetGroup.tweaked_group_key`).
  • Document that invariant in the proto comment.
  • Add a test that round-trips odd-Y keys through ListGroups to catch
    regressions.

Why this matters

`ListGroups` is the canonical enumerate-what-I-have API. If the key
representation is ambiguous, every downstream client has to reinvent
the compressed-vs-x-only-case-split logic.

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 by locating ListGroups and its proto comment, then review the tap-sdk assets.go parseGroupRefKey workaround for compressed and x-only keys. Define the response invariant there and add the proposed odd-Y round-trip regression test; done means ListGroups consistently returns the chosen encoding and the test passes.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
api, cryptography
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.