tapassets: persist asset state for mixed OOR transfers - #1038
tapassets: persist asset state for mixed OOR transfers#1038darioAnongba wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
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.
| tlv.MakePrimitiveRecord( | ||
| recipientTaprootAssetRefType, &taprootAssetRef, | ||
| ), | ||
| tlv.MakePrimitiveRecord( | ||
| recipientTaprootAssetAmountType, &taprootAssetAmount, | ||
| ), | ||
| } |
There was a problem hiding this comment.
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.
be56bda to
abbf783
Compare
|
@darioAnongba, remember to re-request review from reviewers when ready |
|
Superseded by #1062, which aggregates the full Taproot Asset OOR prototype stack (all files touched here are covered there). |
Summary
Validation
Stack
Prototype boundaries