lightninglabs / lightninglabs/taproot-assets
proof file: optimize appending proof
Open
@jtobin is already working on this.
Since Jun 15, 2026.
encoding
optimization
performance
proofs
- Dominant language
- Go
- Stars
- 525
- Forks
- 150
- Avg merge
- 2d 15h
- Merged PRs (30d)
- 31
Description
Background
Additional context: https://github.com/lightninglabs/taproot-assets/pull/419#discussion_r1278175655
The current implementation of the proof file is not very efficient when it comes to appending a new proof: The whole file is read into memory, the new proof is encoded and then the whole file is written again.
This can be optimized in the following way:
- read the number of proofs from the beginning of the file
- skip to the current last proof in the file, only read that proof and hash it
- append the new proof and update the incremental hash, using the previous proof's hash
- seek back to the beginning of the file (depends on what type of io.Reader we actually have) to update the count of the number of proofs
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.