Skip to content

[bug]: Malformed STXO proof generated on asset spend #1809

@ffranr

Description

@ffranr

@Liongrass reported this bug whilst testing v0.7.0-rc1:

  • Attempted to send a grouped asset to a V2 group key tap address.
  • Asset had been minted a little while back.
  • Transfer failed on the sending node; receiving node did not receive anything.
  • Logs from attempt:
2025-09-17 19:54:44.784 [INF] FRTR: Received to send request to 1 addrs: [2000000:TapAddr{specifier=AssetSpecifier(id=0000000000000000000000000000000000000000000000000000000000000000, group_pub_key=02875ce409b587a6656357639d099ad9eb08396d0dfea8930a45e742c81d6fc782), amount=2000000, script_key=034b6011daff352ec127a8734793efcff6bc50da7e68150a411f478a4019080f08}]
2025-09-17 19:54:44.785 [INF] FRTR: ChainPorter executing state: SendStateStartHandleAddrParcel
2025-09-17 19:54:44.825 [INF] FRTR: ChainPorter executing state: SendStateVirtualCommitmentSelect
2025-09-17 19:54:44.878 [INF] FRTR: Identified 4 eligible asset inputs for send of 2000000 to group_key=02875ce409b587a6656357639d099ad9eb08396d0dfea8930a45e742c81d6fc782, asset_id=, min_amt=2000000: [a13327d4b73be2057fae7cd999b7599a8d418df439b9a44f3adeac67b72ac307:0 a13327d4b73be2057fae7cd999b7599a8d418df439b9a44f3adeac67b72ac307:0 a13327d4b73be2057fae7cd999b7599a8d418df439b9a44f3adeac67b72ac307:0 a13327d4b73be2057fae7cd999b7599a8d418df439b9a44f3adeac67b72ac307:0]
2025-09-17 19:54:44.880 [INF] FRTR: Selected 1 asset inputs for send of 2000000 to AssetSpecifier(id=, group_pub_key=02875ce409b587a6656357639d099ad9eb08396d0dfea8930a45e742c81d6fc782)
2025-09-17 19:54:44.922 [INF] FRTR: ChainPorter executing state: SendStateVirtualSign
2025-09-17 19:54:44.922 [INF] FRTR: Generating Taproot Asset witnesses for send to: 024eb56b120f6d6b9fd50af497311589107dd96e0066230f77f427805c249a9334
2025-09-17 19:54:44.933 [ERR] FRTR: Error evaluating state (SendStateVirtualSign): unable to sign and commit virtual packet: unable to verify inclusion proof: error verifying proofs: invalid inclusion proof: error verifying v1 inclusion proof: error verifying STXO proof: missing asset proof
2025-09-17 19:54:44.933 [ERR] TRPC: [/taprpc.TaprootAssets/SendAsset]: unable to sign and commit virtual packet: unable to verify inclusion proof: error verifying proofs: invalid inclusion proof: error verifying v1 inclusion proof: error verifying STXO proof: missing asset proof
  • Logs indicate that AssetProof field is not populated on STXO proof.
  • Execution likely took the following code path:

if proof.Asset.IsTransferRoot() && !cfg.NoSTXOProofs {
stxoInclusionProofs := make(
map[asset.SerializedKey]commitment.Proof,
len(proof.Asset.PrevWitnesses),
)
for _, wit := range proof.Asset.PrevWitnesses {
spentAsset, err := asset.MakeSpentAsset(wit)
if err != nil {
return nil, fmt.Errorf("error creating "+
"altLeaf: %w", err)
}
// Generate an STXO inclusion proof for each prev
// witness.
_, stxoProof, err := params.TaprootAssetRoot.Proof(
asset.EmptyGenesisID,
spentAsset.AssetCommitmentKey(),
)
if err != nil {
return nil, err
}

  • And then return here from the params.TaprootAssetRoot.Proof call:
    // If the corresponding AssetCommitment does not exist, return the Proof
    // as is.
    assetCommitment, ok := c.assetCommitments[tapCommitmentKey]
    if !ok {
    return nil, proof, nil
    }

Metadata

Metadata

Assignees

Labels

Type

Projects

Status

🏗 In progress

Relationships

None yet

Development

No branches or pull requests

Issue actions