Skip to content

tapassets: persist asset state for mixed OOR transfers - #1038

Closed
darioAnongba wants to merge 2 commits into
feat/taproot-assets-runtime-registrationfrom
feat/taproot-assets-asset-state
Closed

tapassets: persist asset state for mixed OOR transfers#1038
darioAnongba wants to merge 2 commits into
feat/taproot-assets-runtime-registrationfrom
feat/taproot-assets-asset-state

Conversation

@darioAnongba

Copy link
Copy Markdown
Collaborator

Summary

  • persist SDK-neutral asset reference, uint64 amount, and commitment root while keeping carrier sats separate
  • support positional Bitcoin-only checkpoint package slots for mixed asset/BTC OOR graphs
  • reconstruct chained proof sources from the exact creating package across restarts
  • propagate complete asset metadata through onboarding, signing descriptors, recipients, snapshots, incoming events, and VTXO RPCs

Validation

  • full and focused unit suites
  • focused race tests
  • make build
  • make lint-changed-local base=origin/main workers=2
  • formatting, diff, and commit-message checks

Stack

Prototype boundaries

  • Lumos must bind ref/amount to sealed packages before admitting a spend
  • asset-aware seed recovery still needs an indexer inventory query
  • live cross-repository regtest remains in the final E2E branch

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request implements SDK-neutral Taproot Asset state persistence and mixed out-of-round (OOR) package bindings, allowing virtual transaction outputs (VTXOs) to carry asset references and full-width uint64 amounts without altering their Bitcoin carrier values. It introduces database migration 18, updates protobuf definitions, propagates asset metadata across various wire and persistence boundaries, and adds a proof-source resolver to reconstruct compact proof paths. The review feedback points out an opportunity to optimize payload serialization in encodeIncomingRecipientPayload by conditionally appending the asset reference and amount TLV records only when they are non-empty, preventing unnecessary bloat for ordinary Bitcoin VTXOs.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment on lines +1084 to 1090
tlv.MakePrimitiveRecord(
recipientTaprootAssetRefType, &taprootAssetRef,
),
tlv.MakePrimitiveRecord(
recipientTaprootAssetAmountType, &taprootAssetAmount,
),
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

In encodeIncomingRecipientPayload, the taprootAssetRef and taprootAssetAmount TLV records are unconditionally included in the records slice. For ordinary Bitcoin VTXOs (which do not carry Taproot Assets), this unnecessarily serializes empty/zero TLV records, bloating the payload size. To optimize efficiency and maintain consistency with encodeRecipientPayload and encodeTransferInputSnapshot, these records should only be appended conditionally when they are non-empty/non-zero.

	}
	if len(taprootAssetRef) > 0 {
		records = append(
			records, tlv.MakePrimitiveRecord(
				recipientTaprootAssetRefType, &taprootAssetRef,
			),
		)
	}
	if taprootAssetAmount != 0 {
		records = append(
			records, tlv.MakePrimitiveRecord(
				recipientTaprootAssetAmountType, &taprootAssetAmount,
			),
		)
	}

Keep carrier satoshis separate from durable SDK-neutral asset
identity and quantity. Carry that state through onboarding, RPC,
OOR snapshots, incoming materialization, and operator signing
descriptors.

Support positional Bitcoin-only slots in Taproot Asset packages
and reconstruct restart-stable spend proof sources from exact
created-output package bindings.
@darioAnongba
darioAnongba force-pushed the feat/taproot-assets-asset-state branch from be56bda to abbf783 Compare July 21, 2026 18:41
@darioAnongba
darioAnongba changed the base branch from feat/taproot-assets-carrier-selection to feat/taproot-assets-runtime-registration July 21, 2026 18:41
@lightninglabs-deploy

Copy link
Copy Markdown
Collaborator

@darioAnongba, remember to re-request review from reviewers when ready

@darioAnongba

Copy link
Copy Markdown
Collaborator Author

Superseded by #1062, which aggregates the full Taproot Asset OOR prototype stack (all files touched here are covered there).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants