@@ -160,6 +160,41 @@ func CreateTransitionProof(prevOut wire.OutPoint,
160160 TapSiblingPreimage : params .TapscriptSibling ,
161161 }
162162
163+ if proof .Asset .IsTransferRoot () {
164+ stxoInclusionProofs := make (
165+ map [asset.SerializedKey ]commitment.Proof ,
166+ len (proof .Asset .PrevWitnesses ),
167+ )
168+ for _ , wit := range proof .Asset .PrevWitnesses {
169+ spentAsset , err := asset .MakeSpentAsset (wit )
170+ if err != nil {
171+ return nil , fmt .Errorf ("error creating " +
172+ "altLeaf: %w" , err )
173+ }
174+
175+ // Generate an STXO inclusion proof for each prev
176+ // witness.
177+ _ , stxoProof , err := params .TaprootAssetRoot .Proof (
178+ asset .EmptyGenesisID ,
179+ spentAsset .AssetCommitmentKey (),
180+ )
181+ if err != nil {
182+ return nil , err
183+ }
184+ keySerialized := asset .ToSerialized (
185+ spentAsset .ScriptKey .PubKey ,
186+ )
187+ stxoInclusionProofs [keySerialized ] = * stxoProof
188+ }
189+
190+ if len (stxoInclusionProofs ) == 0 {
191+ return nil , fmt .Errorf ("no stxo inclusion proofs" )
192+ }
193+
194+ proof .InclusionProof .CommitmentProof .STXOProofs =
195+ stxoInclusionProofs
196+ }
197+
163198 // If the asset is a split asset, we also need to generate MS-SMT
164199 // inclusion proofs that prove the existence of the split root asset.
165200 if proof .Asset .HasSplitCommitmentWitness () {
0 commit comments