Skip to content

tapassets: add caller-funded asset batch anchors - #1178

Open
darioAnongba wants to merge 5 commits into
darioAnongba/assets-tree-materializerfrom
darioAnongba/assets-batch-anchor
Open

tapassets: add caller-funded asset batch anchors#1178
darioAnongba wants to merge 5 commits into
darioAnongba/assets-tree-materializerfrom
darioAnongba/assets-batch-anchor

Conversation

@darioAnongba

@darioAnongba darioAnongba commented Aug 21, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • expose the batch output aggregate key and sweep leaf for BIP-371 output metadata
  • derive and commit caller-funded asset batch outputs from one or more confirmed sources, with optional wallet-owned asset change
  • validate concrete issuance outputs against their shared Bitcoin anchor and preserve one tree root input per issuance
  • bind merged inputs of one issuance through ordered recursive co-input paths
  • persist commit attempts and sealed packages, and publish the finalized anchor through tapd

Grouped asset references can combine several proven issuances in one batch output, providing the batch-anchor primitive for multi-tranche onboarding.

@darioAnongba
darioAnongba force-pushed the darioAnongba/assets-batch-anchor branch from 05763ee to 30134ea Compare August 24, 2026 10:23
@darioAnongba
darioAnongba force-pushed the darioAnongba/assets-batch-anchor branch from 30134ea to 5f10a19 Compare August 24, 2026 15:44
@darioAnongba darioAnongba self-assigned this Aug 24, 2026
@lightninglabs lightninglabs deleted a comment from litbot-9000 Aug 24, 2026
Comment thread tapassets/batch_anchor.go Outdated
Comment thread tapassets/batch_anchor.go
@darioAnongba
darioAnongba force-pushed the darioAnongba/assets-batch-anchor branch from d7b4852 to 6fbb09a Compare August 24, 2026 19:50
@lightninglabs lightninglabs deleted a comment from litbot-9000 Aug 25, 2026
Return the untweaked aggregate key and sweep leaf with the batch
output. Callers use them to populate BIP-371 output metadata and add
an asset commitment.
Share the attempt and sealed-package state machine between tree node
commits and batch-anchor commits. Require a sealed package before an
attempt is considered complete.
Expose commitment previews and finalized-transfer publishing through the
internal driver. Keep the logical and virtual packet fields needed to
reconstruct per-issuance proof paths from sealed packages.
@darioAnongba
darioAnongba force-pushed the darioAnongba/assets-batch-anchor branch from 6fbb09a to 8703a68 Compare August 25, 2026 10:18
@lightninglabs lightninglabs deleted a comment from litbot-9000 Aug 25, 2026
@darioAnongba
darioAnongba marked this pull request as ready for review August 25, 2026 11:07
Derive asset-aware batch scripts before Bitcoin funding, then commit
and validate the funded anchor through tap-sdk. Persist sealed packages
so completed attempts can be replayed safely.

Keep one root proof path per issuance and bind merged inputs to ordered
co-input paths.
@darioAnongba
darioAnongba force-pushed the darioAnongba/assets-batch-anchor branch from 8703a68 to 364f037 Compare August 25, 2026 11:11

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8703a68438

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread tapassets/batch_anchor.go
}
anchorTx := anchor.UnsignedTx

internalKey, err := tree.ComputeInternalKey(req.Cosigners)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Deduplicate cosigners before computing the batch key

When req.Cosigners repeats a key—for example, when one client owns multiple VTXO leaves—this derives the batch script from the duplicated MuSig2 list, while BuildAssetTree normalizes the root signer set with tree.UniqueCosigners. The anchor commit can therefore succeed, but tree materialization later fails in boundFinalKey because the deduplicated root key cannot reproduce the committed batch script. Normalize the list before ComputeInternalKey (and reject nil entries) so batch derivation matches the tree signer invariant.

Useful? React with 👍 / 👎.

@lightninglabs lightninglabs deleted a comment from litbot-9000 Aug 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant