lightninglabs / lightninglabs/taproot-assets
tapdb: add table to track anchored altLeaves
@jtobin is already working on this.
Since Jun 15, 2026.
- Dominant language
- Go
- Stars
- 525
- Forks
- 150
- Avg merge
- 2d 15h
- Merged PRs (30d)
- 31
Description
In #1233 , we add logic to look up the altLeaves used for an anchor input, during coin selection. This must be looked up separately from assets, since altLeaves are not stored in the assets table.
Right now this is done by fetching the whole input proof, decoding only the last proof, and then reading the altLeaves from there:
This implementation works, but could cause performance issues as the total input proof size grows. That potential issue is something we also wouldn't detect in our itests, as-is.
Proposed Enhancement
A better option would be:
- Add new DB table to track the outpoint -> altLeaves mapping.
Consequently, We could then look up the altLeaves directly and never decode the input proof in this DB transaction.
Since we're dealing with P2TR tx's, I think using the outpoint as the unique key for storage should be fine; it also wouldn't change in the case of re-orgs.
[edit by maintainer]
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.