@@ -35,12 +35,6 @@ const (
35
35
36
36
// LengthScriptP2PKH is the length of P2PKH script [OP_DUP OP_HASH160 0x14 <20-byte-hash> OP_EQUALVERIFY OP_CHECKSIG]
37
37
LengthScriptP2PKH = 25
38
-
39
- // LengthInscriptionEnvelope is the length of the witness tapscript envelope for holding pushed data
40
- LengthInscriptionEnvelope = 34
41
-
42
- // LengthInscriptionWrapper is the length of the witness tapscript envelope for holding pushed data
43
- LengthInscriptionWrapper = 34
44
38
)
45
39
46
40
// PayToAddrScript creates a new script to pay a transaction output to a the
@@ -199,7 +193,7 @@ func DecodeOpReturnMemo(scriptHex string, txid string) ([]byte, bool, error) {
199
193
return nil , false , nil
200
194
}
201
195
202
- // DecodeScript decodes memo wrapped in a inscription like script in witness
196
+ // DecodeScript decodes memo wrapped in an inscription like script in witness
203
197
// returns (memo, found, error)
204
198
//
205
199
// Note: the format of the script is following that of "inscription" defined in ordinal theory.
@@ -287,11 +281,13 @@ func DecodeTSSVout(vout btcjson.Vout, receiverExpected string, chain chains.Chai
287
281
// OP_FALSE
288
282
// OP_IF
289
283
//
290
- // OP_PUSHDATA_N ...
284
+ // OP_PUSHDATA_N ...
285
+ // ...
286
+ // OP_PUSHDATA_N ...
291
287
//
292
288
// OP_ENDIF
293
289
//
294
- // Note: the data pushed in OP_PUSHDATA_N will always be more than 80 bytes and not greater than 520 bytes .
290
+ // Note: the total data pushed will always be more than 80 bytes and within the btc transaction size limit .
295
291
func decodeInscriptionPayload (t * scriptTokenizer ) ([]byte , error ) {
296
292
if ! t .Next () || t .Opcode () != txscript .OP_FALSE {
297
293
return nil , fmt .Errorf ("OP_FALSE not found" )
@@ -302,7 +298,7 @@ func decodeInscriptionPayload(t *scriptTokenizer) ([]byte, error) {
302
298
}
303
299
304
300
memo := make ([]byte , 0 )
305
- next := byte ( txscript . OP_IF )
301
+ var next byte
306
302
for {
307
303
if ! t .Next () {
308
304
if t .Err () != nil {
0 commit comments