Skip to content

tree: add asset-aware materialization context - #1176

Open
darioAnongba wants to merge 1 commit into
mainfrom
darioAnongba/assets-tree-foundation
Open

tree: add asset-aware materialization context#1176
darioAnongba wants to merge 1 commit into
mainfrom
darioAnongba/assets-tree-foundation

Conversation

@darioAnongba

@darioAnongba darioAnongba commented Aug 21, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • add an outpoint-keyed tree context for asset amounts, commitment roots, sealed transition packages, and per-node signing tweaks
  • derive untweaked MuSig2 internal keys for asset outputs while requiring a recorded tweak for every signed asset-tree node
  • preserve the existing public signer API and copy MuSig2 participant slices before operations that may sort them
  • defensively copy stored byte slices so callers cannot mutate published tree data

Runtime isolation

This branch adds no asset runtime entry point. Bitcoin-only leaves keep AssetAmount at zero, BuildStructure returns a nil AssetContext, and public signer calls continue to use the tree-wide sweep tweak.

Comment thread lib/tree/node.go Outdated
Comment thread lib/tree/node.go Outdated
Comment thread lib/tree/node.go Outdated
Comment thread lib/tree/asset_tree_context.go
Asset-bearing tree nodes use distinct taproot tweaks and carry units
independently from carrier satoshis. Store this data in an
outpoint-keyed context so extracted paths sign deterministically
without changing Bitcoin-only trees.

Keep per-node tweak selection inside Tree signing and retain the
existing public signer API. Copy MuSig2 participant slices before
aggregation because the local signer may sort caller-owned state.
@darioAnongba
darioAnongba force-pushed the darioAnongba/assets-tree-foundation branch from 3f0375b to 75de4e8 Compare August 24, 2026 10:23
@lightninglabs lightninglabs deleted a comment from litbot-9000 Aug 24, 2026
@darioAnongba
darioAnongba marked this pull request as ready for review August 24, 2026 11:15
@darioAnongba
darioAnongba requested a review from bhandras August 24, 2026 11:15

@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: 75de4e829a

ℹ️ 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 lib/tree/asset_tree_context.go
Comment thread lib/tree/tree.go
@GeorgeTsagk

Copy link
Copy Markdown
Member

Hey! Great work, currently reviewing this (side by side with #1177 )

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.

2 participants