@@ -16,6 +16,7 @@ import (
1616 "github.com/btcsuite/btcd/btcutil"
1717 "github.com/btcsuite/btcd/btcutil/psbt"
1818 "github.com/btcsuite/btcd/chaincfg/chainhash"
19+ "github.com/btcsuite/btcd/txscript"
1920 "github.com/btcsuite/btcd/wire"
2021 "github.com/btcsuite/btclog"
2122 "github.com/lightninglabs/taproot-assets/address"
@@ -105,16 +106,23 @@ var (
105106 )
106107)
107108
109+ var (
110+ // GenesisDummyScript is a dummy script that we'll use to fund the
111+ // initial PSBT packet that'll create initial set of assets. It's the
112+ // same size as a encoded P2TR output and has a valid P2TR prefix.
113+ GenesisDummyScript = append (
114+ []byte {txscript .OP_1 , 0x20 }, bytes .Repeat ([]byte {0x00 }, 32 )... ,
115+ )
116+ )
117+
108118// createDummyOutput creates a new Bitcoin transaction output that is later
109119// used to embed a Taproot Asset commitment.
110120func createDummyOutput () * wire.TxOut {
111121 // The dummy PkScript is the same size as an encoded P2TR output and has
112122 // a valid P2TR prefix.
113123 newOutput := wire.TxOut {
114- Value : int64 (DummyAmtSats ),
115- PkScript : append (
116- []byte {0x51 , 0x20 }, bytes .Repeat ([]byte {0x00 }, 32 )... ,
117- ),
124+ Value : int64 (DummyAmtSats ),
125+ PkScript : GenesisDummyScript ,
118126 }
119127 return & newOutput
120128}
0 commit comments