b017 0.0.0-b → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/CHANGELOG.md +280 -1
  2. package/README.md +120 -25
  3. package/dist/index.d.ts +15 -7
  4. package/dist/index.js +14 -5
  5. package/dist/lib/boltLib.d.ts +29 -3
  6. package/dist/lib/boltLib.js +60 -12
  7. package/dist/lib/genesis.d.ts +20 -0
  8. package/dist/lib/genesis.js +45 -0
  9. package/dist/lib/multi/multiBoltLib.d.ts +22 -2
  10. package/dist/lib/multi/multiBoltLib.js +111 -117
  11. package/dist/lib/scanner/beef.d.ts +11 -0
  12. package/dist/lib/scanner/beef.js +63 -0
  13. package/dist/lib/scanner/fingerprints.d.ts +12 -2
  14. package/dist/lib/scanner/fingerprints.js +44 -11
  15. package/dist/lib/scanner/verifyEvents.d.ts +84 -6
  16. package/dist/lib/scanner/verifyEvents.js +519 -44
  17. package/dist/lib/single/singleAncestor.d.ts +27 -3
  18. package/dist/lib/single/singleAncestor.js +49 -18
  19. package/dist/lib/single/singleSpend.d.ts +12 -3
  20. package/dist/lib/single/singleSpend.js +48 -16
  21. package/dist/tokens/BOLT.d.ts +6 -5
  22. package/dist/tokens/GenesisMultiBOLT.d.ts +29 -0
  23. package/dist/tokens/GenesisMultiBOLT.js +48 -0
  24. package/dist/tokens/MultiBOLT.d.ts +17 -11
  25. package/dist/tokens/MultiBOLT.js +79 -68
  26. package/dist/tokens/templates/AuthBolt.sx.template.d.ts +35 -0
  27. package/dist/tokens/templates/AuthBolt.sx.template.js +82 -0
  28. package/dist/tokens/templates/FixedMulti.sx.template.d.ts +13 -0
  29. package/dist/tokens/templates/FixedMulti.sx.template.js +23 -0
  30. package/dist/tokens/templates/MinSimple.sx.template.d.ts +10 -1
  31. package/dist/tokens/templates/MinSimple.sx.template.js +15 -1
  32. package/dist/tokens/templates/OpenMulti.sx.template.d.ts +13 -0
  33. package/dist/tokens/templates/OpenMulti.sx.template.js +23 -0
  34. package/dist/tokens/templates/SerialBolt.sx.template.d.ts +23 -0
  35. package/dist/tokens/templates/SerialBolt.sx.template.js +61 -0
  36. package/dist/tokens/templates/SimpleMulti.sx.template.d.ts +11 -5
  37. package/dist/tokens/templates/SimpleMulti.sx.template.js +30 -21
  38. package/dist/tokens/templates/pay2Proof.d.ts +2 -1
  39. package/dist/tokens/templates/pay2Proof.js +1 -1
  40. package/package.json +8 -3
  41. package/dist/tokens/templates/MinSimpleBalance.sx.template.d.ts +0 -24
  42. package/dist/tokens/templates/MinSimpleBalance.sx.template.js +0 -59
  43. package/dist/tokens/templates/MinSimpleDiscount.sx.template.d.ts +0 -23
  44. package/dist/tokens/templates/MinSimpleDiscount.sx.template.js +0 -58
@@ -1,18 +1,20 @@
1
1
  // SimpleMultiBolt.sx.template.ts
2
2
  // Runtime lock/unlock script assembler for the optimised SimpleMultiBolt contract.
3
- // The two *_SCRIPT_SUFFIX constants are auto-patched from sxFiles/SimpleMultiBolt.sx.json
4
- // at build time (compileBoltContracts.mjs) - do NOT hand-edit them.
3
+ // The two *_SCRIPT_SUFFIX constants are auto-patched from the pre-compiled production artifact
4
+ // by scripts/build-simple-multi.mjs (build-time only) - do NOT hand-edit them.
5
5
  //
6
6
  // Layout (see multiBoltLib.ts):
7
7
  // lock = 11 data args + LOCK_SCRIPT_SUFFIX
8
- // unlock = 198 data args + UNLOCK_SCRIPT_SUFFIX (no leading miscData; 5 interop args)
8
+ // unlock = 170 data args + UNLOCK_SCRIPT_SUFFIX (no leading miscData; 5 interop args)
9
9
  import { LockingScript, Script, UnlockingScript, Transaction, TransactionSignature, Hash, Utils, } from "@bsv/sdk";
10
10
  import { splitCtx, buildOutpoint, buildChangeOutput, createSignature, scriptChunksFromBin } from "../../lib/boltLib.js";
11
- import { ancestorPiece, createEmptyFungibleAncestorChunksSMB, PIECE_NAMES, } from "../../lib/multi/multiBoltLib.js";
11
+ import { ancestorPiece, createEmptyFungibleAncestorChunksSMB, SIMPLE_MULTI_LAYOUT, } from "../../lib/multi/multiBoltLib.js";
12
12
  export default class SimpleMultiTemplate {
13
13
  constructor() {
14
+ /** Ancestor-piece layout; the genesis-family subclasses (FixedMulti, OpenMulti) override it. */
15
+ this.layout = SIMPLE_MULTI_LAYOUT;
14
16
  this.signatureScope = TransactionSignature.SIGHASH_FORKID | TransactionSignature.SIGHASH_ALL;
15
- this.LOCK_SCRIPT_SUFFIX = "OP_2 OP_PICK OP_BIN2NUM OP_NOT OP_TUCK OP_IF OP_13 OP_PICK OP_EQUALVERIFY OP_15 OP_PICK OP_DUP 25 OP_EQUAL OP_NOT OP_VERIFY 27 OP_EQUAL OP_NOT OP_VERIFY OP_ELSE OP_DROP OP_ENDIF OP_SWAP OP_DUP OP_BIN2NUM OP_0NOTEQUAL OP_12 OP_PICK OP_IFDUP OP_IF OP_DUP 41 OP_TOALTSTACK OP_HASH256 OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT 00 OP_CAT OP_BIN2NUM OP_1 OP_ADD OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SIZE OP_SWAP OP_CAT 022079be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f8179802 OP_SWAP OP_CAT OP_SIZE OP_SWAP OP_CAT 30 OP_SWAP OP_CAT OP_FROMALTSTACK OP_CAT 038ff83d8cf12121491609c4939dc11c4aa35503508fe432dc5a5c1905608b9218 OP_CHECKSIGVERIFY OP_4 OP_SPLIT 20 OP_SPLIT 20 OP_SPLIT 24 OP_SPLIT OP_1 OP_SPLIT OP_SWAP OP_DUP ff OP_EQUAL OP_IF OP_DROP OP_8 OP_SPLIT OP_SWAP OP_ELSE OP_DUP fe OP_EQUAL OP_IF OP_DROP OP_4 OP_SPLIT OP_SWAP OP_ELSE OP_DUP fd OP_EQUAL OP_IF OP_DROP OP_2 OP_SPLIT OP_SWAP OP_ELSE 00 OP_CAT OP_ENDIF OP_ENDIF OP_ENDIF OP_BIN2NUM OP_SPLIT OP_8 OP_SPLIT OP_4 OP_SPLIT 20 OP_SPLIT OP_4 OP_SPLIT OP_1 OP_SPLIT OP_SWAP 41 OP_EQUALVERIFY OP_9 OP_PICK OP_2 OP_GREATERTHANOREQUAL OP_VERIFY OP_5 OP_ROLL 11 OP_SPLIT 11 OP_SPLIT 15 OP_SPLIT 15 OP_SPLIT 15 OP_SPLIT 25 OP_SPLIT OP_2 OP_SPLIT OP_2 OP_SPLIT 25 OP_SPLIT 25 OP_SPLIT 22 OP_SPLIT 1a OP_PICK OP_2 OP_MOD OP_DUP OP_IF 26 OP_PICK OP_1ADD 1c OP_PICK OP_EQUALVERIFY OP_ENDIF OP_DUP 27 OP_PICK OP_2 OP_MOD OP_SWAP OP_IF OP_0 OP_ELSE OP_1 OP_ENDIF OP_EQUALVERIFY 1d02b0178876a914 ffffffffffffffffffffffffffffff7f 10 OP_0 OP_16 OP_NUM2BIN OP_CAT 14 OP_0 14 OP_NUM2BIN OP_CAT 21 OP_0 21 OP_NUM2BIN OP_CAT 24 OP_0 24 OP_NUM2BIN OP_CAT 27 OP_PICK OP_DUP OP_0 OP_GREATERTHANOREQUAL OP_VERIFY OP_5 OP_PICK OP_LESSTHANOREQUAL OP_VERIFY 2d OP_PICK OP_DUP OP_0 OP_GREATERTHANOREQUAL OP_VERIFY OP_5 OP_PICK OP_LESSTHANOREQUAL OP_VERIFY 2c OP_PICK OP_DUP 20 OP_EQUAL OP_SWAP OP_DUP 21 OP_EQUAL OP_SWAP OP_DUP 22 OP_EQUAL OP_SWAP OP_DUP 23 OP_EQUAL OP_SWAP OP_DUP 24 OP_EQUAL OP_SWAP 25 OP_EQUAL 1d OP_PICK OP_BIN2NUM OP_1 OP_EQUALVERIFY OP_0 OP_PICK OP_IF 2d OP_PICK 32 OP_PICK OP_ADD OP_11 OP_PICK OP_LESSTHANOREQUAL OP_VERIFY OP_ENDIF OP_2 OP_PICK OP_IF 2c OP_PICK 32 OP_PICK OP_2DUP OP_SUB OP_0 OP_GREATERTHANOREQUAL OP_VERIFY OP_GREATERTHANOREQUAL OP_VERIFY OP_ENDIF OP_12 OP_PICK OP_NOTIF 1d OP_PICK OP_12 OP_PICK OP_CAT OP_DUP 37 OP_PICK OP_CAT 88ac OP_CAT OP_4 OP_PICK OP_IF OP_SWAP 36 OP_PICK OP_CAT 88ac OP_CAT 33 OP_PICK OP_BIN2NUM OP_IF OP_SWAP OP_ENDIF OP_CAT OP_ELSE OP_NIP OP_ENDIF OP_ELSE ff OP_ENDIF OP_5 OP_PICK OP_7 OP_PICK OP_BOOLOR OP_IF 19 OP_PICK OP_11 OP_PICK OP_CAT OP_ELSE OP_1 OP_PICK OP_4 OP_PICK OP_BOOLOR OP_IF 19 OP_PICK 10 36 OP_PICK OP_CAT OP_1 OP_PICK 35 OP_PICK OP_BIN2NUM OP_BOOLAND OP_IF OP_SWAP OP_ENDIF OP_CAT OP_ELSE OP_2 OP_PICK OP_IF 10 2f OP_PICK 2f OP_PICK OP_ADD OP_SIZE OP_16 OP_LESSTHAN OP_IF 00 OP_CAT OP_ENDIF OP_SIZE OP_16 OP_LESSTHAN OP_IF 00 OP_CAT OP_ENDIF OP_SIZE OP_16 OP_LESSTHAN OP_IF 00 OP_CAT OP_ENDIF OP_SIZE OP_16 OP_LESSTHAN OP_IF 00 OP_CAT OP_ENDIF OP_SIZE OP_16 OP_LESSTHAN OP_IF 00 OP_CAT OP_ENDIF OP_SIZE OP_16 OP_LESSTHAN OP_IF 00 OP_CAT OP_ENDIF OP_SIZE OP_16 OP_LESSTHAN OP_IF 00 OP_CAT OP_ENDIF OP_SIZE OP_16 OP_LESSTHAN OP_IF 00 OP_CAT OP_ENDIF OP_SIZE OP_16 OP_LESSTHAN OP_IF 00 OP_CAT OP_ENDIF OP_SIZE OP_16 OP_LESSTHAN OP_IF 00 OP_CAT OP_ENDIF OP_SIZE OP_16 OP_LESSTHAN OP_IF 00 OP_CAT OP_ENDIF OP_SIZE OP_16 OP_LESSTHAN OP_IF 00 OP_CAT OP_ENDIF OP_SIZE OP_16 OP_LESSTHAN OP_IF 00 OP_CAT OP_ENDIF OP_SIZE OP_16 OP_LESSTHAN OP_IF 00 OP_CAT OP_ENDIF OP_SIZE OP_16 OP_LESSTHAN OP_IF 00 OP_CAT OP_ENDIF OP_SIZE OP_16 OP_LESSTHAN OP_IF 00 OP_CAT OP_ENDIF OP_CAT OP_11 OP_PICK OP_CAT OP_ELSE OP_4 OP_PICK OP_IF 10 2f OP_PICK 2f OP_PICK OP_SUB OP_SIZE OP_16 OP_LESSTHAN OP_IF 00 OP_CAT OP_ENDIF OP_SIZE OP_16 OP_LESSTHAN OP_IF 00 OP_CAT OP_ENDIF OP_SIZE OP_16 OP_LESSTHAN OP_IF 00 OP_CAT OP_ENDIF OP_SIZE OP_16 OP_LESSTHAN OP_IF 00 OP_CAT OP_ENDIF OP_SIZE OP_16 OP_LESSTHAN OP_IF 00 OP_CAT OP_ENDIF OP_SIZE OP_16 OP_LESSTHAN OP_IF 00 OP_CAT OP_ENDIF OP_SIZE OP_16 OP_LESSTHAN OP_IF 00 OP_CAT OP_ENDIF OP_SIZE OP_16 OP_LESSTHAN OP_IF 00 OP_CAT OP_ENDIF OP_SIZE OP_16 OP_LESSTHAN OP_IF 00 OP_CAT OP_ENDIF OP_SIZE OP_16 OP_LESSTHAN OP_IF 00 OP_CAT OP_ENDIF OP_SIZE OP_16 OP_LESSTHAN OP_IF 00 OP_CAT OP_ENDIF OP_SIZE OP_16 OP_LESSTHAN OP_IF 00 OP_CAT OP_ENDIF OP_SIZE OP_16 OP_LESSTHAN OP_IF 00 OP_CAT OP_ENDIF OP_SIZE OP_16 OP_LESSTHAN OP_IF 00 OP_CAT OP_ENDIF OP_SIZE OP_16 OP_LESSTHAN OP_IF 00 OP_CAT OP_ENDIF OP_SIZE OP_16 OP_LESSTHAN OP_IF 00 OP_CAT OP_ENDIF OP_CAT OP_11 OP_PICK OP_CAT OP_ENDIF OP_ENDIF OP_ENDIF OP_ENDIF OP_6 OP_PICK OP_IF 18 OP_PICK OP_CAT 14 38 OP_PICK OP_CAT OP_CAT OP_10 OP_PICK OP_ELSE OP_7 OP_PICK OP_4 OP_PICK OP_BOOLOR OP_6 OP_PICK OP_BOOLOR OP_IF 17 OP_PICK OP_CAT OP_10 OP_PICK OP_DUP OP_CAT OP_ELSE OP_4 OP_PICK OP_IF 18 OP_PICK OP_CAT 14 38 OP_PICK OP_CAT 14 38 OP_PICK OP_CAT OP_CAT OP_ELSE OP_2 OP_PICK OP_IF 33 OP_PICK OP_BIN2NUM OP_NOTIF 18 OP_PICK OP_ELSE 14 3d OP_PICK OP_CAT OP_ENDIF OP_CAT 14 38 OP_PICK OP_CAT OP_CAT OP_10 OP_PICK OP_ENDIF OP_ENDIF OP_ENDIF OP_ENDIF OP_CAT OP_6 OP_PICK OP_8 OP_PICK OP_BOOLOR OP_4 OP_PICK OP_BOOLOR OP_5 OP_PICK OP_BOOLOR OP_6 OP_PICK OP_BOOLOR OP_IF OP_8 OP_PICK OP_CAT OP_ELSE OP_1 OP_PICK OP_IF 33 OP_PICK OP_BIN2NUM OP_NOTIF 24 3b OP_PICK OP_CAT OP_CAT OP_ELSE 12 OP_PICK OP_CAT OP_ENDIF OP_ENDIF OP_ENDIF 01 35 OP_PICK OP_CAT OP_CAT OP_2 OP_PICK 34 OP_PICK OP_BIN2NUM OP_BOOLAND OP_IF 0100 OP_CAT 24 3c OP_PICK OP_CAT OP_CAT 24 3b OP_PICK OP_CAT OP_CAT OP_ELSE 33 OP_PICK OP_BIN2NUM OP_NOTIF 0100 OP_ELSE 0101 OP_ENDIF OP_CAT 24 21 OP_PICK OP_CAT OP_CAT 12 OP_PICK OP_CAT OP_ENDIF OP_16 OP_PICK OP_CAT OP_15 OP_PICK OP_CAT OP_SIZE fd OP_SWAP OP_CAT OP_TUCK 21 OP_PICK OP_SWAP OP_CAT OP_SWAP OP_CAT OP_6 OP_PICK OP_IF 1a OP_PICK OP_13 OP_PICK OP_CAT OP_7 OP_PICK OP_NOTIF 19 OP_ELSE 18 OP_ENDIF OP_PICK OP_CAT OP_12 OP_PICK OP_DUP OP_CAT OP_CAT OP_10 OP_PICK OP_CAT 01 37 OP_PICK OP_CAT OP_CAT 39 OP_PICK OP_BIN2NUM OP_NOTIF 0101 OP_ELSE 0100 OP_ENDIF OP_CAT 24 23 OP_PICK OP_CAT OP_CAT 14 OP_PICK OP_CAT 12 OP_PICK OP_CAT 11 OP_PICK OP_CAT OP_2 OP_PICK 22 OP_PICK OP_SWAP OP_CAT OP_SWAP OP_CAT 35 OP_PICK OP_BIN2NUM OP_IF OP_SWAP OP_ENDIF OP_CAT OP_ENDIF OP_2 OP_ROLL OP_15 OP_PICK OP_NOTIF OP_CAT OP_ELSE OP_DROP OP_ENDIF 38 OP_PICK OP_CAT OP_HASH256 1d OP_PICK OP_EQUALVERIFY 1f OP_PICK OP_2 OP_PICK OP_IF 3b OP_PICK 34 OP_PICK OP_BIN2NUM OP_IF OP_SWAP OP_ENDIF OP_CAT OP_ENDIF OP_14 OP_PICK 25 OP_PICK OP_BOOLAND OP_IF f000 OP_PICK OP_SIZE OP_4 OP_EQUALVERIFY d300 OP_PICK OP_0NOTEQUAL OP_DUP OP_IF OP_3 OP_ELSE OP_2 OP_ENDIF OP_2 OP_ROLL OP_SWAP OP_CAT f100 OP_PICK OP_CAT OP_0 b200 OP_NUM2BIN OP_DUP OP_TOALTSTACK f100 OP_PICK OP_4 OP_SWAP OP_SIZE OP_ROT OP_EQUAL OP_IF OP_SIZE OP_SWAP OP_CAT OP_ELSE OP_DROP 00 OP_ENDIF OP_CAT f000 OP_PICK OP_4 OP_SWAP OP_SIZE OP_ROT OP_EQUAL OP_IF OP_SIZE OP_SWAP OP_CAT OP_ELSE OP_DROP 00 OP_ENDIF OP_CAT ef00 OP_PICK 14 OP_SWAP OP_SIZE OP_ROT OP_EQUAL OP_IF OP_SIZE OP_SWAP OP_CAT OP_ELSE OP_DROP 00 OP_ENDIF OP_CAT ee00 OP_PICK 24 OP_SWAP OP_SIZE OP_ROT OP_EQUAL OP_IF OP_SIZE OP_SWAP OP_CAT OP_ELSE OP_DROP 00 OP_ENDIF OP_CAT ed00 OP_PICK 24 OP_SWAP OP_SIZE OP_ROT OP_EQUAL OP_IF OP_SIZE OP_SWAP OP_CAT OP_ELSE OP_DROP 00 OP_ENDIF OP_CAT ec00 OP_PICK 24 OP_SWAP OP_CAT OP_CAT eb00 OP_PICK 22 OP_SWAP OP_CAT OP_CAT ea00 OP_PICK 14 OP_SWAP OP_SIZE OP_ROT OP_EQUAL OP_IF OP_SIZE OP_SWAP OP_CAT OP_ELSE OP_DROP 00 OP_ENDIF OP_CAT e900 OP_PICK 14 OP_SWAP OP_SIZE OP_ROT OP_EQUAL OP_IF OP_SIZE OP_SWAP OP_CAT OP_ELSE OP_DROP 00 OP_ENDIF OP_CAT e800 OP_PICK OP_16 OP_SWAP OP_SIZE OP_ROT OP_EQUAL OP_IF OP_SIZE OP_SWAP OP_CAT OP_ELSE OP_DROP 00 OP_ENDIF OP_CAT e700 OP_PICK OP_1 OP_SWAP OP_SIZE OP_ROT OP_EQUAL OP_IF OP_SIZE OP_SWAP OP_CAT OP_ELSE OP_DROP 00 OP_ENDIF OP_CAT e600 OP_PICK OP_1 OP_SWAP OP_SIZE OP_ROT OP_EQUAL OP_IF OP_SIZE OP_SWAP OP_CAT OP_ELSE OP_DROP 00 OP_ENDIF OP_CAT e500 OP_PICK OP_SIZE OP_DUP 46 4b OP_WITHIN OP_VERIFY OP_SWAP OP_CAT OP_CAT e400 OP_PICK 21 OP_SWAP OP_SIZE OP_ROT OP_EQUAL OP_IF OP_SIZE OP_SWAP OP_CAT OP_ELSE OP_DROP 00 OP_ENDIF OP_CAT e300 OP_PICK OP_SIZE OP_DUP 68 OP_EQUALVERIFY 4c OP_SWAP OP_1 OP_1ADD OP_NUM2BIN OP_SIZE OP_1SUB OP_SPLIT OP_DROP OP_CAT OP_SWAP OP_CAT e300 OP_PICK 10 OP_SWAP OP_CAT e300 OP_PICK 10 OP_SWAP OP_CAT OP_CAT e200 OP_PICK 14 OP_SWAP OP_CAT OP_CAT e100 OP_PICK 14 OP_SWAP OP_CAT OP_CAT e000 OP_PICK 14 OP_SWAP OP_CAT OP_CAT df00 OP_PICK 24 OP_SWAP OP_CAT OP_CAT de00 OP_PICK 01 OP_SWAP OP_CAT OP_CAT dd00 OP_PICK OP_1 OP_SWAP OP_SIZE OP_ROT OP_EQUAL OP_IF OP_SIZE OP_SWAP OP_CAT OP_ELSE OP_DROP 00 OP_ENDIF OP_CAT dc00 OP_PICK 24 OP_SWAP OP_CAT OP_CAT db00 OP_PICK 24 OP_SWAP OP_CAT OP_CAT da00 OP_PICK 21 OP_SWAP OP_CAT OP_CAT 14 OP_PICK OP_CAT OP_DUP OP_SIZE OP_2 OP_ADD OP_2 OP_NUM2BIN 03fd OP_SWAP OP_CAT OP_NIP 02ad68 OP_CAT OP_SWAP OP_SIZE OP_2 OP_NUM2BIN 03fd OP_SWAP OP_CAT OP_TOALTSTACK OP_SIZE OP_2 OP_NUM2BIN 4d OP_SWAP OP_CAT OP_SWAP OP_CAT OP_CAT OP_CAT OP_CAT d700 OP_PICK OP_SIZE OP_DUP 34 OP_EQUALVERIFY OP_SWAP OP_CAT OP_CAT OP_FROMALTSTACK OP_CAT 5579557a557a557955797e7e7e7e547a527a547a547a7e7e7e7c73630141 13 OP_PICK 24 OP_SPLIT OP_NIP 7d01 OP_SPLIT OP_DROP OP_CAT abad68 OP_CAT OP_DUP OP_TOALTSTACK OP_CAT OP_SIZE fd OP_SWAP OP_2 OP_1ADD OP_NUM2BIN OP_SIZE OP_1SUB OP_SPLIT OP_DROP OP_CAT OP_SWAP OP_CAT OP_CAT d500 OP_PICK OP_CAT OP_SWAP OP_IF d300 OP_PICK OP_CAT OP_FROMALTSTACK OP_FROMALTSTACK OP_DUP OP_TOALTSTACK OP_SWAP OP_TOALTSTACK d300 OP_PICK OP_4 OP_SWAP OP_SIZE OP_ROT OP_EQUAL OP_IF OP_SIZE OP_SWAP OP_CAT OP_ELSE OP_DROP 00 OP_ENDIF OP_CAT d200 OP_PICK OP_4 OP_SWAP OP_SIZE OP_ROT OP_EQUAL OP_IF OP_SIZE OP_SWAP OP_CAT OP_ELSE OP_DROP 00 OP_ENDIF OP_CAT d100 OP_PICK 14 OP_SWAP OP_SIZE OP_ROT OP_EQUAL OP_IF OP_SIZE OP_SWAP OP_CAT OP_ELSE OP_DROP 00 OP_ENDIF OP_CAT d000 OP_PICK 24 OP_SWAP OP_SIZE OP_ROT OP_EQUAL OP_IF OP_SIZE OP_SWAP OP_CAT OP_ELSE OP_DROP 00 OP_ENDIF OP_CAT cf00 OP_PICK 24 OP_SWAP OP_SIZE OP_ROT OP_EQUAL OP_IF OP_SIZE OP_SWAP OP_CAT OP_ELSE OP_DROP 00 OP_ENDIF OP_CAT ce00 OP_PICK 24 OP_SWAP OP_CAT OP_CAT cd00 OP_PICK 22 OP_SWAP OP_CAT OP_CAT cc00 OP_PICK 14 OP_SWAP OP_SIZE OP_ROT OP_EQUAL OP_IF OP_SIZE OP_SWAP OP_CAT OP_ELSE OP_DROP 00 OP_ENDIF OP_CAT cb00 OP_PICK 14 OP_SWAP OP_SIZE OP_ROT OP_EQUAL OP_IF OP_SIZE OP_SWAP OP_CAT OP_ELSE OP_DROP 00 OP_ENDIF OP_CAT ca00 OP_PICK OP_16 OP_SWAP OP_SIZE OP_ROT OP_EQUAL OP_IF OP_SIZE OP_SWAP OP_CAT OP_ELSE OP_DROP 00 OP_ENDIF OP_CAT c900 OP_PICK OP_1 OP_SWAP OP_SIZE OP_ROT OP_EQUAL OP_IF OP_SIZE OP_SWAP OP_CAT OP_ELSE OP_DROP 00 OP_ENDIF OP_CAT c800 OP_PICK OP_1 OP_SWAP OP_SIZE OP_ROT OP_EQUAL OP_IF OP_SIZE OP_SWAP OP_CAT OP_ELSE OP_DROP 00 OP_ENDIF OP_CAT c700 OP_PICK OP_SIZE OP_DUP 46 4b OP_WITHIN OP_VERIFY OP_SWAP OP_CAT OP_CAT c600 OP_PICK 21 OP_SWAP OP_SIZE OP_ROT OP_EQUAL OP_IF OP_SIZE OP_SWAP OP_CAT OP_ELSE OP_DROP 00 OP_ENDIF OP_CAT c500 OP_PICK OP_SIZE OP_DUP 68 OP_EQUALVERIFY 4c OP_SWAP OP_1 OP_1ADD OP_NUM2BIN OP_SIZE OP_1SUB OP_SPLIT OP_DROP OP_CAT OP_SWAP OP_CAT c500 OP_PICK 10 OP_SWAP OP_CAT c500 OP_PICK 10 OP_SWAP OP_CAT OP_CAT c400 OP_PICK 14 OP_SWAP OP_CAT OP_CAT c300 OP_PICK 14 OP_SWAP OP_CAT OP_CAT c200 OP_PICK 14 OP_SWAP OP_CAT OP_CAT c100 OP_PICK 24 OP_SWAP OP_CAT OP_CAT c000 OP_PICK 01 OP_SWAP OP_CAT OP_CAT bf00 OP_PICK OP_1 OP_SWAP OP_SIZE OP_ROT OP_EQUAL OP_IF OP_SIZE OP_SWAP OP_CAT OP_ELSE OP_DROP 00 OP_ENDIF OP_CAT be00 OP_PICK 24 OP_SWAP OP_CAT OP_CAT bd00 OP_PICK 24 OP_SWAP OP_CAT OP_CAT bc00 OP_PICK 21 OP_SWAP OP_CAT OP_CAT 13 OP_PICK OP_CAT OP_DUP OP_SIZE OP_2 OP_ADD OP_2 OP_NUM2BIN 03fd OP_SWAP OP_CAT OP_NIP 02ad68 OP_CAT OP_SWAP OP_SIZE OP_2 OP_NUM2BIN 03fd OP_SWAP OP_CAT OP_TOALTSTACK OP_SIZE OP_2 OP_NUM2BIN 4d OP_SWAP OP_CAT OP_SWAP OP_CAT OP_CAT OP_CAT OP_CAT b900 OP_PICK OP_SIZE OP_DUP 34 OP_EQUALVERIFY OP_SWAP OP_CAT OP_CAT OP_FROMALTSTACK OP_CAT OP_FROMALTSTACK OP_DUP OP_TOALTSTACK OP_CAT OP_SIZE fd OP_SWAP OP_2 OP_1ADD OP_NUM2BIN OP_SIZE OP_1SUB OP_SPLIT OP_DROP OP_CAT OP_SWAP OP_CAT OP_CAT b700 OP_PICK OP_CAT OP_ENDIF b600 OP_PICK OP_CAT b500 OP_PICK OP_SIZE OP_SWAP OP_CAT OP_CAT b400 OP_PICK OP_CAT a600 OP_PICK OP_0NOTEQUAL 9d00 OP_PICK OP_0NOTEQUAL OP_2DUP OP_BOOLAND OP_IF OP_5 OP_ELSE OP_2DUP OP_BOOLOR OP_IF OP_4 OP_ELSE OP_3 OP_ENDIF OP_ENDIF OP_3 OP_ROLL OP_SWAP OP_CAT 22 OP_PICK OP_CAT OP_4 OP_PICK OP_CAT b500 OP_PICK 10 OP_SWAP OP_CAT OP_CAT b400 OP_PICK 10 OP_SWAP OP_CAT OP_CAT b300 OP_PICK 14 OP_SWAP OP_CAT OP_CAT b200 OP_PICK 14 OP_SWAP OP_CAT OP_CAT b100 OP_PICK 14 OP_SWAP OP_CAT OP_CAT b000 OP_PICK 24 OP_SWAP OP_CAT OP_CAT af00 OP_PICK 01 OP_SWAP OP_CAT OP_CAT ae00 OP_PICK OP_1 OP_SWAP OP_SIZE OP_ROT OP_EQUAL OP_IF OP_SIZE OP_SWAP OP_CAT OP_ELSE OP_DROP 00 OP_ENDIF OP_CAT ad00 OP_PICK 24 OP_SWAP OP_CAT OP_CAT ac00 OP_PICK 24 OP_SWAP OP_CAT OP_CAT ab00 OP_PICK 21 OP_SWAP OP_CAT OP_CAT 12 OP_PICK OP_CAT OP_2 OP_ROLL OP_IF 20 OP_PICK OP_CAT OP_2 OP_PICK OP_CAT a800 OP_PICK 10 OP_SWAP OP_CAT OP_CAT a700 OP_PICK 10 OP_SWAP OP_CAT OP_CAT a600 OP_PICK 14 OP_SWAP OP_CAT OP_CAT a500 OP_PICK 14 OP_SWAP OP_CAT OP_CAT a400 OP_PICK 14 OP_SWAP OP_CAT OP_CAT a300 OP_PICK 24 OP_SWAP OP_CAT OP_CAT a200 OP_PICK 01 OP_SWAP OP_CAT OP_CAT a100 OP_PICK OP_1 OP_SWAP OP_SIZE OP_ROT OP_EQUAL OP_IF OP_SIZE OP_SWAP OP_CAT OP_ELSE OP_DROP 00 OP_ENDIF OP_CAT a000 OP_PICK 24 OP_SWAP OP_CAT OP_CAT 9f00 OP_PICK 24 OP_SWAP OP_CAT OP_CAT 9e00 OP_PICK 21 OP_SWAP OP_CAT OP_CAT OP_16 OP_PICK OP_CAT OP_ENDIF 21 OP_PICK OP_CAT OP_15 OP_PICK OP_CAT 9e00 OP_PICK OP_CAT 88ac OP_CAT OP_SWAP OP_IF 20 OP_PICK OP_CAT OP_14 OP_PICK OP_CAT 9c00 OP_PICK OP_CAT 88ac OP_CAT OP_ENDIF 9b00 OP_PICK OP_CAT 9a00 OP_PICK 19 OP_SWAP OP_CAT OP_CAT 9900 OP_PICK OP_CAT OP_HASH256 OP_DUP 27 OP_PICK 20 OP_SPLIT OP_DROP OP_EQUALVERIFY 3f OP_PICK OP_CAT OP_4 OP_PICK OP_IF 9800 OP_PICK OP_SIZE OP_4 OP_EQUALVERIFY 7b OP_PICK OP_0NOTEQUAL OP_DUP OP_IF OP_3 OP_ELSE OP_2 OP_ENDIF OP_2 OP_ROLL OP_SWAP OP_CAT 9900 OP_PICK OP_CAT OP_FROMALTSTACK OP_FROMALTSTACK OP_DUP OP_TOALTSTACK OP_SWAP OP_TOALTSTACK 9900 OP_PICK OP_4 OP_SWAP OP_SIZE OP_ROT OP_EQUAL OP_IF OP_SIZE OP_SWAP OP_CAT OP_ELSE OP_DROP 00 OP_ENDIF OP_CAT 9800 OP_PICK OP_4 OP_SWAP OP_SIZE OP_ROT OP_EQUAL OP_IF OP_SIZE OP_SWAP OP_CAT OP_ELSE OP_DROP 00 OP_ENDIF OP_CAT 9700 OP_PICK 14 OP_SWAP OP_SIZE OP_ROT OP_EQUAL OP_IF OP_SIZE OP_SWAP OP_CAT OP_ELSE OP_DROP 00 OP_ENDIF OP_CAT 9600 OP_PICK 24 OP_SWAP OP_SIZE OP_ROT OP_EQUAL OP_IF OP_SIZE OP_SWAP OP_CAT OP_ELSE OP_DROP 00 OP_ENDIF OP_CAT 9500 OP_PICK 24 OP_SWAP OP_SIZE OP_ROT OP_EQUAL OP_IF OP_SIZE OP_SWAP OP_CAT OP_ELSE OP_DROP 00 OP_ENDIF OP_CAT 9400 OP_PICK 24 OP_SWAP OP_CAT OP_CAT 9300 OP_PICK 22 OP_SWAP OP_CAT OP_CAT 9200 OP_PICK 14 OP_SWAP OP_SIZE OP_ROT OP_EQUAL OP_IF OP_SIZE OP_SWAP OP_CAT OP_ELSE OP_DROP 00 OP_ENDIF OP_CAT 9100 OP_PICK 14 OP_SWAP OP_SIZE OP_ROT OP_EQUAL OP_IF OP_SIZE OP_SWAP OP_CAT OP_ELSE OP_DROP 00 OP_ENDIF OP_CAT 9000 OP_PICK OP_16 OP_SWAP OP_SIZE OP_ROT OP_EQUAL OP_IF OP_SIZE OP_SWAP OP_CAT OP_ELSE OP_DROP 00 OP_ENDIF OP_CAT 8f00 OP_PICK OP_1 OP_SWAP OP_SIZE OP_ROT OP_EQUAL OP_IF OP_SIZE OP_SWAP OP_CAT OP_ELSE OP_DROP 00 OP_ENDIF OP_CAT 8e00 OP_PICK OP_1 OP_SWAP OP_SIZE OP_ROT OP_EQUAL OP_IF OP_SIZE OP_SWAP OP_CAT OP_ELSE OP_DROP 00 OP_ENDIF OP_CAT 8d00 OP_PICK OP_SIZE OP_DUP 46 4b OP_WITHIN OP_VERIFY OP_SWAP OP_CAT OP_CAT 8c00 OP_PICK 21 OP_SWAP OP_SIZE OP_ROT OP_EQUAL OP_IF OP_SIZE OP_SWAP OP_CAT OP_ELSE OP_DROP 00 OP_ENDIF OP_CAT 8b00 OP_PICK OP_SIZE OP_DUP 68 OP_EQUALVERIFY 4c OP_SWAP OP_1 OP_1ADD OP_NUM2BIN OP_SIZE OP_1SUB OP_SPLIT OP_DROP OP_CAT OP_SWAP OP_CAT 8b00 OP_PICK 10 OP_SWAP OP_CAT 8b00 OP_PICK 10 OP_SWAP OP_CAT OP_CAT 8a00 OP_PICK 14 OP_SWAP OP_CAT OP_CAT 8900 OP_PICK 14 OP_SWAP OP_CAT OP_CAT 8800 OP_PICK 14 OP_SWAP OP_CAT OP_CAT 8700 OP_PICK 24 OP_SWAP OP_CAT OP_CAT 8600 OP_PICK 01 OP_SWAP OP_CAT OP_CAT 8500 OP_PICK OP_1 OP_SWAP OP_SIZE OP_ROT OP_EQUAL OP_IF OP_SIZE OP_SWAP OP_CAT OP_ELSE OP_DROP 00 OP_ENDIF OP_CAT 8400 OP_PICK 24 OP_SWAP OP_CAT OP_CAT 8300 OP_PICK 24 OP_SWAP OP_CAT OP_CAT 8200 OP_PICK 21 OP_SWAP OP_CAT OP_CAT 15 OP_PICK OP_CAT OP_DUP OP_SIZE OP_2 OP_ADD OP_2 OP_NUM2BIN 03fd OP_SWAP OP_CAT OP_NIP 02ad68 OP_CAT OP_SWAP OP_SIZE OP_2 OP_NUM2BIN 03fd OP_SWAP OP_CAT OP_TOALTSTACK OP_SIZE OP_2 OP_NUM2BIN 4d OP_SWAP OP_CAT OP_SWAP OP_CAT OP_CAT OP_CAT OP_CAT 7f OP_PICK OP_SIZE OP_DUP 34 OP_EQUALVERIFY OP_SWAP OP_CAT OP_CAT OP_FROMALTSTACK OP_CAT OP_FROMALTSTACK OP_DUP OP_TOALTSTACK OP_CAT OP_SIZE fd OP_SWAP OP_2 OP_1ADD OP_NUM2BIN OP_SIZE OP_1SUB OP_SPLIT OP_DROP OP_CAT OP_SWAP OP_CAT OP_CAT 7d OP_PICK OP_CAT OP_SWAP OP_IF 7a OP_PICK OP_CAT OP_FROMALTSTACK OP_FROMALTSTACK OP_DUP OP_TOALTSTACK OP_SWAP OP_TOALTSTACK 79 OP_PICK OP_4 OP_SWAP OP_SIZE OP_ROT OP_EQUAL OP_IF OP_SIZE OP_SWAP OP_CAT OP_ELSE OP_DROP 00 OP_ENDIF OP_CAT 78 OP_PICK OP_4 OP_SWAP OP_SIZE OP_ROT OP_EQUAL OP_IF OP_SIZE OP_SWAP OP_CAT OP_ELSE OP_DROP 00 OP_ENDIF OP_CAT 77 OP_PICK 14 OP_SWAP OP_SIZE OP_ROT OP_EQUAL OP_IF OP_SIZE OP_SWAP OP_CAT OP_ELSE OP_DROP 00 OP_ENDIF OP_CAT 76 OP_PICK 24 OP_SWAP OP_SIZE OP_ROT OP_EQUAL OP_IF OP_SIZE OP_SWAP OP_CAT OP_ELSE OP_DROP 00 OP_ENDIF OP_CAT 75 OP_PICK 24 OP_SWAP OP_SIZE OP_ROT OP_EQUAL OP_IF OP_SIZE OP_SWAP OP_CAT OP_ELSE OP_DROP 00 OP_ENDIF OP_CAT 74 OP_PICK 24 OP_SWAP OP_CAT OP_CAT 73 OP_PICK 22 OP_SWAP OP_CAT OP_CAT 72 OP_PICK 14 OP_SWAP OP_SIZE OP_ROT OP_EQUAL OP_IF OP_SIZE OP_SWAP OP_CAT OP_ELSE OP_DROP 00 OP_ENDIF OP_CAT 71 OP_PICK 14 OP_SWAP OP_SIZE OP_ROT OP_EQUAL OP_IF OP_SIZE OP_SWAP OP_CAT OP_ELSE OP_DROP 00 OP_ENDIF OP_CAT 70 OP_PICK OP_16 OP_SWAP OP_SIZE OP_ROT OP_EQUAL OP_IF OP_SIZE OP_SWAP OP_CAT OP_ELSE OP_DROP 00 OP_ENDIF OP_CAT 6f OP_PICK OP_1 OP_SWAP OP_SIZE OP_ROT OP_EQUAL OP_IF OP_SIZE OP_SWAP OP_CAT OP_ELSE OP_DROP 00 OP_ENDIF OP_CAT 6e OP_PICK OP_1 OP_SWAP OP_SIZE OP_ROT OP_EQUAL OP_IF OP_SIZE OP_SWAP OP_CAT OP_ELSE OP_DROP 00 OP_ENDIF OP_CAT 6d OP_PICK OP_SIZE OP_DUP 46 4b OP_WITHIN OP_VERIFY OP_SWAP OP_CAT OP_CAT 6c OP_PICK 21 OP_SWAP OP_SIZE OP_ROT OP_EQUAL OP_IF OP_SIZE OP_SWAP OP_CAT OP_ELSE OP_DROP 00 OP_ENDIF OP_CAT 6b OP_PICK OP_SIZE OP_DUP 68 OP_EQUALVERIFY 4c OP_SWAP OP_1 OP_1ADD OP_NUM2BIN OP_SIZE OP_1SUB OP_SPLIT OP_DROP OP_CAT OP_SWAP OP_CAT 69 OP_PICK 10 OP_SWAP OP_CAT 69 OP_PICK 10 OP_SWAP OP_CAT OP_CAT 68 OP_PICK 14 OP_SWAP OP_CAT OP_CAT 67 OP_PICK 14 OP_SWAP OP_CAT OP_CAT 66 OP_PICK 14 OP_SWAP OP_CAT OP_CAT 65 OP_PICK 24 OP_SWAP OP_CAT OP_CAT 64 OP_PICK 01 OP_SWAP OP_CAT OP_CAT 63 OP_PICK OP_1 OP_SWAP OP_SIZE OP_ROT OP_EQUAL OP_IF OP_SIZE OP_SWAP OP_CAT OP_ELSE OP_DROP 00 OP_ENDIF OP_CAT 62 OP_PICK 24 OP_SWAP OP_CAT OP_CAT 61 OP_PICK 24 OP_SWAP OP_CAT OP_CAT 60 OP_PICK 21 OP_SWAP OP_CAT OP_CAT OP_16 OP_PICK OP_CAT OP_DUP OP_SIZE OP_2 OP_ADD OP_2 OP_NUM2BIN 03fd OP_SWAP OP_CAT OP_NIP 02ad68 OP_CAT OP_SWAP OP_SIZE OP_2 OP_NUM2BIN 03fd OP_SWAP OP_CAT OP_TOALTSTACK OP_SIZE OP_2 OP_NUM2BIN 4d OP_SWAP OP_CAT OP_SWAP OP_CAT OP_CAT OP_CAT OP_CAT 5f OP_PICK OP_SIZE OP_DUP 34 OP_EQUALVERIFY OP_SWAP OP_CAT OP_CAT OP_FROMALTSTACK OP_CAT OP_FROMALTSTACK OP_DUP OP_TOALTSTACK OP_CAT OP_SIZE fd OP_SWAP OP_2 OP_1ADD OP_NUM2BIN OP_SIZE OP_1SUB OP_SPLIT OP_DROP OP_CAT OP_SWAP OP_CAT OP_CAT 5e OP_PICK OP_CAT OP_ENDIF 5e OP_PICK OP_CAT 5d OP_PICK OP_SIZE OP_SWAP OP_CAT OP_CAT 5c OP_PICK OP_CAT 4e OP_PICK OP_0NOTEQUAL 45 OP_PICK OP_0NOTEQUAL OP_2DUP OP_BOOLAND OP_IF OP_5 OP_ELSE OP_2DUP OP_BOOLOR OP_IF OP_4 OP_ELSE OP_3 OP_ENDIF OP_ENDIF OP_3 OP_ROLL OP_SWAP OP_CAT 23 OP_PICK OP_CAT OP_5 OP_PICK OP_CAT 5d OP_PICK 10 OP_SWAP OP_CAT OP_CAT 5c OP_PICK 10 OP_SWAP OP_CAT OP_CAT 5b OP_PICK 14 OP_SWAP OP_CAT OP_CAT 5a OP_PICK 14 OP_SWAP OP_CAT OP_CAT 59 OP_PICK 14 OP_SWAP OP_CAT OP_CAT 58 OP_PICK 24 OP_SWAP OP_CAT OP_CAT 57 OP_PICK 01 OP_SWAP OP_CAT OP_CAT 56 OP_PICK OP_1 OP_SWAP OP_SIZE OP_ROT OP_EQUAL OP_IF OP_SIZE OP_SWAP OP_CAT OP_ELSE OP_DROP 00 OP_ENDIF OP_CAT 55 OP_PICK 24 OP_SWAP OP_CAT OP_CAT 54 OP_PICK 24 OP_SWAP OP_CAT OP_CAT 53 OP_PICK 21 OP_SWAP OP_CAT OP_CAT 13 OP_PICK OP_CAT OP_2 OP_ROLL OP_IF 21 OP_PICK OP_CAT OP_3 OP_PICK OP_CAT 50 OP_PICK 10 OP_SWAP OP_CAT OP_CAT 4f OP_PICK 10 OP_SWAP OP_CAT OP_CAT 4e OP_PICK 14 OP_SWAP OP_CAT OP_CAT 4d OP_PICK 14 OP_SWAP OP_CAT OP_CAT 4c OP_PICK 14 OP_SWAP OP_CAT OP_CAT 4b OP_PICK 24 OP_SWAP OP_CAT OP_CAT 4a OP_PICK 01 OP_SWAP OP_CAT OP_CAT 49 OP_PICK OP_1 OP_SWAP OP_SIZE OP_ROT OP_EQUAL OP_IF OP_SIZE OP_SWAP OP_CAT OP_ELSE OP_DROP 00 OP_ENDIF OP_CAT 48 OP_PICK 24 OP_SWAP OP_CAT OP_CAT 47 OP_PICK 24 OP_SWAP OP_CAT OP_CAT 46 OP_PICK 21 OP_SWAP OP_CAT OP_CAT 11 OP_PICK OP_CAT OP_ENDIF 22 OP_PICK OP_CAT OP_16 OP_PICK OP_CAT 46 OP_PICK OP_CAT 88ac OP_CAT OP_SWAP OP_IF 20 OP_PICK OP_CAT OP_14 OP_PICK OP_CAT 43 OP_PICK OP_CAT 88ac OP_CAT OP_ENDIF 43 OP_PICK OP_CAT 42 OP_PICK 19 OP_SWAP OP_CAT OP_CAT 41 OP_PICK OP_CAT OP_HASH256 OP_DUP 2d OP_PICK 20 OP_SPLIT OP_DROP OP_EQUALVERIFY 3f OP_PICK OP_CAT 2a OP_PICK OP_BIN2NUM OP_IF OP_SWAP OP_ENDIF OP_CAT OP_ENDIF OP_CAT OP_ELSE f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK f000 OP_PICK OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_SIZE OP_NIP OP_0 OP_EQUALVERIFY OP_ENDIF 39 OP_PICK OP_CAT OP_HASH256 22 OP_PICK OP_EQUALVERIFY 31 OP_PICK OP_DUP OP_SIZE OP_1SUB OP_SPLIT OP_NIP 41 OP_EQUALVERIFY 31 OP_PICK OP_DUP OP_HASH160 2f OP_ELSE OP_14 OP_PICK OP_DUP OP_SIZE OP_1SUB OP_SPLIT OP_NIP 41 OP_EQUALVERIFY OP_14 OP_PICK OP_DUP OP_HASH160 OP_12 OP_ENDIF OP_PICK OP_EQUALVERIFY OP_CHECKSIG";
17
+ this.LOCK_SCRIPT_SUFFIX = "OP_2 OP_PICK OP_BIN2NUM OP_NOT OP_2 OP_PICK OP_BIN2NUM OP_NOT OP_BOOLOR OP_TUCK OP_IF OP_13 OP_PICK OP_EQUALVERIFY OP_15 OP_PICK OP_DUP 25 OP_EQUAL OP_NOT OP_VERIFY 27 OP_EQUAL OP_NOT OP_VERIFY OP_ELSE OP_DROP OP_ENDIF OP_SWAP OP_DUP OP_BIN2NUM OP_0NOTEQUAL OP_12 OP_PICK OP_IFDUP OP_IF OP_DUP 41 OP_TOALTSTACK OP_HASH256 OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT 00 OP_CAT OP_BIN2NUM OP_1 OP_ADD OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SIZE OP_SWAP OP_CAT 022079be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f8179802 OP_SWAP OP_CAT OP_SIZE OP_SWAP OP_CAT 30 OP_SWAP OP_CAT OP_FROMALTSTACK OP_CAT 038ff83d8cf12121491609c4939dc11c4aa35503508fe432dc5a5c1905608b9218 OP_CHECKSIGVERIFY OP_4 OP_SPLIT 20 OP_SPLIT 20 OP_SPLIT 24 OP_SPLIT OP_1 OP_SPLIT OP_SWAP OP_DUP ff OP_EQUAL OP_IF OP_DROP OP_8 OP_SPLIT OP_SWAP OP_ELSE OP_DUP fe OP_EQUAL OP_IF OP_DROP OP_4 OP_SPLIT OP_SWAP OP_ELSE OP_DUP fd OP_EQUAL OP_IF OP_DROP OP_2 OP_SPLIT OP_SWAP OP_ELSE 00 OP_CAT OP_ENDIF OP_ENDIF OP_ENDIF OP_BIN2NUM OP_SPLIT OP_8 OP_SPLIT OP_4 OP_SPLIT 20 OP_SPLIT OP_4 OP_SPLIT OP_1 OP_SPLIT OP_SWAP 41 OP_EQUALVERIFY OP_9 OP_PICK OP_2 OP_GREATERTHANOREQUAL OP_VERIFY OP_5 OP_ROLL 11 OP_SPLIT 11 OP_SPLIT 15 OP_SPLIT 15 OP_SPLIT 15 OP_SPLIT 25 OP_SPLIT OP_2 OP_SPLIT OP_2 OP_SPLIT 25 OP_SPLIT 25 OP_SPLIT 22 OP_SPLIT 1a OP_PICK OP_2 OP_MOD OP_DUP OP_IF 26 OP_PICK OP_1ADD 1c OP_PICK OP_EQUALVERIFY OP_ENDIF OP_DUP 27 OP_PICK OP_2 OP_MOD OP_SWAP OP_IF OP_0 OP_ELSE OP_1 OP_ENDIF OP_EQUALVERIFY 1d02b0178876a914 ffffffffffffffffffffffffffffff7f 10 OP_0 OP_16 OP_NUM2BIN OP_CAT 14 OP_0 14 OP_NUM2BIN OP_CAT 21 OP_0 21 OP_NUM2BIN OP_CAT 24 OP_0 24 OP_NUM2BIN OP_CAT 27 OP_PICK OP_DUP OP_0 OP_GREATERTHANOREQUAL OP_VERIFY OP_5 OP_PICK OP_LESSTHANOREQUAL OP_VERIFY 2d OP_PICK OP_DUP OP_0 OP_GREATERTHANOREQUAL OP_VERIFY OP_5 OP_PICK OP_LESSTHANOREQUAL OP_VERIFY 2c OP_PICK OP_DUP 20 OP_EQUAL OP_SWAP OP_DUP 21 OP_EQUAL OP_SWAP OP_DUP 22 OP_EQUAL OP_SWAP OP_DUP 23 OP_EQUAL OP_SWAP OP_DUP 24 OP_EQUAL OP_SWAP 25 OP_EQUAL 1d OP_PICK OP_BIN2NUM OP_1 OP_EQUALVERIFY OP_0 OP_PICK OP_IF 2d OP_PICK 34 OP_PICK OP_ADD OP_11 OP_PICK OP_LESSTHANOREQUAL OP_VERIFY OP_ENDIF OP_2 OP_PICK OP_IF 2d OP_PICK 34 OP_PICK OP_SUB OP_0 OP_GREATERTHANOREQUAL OP_VERIFY OP_ENDIF OP_12 OP_PICK OP_NOTIF 1d OP_PICK OP_12 OP_PICK OP_CAT OP_DUP 37 OP_PICK OP_CAT 88ac OP_CAT OP_4 OP_PICK OP_IF OP_SWAP 36 OP_PICK OP_CAT 88ac OP_CAT OP_CAT OP_ELSE OP_NIP OP_ENDIF OP_ELSE ff OP_ENDIF OP_5 OP_PICK OP_7 OP_PICK OP_BOOLOR OP_IF 19 OP_PICK OP_11 OP_PICK OP_CAT OP_ELSE OP_1 OP_PICK OP_4 OP_PICK OP_BOOLOR OP_IF 19 OP_PICK 10 36 OP_PICK OP_CAT OP_3 OP_PICK 35 OP_PICK OP_BIN2NUM OP_BOOLAND OP_IF OP_SWAP OP_ENDIF OP_CAT OP_ELSE OP_2 OP_PICK OP_IF 10 2f OP_PICK 2f OP_PICK OP_DUP OP_0 OP_GREATERTHANOREQUAL OP_VERIFY OP_ADD OP_DUP OP_14 OP_PICK OP_LESSTHANOREQUAL OP_VERIFY OP_SIZE OP_16 OP_LESSTHAN OP_IF 00 OP_CAT OP_ENDIF OP_SIZE OP_16 OP_LESSTHAN OP_IF 00 OP_CAT OP_ENDIF OP_SIZE OP_16 OP_LESSTHAN OP_IF 00 OP_CAT OP_ENDIF OP_SIZE OP_16 OP_LESSTHAN OP_IF 00 OP_CAT OP_ENDIF OP_SIZE OP_16 OP_LESSTHAN OP_IF 00 OP_CAT OP_ENDIF OP_SIZE OP_16 OP_LESSTHAN OP_IF 00 OP_CAT OP_ENDIF OP_SIZE OP_16 OP_LESSTHAN OP_IF 00 OP_CAT OP_ENDIF OP_SIZE OP_16 OP_LESSTHAN OP_IF 00 OP_CAT OP_ENDIF OP_SIZE OP_16 OP_LESSTHAN OP_IF 00 OP_CAT OP_ENDIF OP_SIZE OP_16 OP_LESSTHAN OP_IF 00 OP_CAT OP_ENDIF OP_SIZE OP_16 OP_LESSTHAN OP_IF 00 OP_CAT OP_ENDIF OP_SIZE OP_16 OP_LESSTHAN OP_IF 00 OP_CAT OP_ENDIF OP_SIZE OP_16 OP_LESSTHAN OP_IF 00 OP_CAT OP_ENDIF OP_SIZE OP_16 OP_LESSTHAN OP_IF 00 OP_CAT OP_ENDIF OP_SIZE OP_16 OP_LESSTHAN OP_IF 00 OP_CAT OP_ENDIF OP_SIZE OP_16 OP_LESSTHAN OP_IF 00 OP_CAT OP_ENDIF OP_CAT OP_11 OP_PICK OP_CAT OP_ELSE OP_4 OP_PICK OP_IF 10 2f OP_PICK 2f OP_PICK OP_DUP OP_0 OP_GREATERTHANOREQUAL OP_VERIFY OP_SUB OP_DUP OP_0 OP_GREATERTHANOREQUAL OP_VERIFY OP_SIZE OP_16 OP_LESSTHAN OP_IF 00 OP_CAT OP_ENDIF OP_SIZE OP_16 OP_LESSTHAN OP_IF 00 OP_CAT OP_ENDIF OP_SIZE OP_16 OP_LESSTHAN OP_IF 00 OP_CAT OP_ENDIF OP_SIZE OP_16 OP_LESSTHAN OP_IF 00 OP_CAT OP_ENDIF OP_SIZE OP_16 OP_LESSTHAN OP_IF 00 OP_CAT OP_ENDIF OP_SIZE OP_16 OP_LESSTHAN OP_IF 00 OP_CAT OP_ENDIF OP_SIZE OP_16 OP_LESSTHAN OP_IF 00 OP_CAT OP_ENDIF OP_SIZE OP_16 OP_LESSTHAN OP_IF 00 OP_CAT OP_ENDIF OP_SIZE OP_16 OP_LESSTHAN OP_IF 00 OP_CAT OP_ENDIF OP_SIZE OP_16 OP_LESSTHAN OP_IF 00 OP_CAT OP_ENDIF OP_SIZE OP_16 OP_LESSTHAN OP_IF 00 OP_CAT OP_ENDIF OP_SIZE OP_16 OP_LESSTHAN OP_IF 00 OP_CAT OP_ENDIF OP_SIZE OP_16 OP_LESSTHAN OP_IF 00 OP_CAT OP_ENDIF OP_SIZE OP_16 OP_LESSTHAN OP_IF 00 OP_CAT OP_ENDIF OP_SIZE OP_16 OP_LESSTHAN OP_IF 00 OP_CAT OP_ENDIF OP_SIZE OP_16 OP_LESSTHAN OP_IF 00 OP_CAT OP_ENDIF OP_CAT OP_11 OP_PICK OP_CAT OP_ENDIF OP_ENDIF OP_ENDIF OP_ENDIF OP_6 OP_PICK OP_IF 18 OP_PICK OP_CAT 14 38 OP_PICK OP_CAT OP_CAT OP_10 OP_PICK OP_ELSE OP_7 OP_PICK OP_4 OP_PICK OP_BOOLOR OP_6 OP_PICK OP_BOOLOR OP_IF 17 OP_PICK OP_CAT OP_10 OP_PICK OP_DUP OP_CAT OP_ELSE OP_4 OP_PICK OP_IF 18 OP_PICK OP_CAT 14 38 OP_PICK OP_CAT 14 38 OP_PICK OP_CAT OP_CAT OP_ELSE OP_2 OP_PICK OP_IF 33 OP_PICK OP_BIN2NUM OP_NOTIF 18 OP_PICK OP_ELSE 14 3d OP_PICK OP_CAT OP_ENDIF OP_CAT 14 38 OP_PICK OP_CAT OP_CAT OP_10 OP_PICK OP_ENDIF OP_ENDIF OP_ENDIF OP_ENDIF OP_CAT OP_6 OP_PICK OP_8 OP_PICK OP_BOOLOR OP_4 OP_PICK OP_BOOLOR OP_5 OP_PICK OP_BOOLOR OP_6 OP_PICK OP_BOOLOR OP_IF OP_8 OP_PICK OP_CAT OP_ELSE OP_1 OP_PICK OP_IF 33 OP_PICK OP_BIN2NUM OP_NOTIF 24 3b OP_PICK OP_CAT OP_CAT OP_ELSE 12 OP_PICK OP_CAT OP_ENDIF OP_ENDIF OP_ENDIF 01 35 OP_PICK OP_CAT OP_CAT OP_2 OP_PICK 34 OP_PICK OP_BIN2NUM OP_BOOLAND OP_IF 0100 OP_CAT 24 3c OP_PICK OP_CAT OP_CAT 24 3b OP_PICK OP_CAT OP_CAT OP_ELSE 33 OP_PICK OP_BIN2NUM OP_NOTIF 0100 OP_ELSE 0101 OP_ENDIF OP_CAT 24 21 OP_PICK OP_CAT OP_CAT 12 OP_PICK OP_CAT OP_ENDIF OP_16 OP_PICK OP_CAT OP_15 OP_PICK OP_CAT OP_SIZE fd OP_SWAP OP_CAT OP_TUCK 21 OP_PICK OP_SWAP OP_CAT OP_SWAP OP_CAT OP_6 OP_PICK OP_IF 1a OP_PICK OP_13 OP_PICK OP_CAT OP_7 OP_PICK OP_NOTIF 19 OP_ELSE 18 OP_ENDIF OP_PICK OP_CAT OP_12 OP_PICK OP_DUP OP_CAT OP_CAT OP_10 OP_PICK OP_CAT 01 37 OP_PICK OP_CAT OP_CAT 3d OP_PICK OP_BIN2NUM OP_NOTIF 0101 OP_ELSE 0100 OP_ENDIF OP_CAT 24 23 OP_PICK OP_CAT OP_CAT 14 OP_PICK OP_CAT 12 OP_PICK OP_CAT 11 OP_PICK OP_CAT OP_2 OP_PICK 22 OP_PICK OP_SWAP OP_CAT OP_SWAP OP_CAT 39 OP_PICK OP_BIN2NUM OP_IF OP_SWAP OP_ENDIF OP_CAT OP_ENDIF OP_2 OP_ROLL OP_15 OP_PICK OP_NOTIF OP_CAT OP_ELSE OP_DROP OP_ENDIF 38 OP_PICK OP_CAT OP_HASH256 1d OP_PICK OP_EQUALVERIFY 1f OP_PICK OP_2 OP_PICK OP_IF 3b OP_PICK 34 OP_PICK OP_BIN2NUM OP_IF OP_SWAP OP_ENDIF OP_CAT OP_ENDIF OP_14 OP_PICK 25 OP_PICK OP_BOOLAND OP_IF d400 OP_PICK OP_SIZE OP_4 OP_EQUALVERIFY b800 OP_PICK OP_0NOTEQUAL OP_DUP OP_IF OP_3 OP_ELSE OP_2 OP_ENDIF OP_2 OP_ROLL OP_SWAP OP_CAT d500 OP_PICK OP_CAT OP_0 9600 OP_NUM2BIN OP_DUP OP_TOALTSTACK d500 OP_PICK OP_4 OP_SWAP OP_SIZE OP_ROT OP_EQUAL OP_IF OP_SIZE OP_SWAP OP_CAT OP_ELSE OP_DROP 00 OP_ENDIF OP_CAT d400 OP_PICK OP_4 OP_SWAP OP_SIZE OP_ROT OP_EQUAL OP_IF OP_SIZE OP_SWAP OP_CAT OP_ELSE OP_DROP 00 OP_ENDIF OP_CAT d300 OP_PICK 14 OP_SWAP OP_SIZE OP_ROT OP_EQUAL OP_IF OP_SIZE OP_SWAP OP_CAT OP_ELSE OP_DROP 00 OP_ENDIF OP_CAT d200 OP_PICK 24 OP_SWAP OP_SIZE OP_ROT OP_EQUAL OP_IF OP_SIZE OP_SWAP OP_CAT OP_ELSE OP_DROP 00 OP_ENDIF OP_CAT d100 OP_PICK 24 OP_SWAP OP_SIZE OP_ROT OP_EQUAL OP_IF OP_SIZE OP_SWAP OP_CAT OP_ELSE OP_DROP 00 OP_ENDIF OP_CAT d000 OP_PICK 24 OP_SWAP OP_CAT OP_CAT cf00 OP_PICK 22 OP_SWAP OP_CAT OP_CAT ce00 OP_PICK 14 OP_SWAP OP_SIZE OP_ROT OP_EQUAL OP_IF OP_SIZE OP_SWAP OP_CAT OP_ELSE OP_DROP 00 OP_ENDIF OP_CAT cd00 OP_PICK 14 OP_SWAP OP_SIZE OP_ROT OP_EQUAL OP_IF OP_SIZE OP_SWAP OP_CAT OP_ELSE OP_DROP 00 OP_ENDIF OP_CAT cc00 OP_PICK OP_16 OP_SWAP OP_SIZE OP_ROT OP_EQUAL OP_IF OP_SIZE OP_SWAP OP_CAT OP_ELSE OP_DROP 00 OP_ENDIF OP_CAT cb00 OP_PICK OP_1 OP_SWAP OP_SIZE OP_ROT OP_EQUAL OP_IF OP_SIZE OP_SWAP OP_CAT OP_ELSE OP_DROP 00 OP_ENDIF OP_CAT ca00 OP_PICK OP_1 OP_SWAP OP_SIZE OP_ROT OP_EQUAL OP_IF OP_SIZE OP_SWAP OP_CAT OP_ELSE OP_DROP 00 OP_ENDIF OP_CAT c900 OP_PICK OP_SIZE OP_DUP 4b OP_LESSTHANOREQUAL OP_VERIFY OP_SWAP OP_CAT OP_CAT c800 OP_PICK 21 OP_SWAP OP_SIZE OP_ROT OP_EQUAL OP_IF OP_SIZE OP_SWAP OP_CAT OP_ELSE OP_DROP 00 OP_ENDIF OP_CAT c700 OP_PICK OP_SIZE OP_DUP 68 OP_EQUALVERIFY 4c OP_SWAP OP_1 OP_1ADD OP_NUM2BIN OP_SIZE OP_1SUB OP_SPLIT OP_DROP OP_CAT OP_SWAP OP_CAT c700 OP_PICK 10 OP_SWAP OP_CAT c700 OP_PICK 10 OP_SWAP OP_CAT OP_CAT c600 OP_PICK 14 OP_SWAP OP_CAT OP_CAT c500 OP_PICK 14 OP_SWAP OP_CAT OP_CAT c400 OP_PICK 14 OP_SWAP OP_CAT OP_CAT c300 OP_PICK 24 OP_SWAP OP_CAT OP_CAT c200 OP_PICK 01 OP_SWAP OP_CAT OP_CAT c100 OP_PICK OP_1 OP_SWAP OP_SIZE OP_ROT OP_EQUAL OP_IF OP_SIZE OP_SWAP OP_CAT OP_ELSE OP_DROP 00 OP_ENDIF OP_CAT c000 OP_PICK 24 OP_SWAP OP_CAT OP_CAT bf00 OP_PICK 24 OP_SWAP OP_CAT OP_CAT 15 OP_PICK OP_CAT 14 OP_PICK OP_CAT OP_DUP OP_SIZE OP_2 OP_ADD OP_2 OP_NUM2BIN 03fd OP_SWAP OP_CAT OP_NIP 02ad68 OP_CAT OP_SWAP OP_SIZE OP_2 OP_NUM2BIN 03fd OP_SWAP OP_CAT OP_TOALTSTACK OP_SIZE OP_2 OP_NUM2BIN 4d OP_SWAP OP_CAT OP_SWAP OP_CAT OP_CAT OP_CAT OP_CAT bc00 OP_PICK OP_SIZE OP_DUP 34 OP_EQUALVERIFY OP_SWAP OP_CAT OP_CAT OP_FROMALTSTACK OP_CAT 5579557a557a557955797e7e7e7e547a527a547a547a7e7e7e7c73630141 13 OP_PICK 29 OP_SPLIT OP_NIP 7d01 OP_SPLIT OP_DROP OP_CAT abad68 OP_CAT OP_DUP OP_TOALTSTACK OP_CAT OP_SIZE fd OP_SWAP OP_2 OP_1ADD OP_NUM2BIN OP_SIZE OP_1SUB OP_SPLIT OP_DROP OP_CAT OP_SWAP OP_CAT OP_CAT ba00 OP_PICK OP_CAT OP_SWAP OP_IF b800 OP_PICK OP_CAT OP_FROMALTSTACK OP_FROMALTSTACK OP_DUP OP_TOALTSTACK OP_SWAP OP_TOALTSTACK b800 OP_PICK OP_4 OP_SWAP OP_SIZE OP_ROT OP_EQUAL OP_IF OP_SIZE OP_SWAP OP_CAT OP_ELSE OP_DROP 00 OP_ENDIF OP_CAT b700 OP_PICK OP_4 OP_SWAP OP_SIZE OP_ROT OP_EQUAL OP_IF OP_SIZE OP_SWAP OP_CAT OP_ELSE OP_DROP 00 OP_ENDIF OP_CAT b600 OP_PICK 14 OP_SWAP OP_SIZE OP_ROT OP_EQUAL OP_IF OP_SIZE OP_SWAP OP_CAT OP_ELSE OP_DROP 00 OP_ENDIF OP_CAT b500 OP_PICK 24 OP_SWAP OP_SIZE OP_ROT OP_EQUAL OP_IF OP_SIZE OP_SWAP OP_CAT OP_ELSE OP_DROP 00 OP_ENDIF OP_CAT b400 OP_PICK 24 OP_SWAP OP_SIZE OP_ROT OP_EQUAL OP_IF OP_SIZE OP_SWAP OP_CAT OP_ELSE OP_DROP 00 OP_ENDIF OP_CAT b300 OP_PICK 24 OP_SWAP OP_CAT OP_CAT b200 OP_PICK 22 OP_SWAP OP_CAT OP_CAT b100 OP_PICK 14 OP_SWAP OP_SIZE OP_ROT OP_EQUAL OP_IF OP_SIZE OP_SWAP OP_CAT OP_ELSE OP_DROP 00 OP_ENDIF OP_CAT b000 OP_PICK 14 OP_SWAP OP_SIZE OP_ROT OP_EQUAL OP_IF OP_SIZE OP_SWAP OP_CAT OP_ELSE OP_DROP 00 OP_ENDIF OP_CAT af00 OP_PICK OP_16 OP_SWAP OP_SIZE OP_ROT OP_EQUAL OP_IF OP_SIZE OP_SWAP OP_CAT OP_ELSE OP_DROP 00 OP_ENDIF OP_CAT ae00 OP_PICK OP_1 OP_SWAP OP_SIZE OP_ROT OP_EQUAL OP_IF OP_SIZE OP_SWAP OP_CAT OP_ELSE OP_DROP 00 OP_ENDIF OP_CAT ad00 OP_PICK OP_1 OP_SWAP OP_SIZE OP_ROT OP_EQUAL OP_IF OP_SIZE OP_SWAP OP_CAT OP_ELSE OP_DROP 00 OP_ENDIF OP_CAT ac00 OP_PICK OP_SIZE OP_DUP 4b OP_LESSTHANOREQUAL OP_VERIFY OP_SWAP OP_CAT OP_CAT ab00 OP_PICK 21 OP_SWAP OP_SIZE OP_ROT OP_EQUAL OP_IF OP_SIZE OP_SWAP OP_CAT OP_ELSE OP_DROP 00 OP_ENDIF OP_CAT aa00 OP_PICK OP_SIZE OP_DUP 68 OP_EQUALVERIFY 4c OP_SWAP OP_1 OP_1ADD OP_NUM2BIN OP_SIZE OP_1SUB OP_SPLIT OP_DROP OP_CAT OP_SWAP OP_CAT aa00 OP_PICK 10 OP_SWAP OP_CAT aa00 OP_PICK 10 OP_SWAP OP_CAT OP_CAT a900 OP_PICK 14 OP_SWAP OP_CAT OP_CAT a800 OP_PICK 14 OP_SWAP OP_CAT OP_CAT a700 OP_PICK 14 OP_SWAP OP_CAT OP_CAT a600 OP_PICK 24 OP_SWAP OP_CAT OP_CAT a500 OP_PICK 01 OP_SWAP OP_CAT OP_CAT a400 OP_PICK OP_1 OP_SWAP OP_SIZE OP_ROT OP_EQUAL OP_IF OP_SIZE OP_SWAP OP_CAT OP_ELSE OP_DROP 00 OP_ENDIF OP_CAT a300 OP_PICK 24 OP_SWAP OP_CAT OP_CAT a200 OP_PICK 24 OP_SWAP OP_CAT OP_CAT 14 OP_PICK OP_CAT 13 OP_PICK OP_CAT OP_DUP OP_SIZE OP_2 OP_ADD OP_2 OP_NUM2BIN 03fd OP_SWAP OP_CAT OP_NIP 02ad68 OP_CAT OP_SWAP OP_SIZE OP_2 OP_NUM2BIN 03fd OP_SWAP OP_CAT OP_TOALTSTACK OP_SIZE OP_2 OP_NUM2BIN 4d OP_SWAP OP_CAT OP_SWAP OP_CAT OP_CAT OP_CAT OP_CAT 9f00 OP_PICK OP_SIZE OP_DUP 34 OP_EQUALVERIFY OP_SWAP OP_CAT OP_CAT OP_FROMALTSTACK OP_CAT OP_FROMALTSTACK OP_DUP OP_TOALTSTACK OP_CAT OP_SIZE fd OP_SWAP OP_2 OP_1ADD OP_NUM2BIN OP_SIZE OP_1SUB OP_SPLIT OP_DROP OP_CAT OP_SWAP OP_CAT OP_CAT 9d00 OP_PICK OP_CAT OP_ENDIF 9c00 OP_PICK OP_CAT 9b00 OP_PICK OP_SIZE OP_SWAP OP_CAT OP_CAT 9a00 OP_PICK OP_CAT 8e00 OP_PICK OP_0NOTEQUAL OP_DUP OP_IF OP_4 OP_ELSE OP_3 OP_ENDIF OP_2 OP_ROLL OP_SWAP OP_CAT 21 OP_PICK OP_CAT OP_3 OP_PICK OP_CAT 9a00 OP_PICK 10 OP_SWAP OP_CAT OP_CAT 9900 OP_PICK 10 OP_SWAP OP_CAT OP_CAT 9800 OP_PICK 14 OP_SWAP OP_CAT OP_CAT 9700 OP_PICK 14 OP_SWAP OP_CAT OP_CAT 9600 OP_PICK 14 OP_SWAP OP_CAT OP_CAT 9500 OP_PICK 24 OP_SWAP OP_CAT OP_CAT 9400 OP_PICK 01 OP_SWAP OP_CAT OP_CAT 9300 OP_PICK OP_1 OP_SWAP OP_SIZE OP_ROT OP_EQUAL OP_IF OP_SIZE OP_SWAP OP_CAT OP_ELSE OP_DROP 00 OP_ENDIF OP_CAT 9200 OP_PICK 24 OP_SWAP OP_CAT OP_CAT 9100 OP_PICK 24 OP_SWAP OP_CAT OP_CAT 12 OP_PICK OP_CAT 11 OP_PICK OP_CAT 21 OP_PICK OP_CAT OP_15 OP_PICK OP_CAT 9000 OP_PICK OP_CAT 88ac OP_CAT OP_SWAP OP_IF 20 OP_PICK OP_CAT OP_14 OP_PICK OP_CAT 8e00 OP_PICK OP_CAT 88ac OP_CAT OP_ENDIF 8d00 OP_PICK OP_CAT 8c00 OP_PICK 19 OP_SWAP OP_CAT OP_CAT 8b00 OP_PICK OP_CAT OP_HASH256 OP_DUP 27 OP_PICK 20 OP_SPLIT OP_DROP OP_EQUALVERIFY 30 OP_PICK OP_BIN2NUM 9a00 OP_PICK OP_BIN2NUM 9a00 OP_PICK OP_BIN2NUM 9600 OP_PICK OP_DUP 25 OP_EQUAL OP_IF 43 OP_PICK OP_BIN2NUM OP_1 OP_EQUALVERIFY OP_DROP OP_ADD OP_EQUALVERIFY OP_ELSE OP_DUP 23 OP_EQUAL OP_IF OP_DROP 42 OP_PICK OP_BIN2NUM OP_1 OP_EQUAL OP_IF OP_SUB OP_EQUALVERIFY OP_ELSE 42 OP_PICK OP_BIN2NUM OP_2 OP_EQUALVERIFY OP_NIP OP_EQUAL OP_VERIFY OP_ENDIF OP_ELSE 43 OP_PICK OP_BIN2NUM OP_1 OP_EQUALVERIFY OP_DROP OP_DROP OP_EQUALVERIFY OP_ENDIF OP_ENDIF 3f OP_PICK OP_CAT OP_4 OP_PICK OP_IF 8a00 OP_PICK OP_SIZE OP_4 OP_EQUALVERIFY 6e OP_PICK OP_0NOTEQUAL OP_DUP OP_IF OP_3 OP_ELSE OP_2 OP_ENDIF OP_2 OP_ROLL OP_SWAP OP_CAT 8b00 OP_PICK OP_CAT OP_FROMALTSTACK OP_FROMALTSTACK OP_DUP OP_TOALTSTACK OP_SWAP OP_TOALTSTACK 8b00 OP_PICK OP_4 OP_SWAP OP_SIZE OP_ROT OP_EQUAL OP_IF OP_SIZE OP_SWAP OP_CAT OP_ELSE OP_DROP 00 OP_ENDIF OP_CAT 8a00 OP_PICK OP_4 OP_SWAP OP_SIZE OP_ROT OP_EQUAL OP_IF OP_SIZE OP_SWAP OP_CAT OP_ELSE OP_DROP 00 OP_ENDIF OP_CAT 8900 OP_PICK 14 OP_SWAP OP_SIZE OP_ROT OP_EQUAL OP_IF OP_SIZE OP_SWAP OP_CAT OP_ELSE OP_DROP 00 OP_ENDIF OP_CAT 8800 OP_PICK 24 OP_SWAP OP_SIZE OP_ROT OP_EQUAL OP_IF OP_SIZE OP_SWAP OP_CAT OP_ELSE OP_DROP 00 OP_ENDIF OP_CAT 8700 OP_PICK 24 OP_SWAP OP_SIZE OP_ROT OP_EQUAL OP_IF OP_SIZE OP_SWAP OP_CAT OP_ELSE OP_DROP 00 OP_ENDIF OP_CAT 8600 OP_PICK 24 OP_SWAP OP_CAT OP_CAT 8500 OP_PICK 22 OP_SWAP OP_CAT OP_CAT 8400 OP_PICK 14 OP_SWAP OP_SIZE OP_ROT OP_EQUAL OP_IF OP_SIZE OP_SWAP OP_CAT OP_ELSE OP_DROP 00 OP_ENDIF OP_CAT 8300 OP_PICK 14 OP_SWAP OP_SIZE OP_ROT OP_EQUAL OP_IF OP_SIZE OP_SWAP OP_CAT OP_ELSE OP_DROP 00 OP_ENDIF OP_CAT 8200 OP_PICK OP_16 OP_SWAP OP_SIZE OP_ROT OP_EQUAL OP_IF OP_SIZE OP_SWAP OP_CAT OP_ELSE OP_DROP 00 OP_ENDIF OP_CAT 8100 OP_PICK OP_1 OP_SWAP OP_SIZE OP_ROT OP_EQUAL OP_IF OP_SIZE OP_SWAP OP_CAT OP_ELSE OP_DROP 00 OP_ENDIF OP_CAT 8000 OP_PICK OP_1 OP_SWAP OP_SIZE OP_ROT OP_EQUAL OP_IF OP_SIZE OP_SWAP OP_CAT OP_ELSE OP_DROP 00 OP_ENDIF OP_CAT 7f OP_PICK OP_SIZE OP_DUP 4b OP_LESSTHANOREQUAL OP_VERIFY OP_SWAP OP_CAT OP_CAT 7e OP_PICK 21 OP_SWAP OP_SIZE OP_ROT OP_EQUAL OP_IF OP_SIZE OP_SWAP OP_CAT OP_ELSE OP_DROP 00 OP_ENDIF OP_CAT 7d OP_PICK OP_SIZE OP_DUP 68 OP_EQUALVERIFY 4c OP_SWAP OP_1 OP_1ADD OP_NUM2BIN OP_SIZE OP_1SUB OP_SPLIT OP_DROP OP_CAT OP_SWAP OP_CAT 7d OP_PICK 10 OP_SWAP OP_CAT 7d OP_PICK 10 OP_SWAP OP_CAT OP_CAT 7c OP_PICK 14 OP_SWAP OP_CAT OP_CAT 7b OP_PICK 14 OP_SWAP OP_CAT OP_CAT 7a OP_PICK 14 OP_SWAP OP_CAT OP_CAT 79 OP_PICK 24 OP_SWAP OP_CAT OP_CAT 78 OP_PICK 01 OP_SWAP OP_CAT OP_CAT 77 OP_PICK OP_1 OP_SWAP OP_SIZE OP_ROT OP_EQUAL OP_IF OP_SIZE OP_SWAP OP_CAT OP_ELSE OP_DROP 00 OP_ENDIF OP_CAT 76 OP_PICK 24 OP_SWAP OP_CAT OP_CAT 75 OP_PICK 24 OP_SWAP OP_CAT OP_CAT 16 OP_PICK OP_CAT 15 OP_PICK OP_CAT OP_DUP OP_SIZE OP_2 OP_ADD OP_2 OP_NUM2BIN 03fd OP_SWAP OP_CAT OP_NIP 02ad68 OP_CAT OP_SWAP OP_SIZE OP_2 OP_NUM2BIN 03fd OP_SWAP OP_CAT OP_TOALTSTACK OP_SIZE OP_2 OP_NUM2BIN 4d OP_SWAP OP_CAT OP_SWAP OP_CAT OP_CAT OP_CAT OP_CAT 72 OP_PICK OP_SIZE OP_DUP 34 OP_EQUALVERIFY OP_SWAP OP_CAT OP_CAT OP_FROMALTSTACK OP_CAT OP_FROMALTSTACK OP_DUP OP_TOALTSTACK OP_CAT OP_SIZE fd OP_SWAP OP_2 OP_1ADD OP_NUM2BIN OP_SIZE OP_1SUB OP_SPLIT OP_DROP OP_CAT OP_SWAP OP_CAT OP_CAT 70 OP_PICK OP_CAT OP_SWAP OP_IF 6e OP_PICK OP_CAT OP_FROMALTSTACK OP_FROMALTSTACK OP_DUP OP_TOALTSTACK OP_SWAP OP_TOALTSTACK 6e OP_PICK OP_4 OP_SWAP OP_SIZE OP_ROT OP_EQUAL OP_IF OP_SIZE OP_SWAP OP_CAT OP_ELSE OP_DROP 00 OP_ENDIF OP_CAT 6d OP_PICK OP_4 OP_SWAP OP_SIZE OP_ROT OP_EQUAL OP_IF OP_SIZE OP_SWAP OP_CAT OP_ELSE OP_DROP 00 OP_ENDIF OP_CAT 6c OP_PICK 14 OP_SWAP OP_SIZE OP_ROT OP_EQUAL OP_IF OP_SIZE OP_SWAP OP_CAT OP_ELSE OP_DROP 00 OP_ENDIF OP_CAT 6b OP_PICK 24 OP_SWAP OP_SIZE OP_ROT OP_EQUAL OP_IF OP_SIZE OP_SWAP OP_CAT OP_ELSE OP_DROP 00 OP_ENDIF OP_CAT 6a OP_PICK 24 OP_SWAP OP_SIZE OP_ROT OP_EQUAL OP_IF OP_SIZE OP_SWAP OP_CAT OP_ELSE OP_DROP 00 OP_ENDIF OP_CAT 69 OP_PICK 24 OP_SWAP OP_CAT OP_CAT 68 OP_PICK 22 OP_SWAP OP_CAT OP_CAT 67 OP_PICK 14 OP_SWAP OP_SIZE OP_ROT OP_EQUAL OP_IF OP_SIZE OP_SWAP OP_CAT OP_ELSE OP_DROP 00 OP_ENDIF OP_CAT 66 OP_PICK 14 OP_SWAP OP_SIZE OP_ROT OP_EQUAL OP_IF OP_SIZE OP_SWAP OP_CAT OP_ELSE OP_DROP 00 OP_ENDIF OP_CAT 65 OP_PICK OP_16 OP_SWAP OP_SIZE OP_ROT OP_EQUAL OP_IF OP_SIZE OP_SWAP OP_CAT OP_ELSE OP_DROP 00 OP_ENDIF OP_CAT 64 OP_PICK OP_1 OP_SWAP OP_SIZE OP_ROT OP_EQUAL OP_IF OP_SIZE OP_SWAP OP_CAT OP_ELSE OP_DROP 00 OP_ENDIF OP_CAT 63 OP_PICK OP_1 OP_SWAP OP_SIZE OP_ROT OP_EQUAL OP_IF OP_SIZE OP_SWAP OP_CAT OP_ELSE OP_DROP 00 OP_ENDIF OP_CAT 62 OP_PICK OP_SIZE OP_DUP 4b OP_LESSTHANOREQUAL OP_VERIFY OP_SWAP OP_CAT OP_CAT 61 OP_PICK 21 OP_SWAP OP_SIZE OP_ROT OP_EQUAL OP_IF OP_SIZE OP_SWAP OP_CAT OP_ELSE OP_DROP 00 OP_ENDIF OP_CAT 60 OP_PICK OP_SIZE OP_DUP 68 OP_EQUALVERIFY 4c OP_SWAP OP_1 OP_1ADD OP_NUM2BIN OP_SIZE OP_1SUB OP_SPLIT OP_DROP OP_CAT OP_SWAP OP_CAT 60 OP_PICK 10 OP_SWAP OP_CAT 60 OP_PICK 10 OP_SWAP OP_CAT OP_CAT 5f OP_PICK 14 OP_SWAP OP_CAT OP_CAT 5e OP_PICK 14 OP_SWAP OP_CAT OP_CAT 5d OP_PICK 14 OP_SWAP OP_CAT OP_CAT 5c OP_PICK 24 OP_SWAP OP_CAT OP_CAT 5b OP_PICK 01 OP_SWAP OP_CAT OP_CAT 5a OP_PICK OP_1 OP_SWAP OP_SIZE OP_ROT OP_EQUAL OP_IF OP_SIZE OP_SWAP OP_CAT OP_ELSE OP_DROP 00 OP_ENDIF OP_CAT 59 OP_PICK 24 OP_SWAP OP_CAT OP_CAT 58 OP_PICK 24 OP_SWAP OP_CAT OP_CAT 15 OP_PICK OP_CAT 14 OP_PICK OP_CAT OP_DUP OP_SIZE OP_2 OP_ADD OP_2 OP_NUM2BIN 03fd OP_SWAP OP_CAT OP_NIP 02ad68 OP_CAT OP_SWAP OP_SIZE OP_2 OP_NUM2BIN 03fd OP_SWAP OP_CAT OP_TOALTSTACK OP_SIZE OP_2 OP_NUM2BIN 4d OP_SWAP OP_CAT OP_SWAP OP_CAT OP_CAT OP_CAT OP_CAT 55 OP_PICK OP_SIZE OP_DUP 34 OP_EQUALVERIFY OP_SWAP OP_CAT OP_CAT OP_FROMALTSTACK OP_CAT OP_FROMALTSTACK OP_DUP OP_TOALTSTACK OP_CAT OP_SIZE fd OP_SWAP OP_2 OP_1ADD OP_NUM2BIN OP_SIZE OP_1SUB OP_SPLIT OP_DROP OP_CAT OP_SWAP OP_CAT OP_CAT 53 OP_PICK OP_CAT OP_ENDIF 52 OP_PICK OP_CAT 51 OP_PICK OP_SIZE OP_SWAP OP_CAT OP_CAT 50 OP_PICK OP_CAT 44 OP_PICK OP_0NOTEQUAL OP_DUP OP_IF OP_4 OP_ELSE OP_3 OP_ENDIF OP_2 OP_ROLL OP_SWAP OP_CAT 22 OP_PICK OP_CAT OP_4 OP_PICK OP_CAT 50 OP_PICK 10 OP_SWAP OP_CAT OP_CAT 4f OP_PICK 10 OP_SWAP OP_CAT OP_CAT 4e OP_PICK 14 OP_SWAP OP_CAT OP_CAT 4d OP_PICK 14 OP_SWAP OP_CAT OP_CAT 4c OP_PICK 14 OP_SWAP OP_CAT OP_CAT 4b OP_PICK 24 OP_SWAP OP_CAT OP_CAT 4a OP_PICK 01 OP_SWAP OP_CAT OP_CAT 49 OP_PICK OP_1 OP_SWAP OP_SIZE OP_ROT OP_EQUAL OP_IF OP_SIZE OP_SWAP OP_CAT OP_ELSE OP_DROP 00 OP_ENDIF OP_CAT 48 OP_PICK 24 OP_SWAP OP_CAT OP_CAT 47 OP_PICK 24 OP_SWAP OP_CAT OP_CAT 13 OP_PICK OP_CAT 12 OP_PICK OP_CAT 22 OP_PICK OP_CAT OP_16 OP_PICK OP_CAT 46 OP_PICK OP_CAT 88ac OP_CAT OP_SWAP OP_IF 21 OP_PICK OP_CAT OP_15 OP_PICK OP_CAT 44 OP_PICK OP_CAT 88ac OP_CAT OP_ENDIF 43 OP_PICK OP_CAT 42 OP_PICK 19 OP_SWAP OP_CAT OP_CAT 41 OP_PICK OP_CAT OP_HASH256 OP_DUP 2d OP_PICK 20 OP_SPLIT OP_DROP OP_EQUALVERIFY 30 OP_PICK OP_BIN2NUM 50 OP_PICK OP_BIN2NUM 50 OP_PICK OP_BIN2NUM 4c OP_PICK OP_DUP 25 OP_EQUAL OP_IF 43 OP_PICK OP_BIN2NUM OP_1 OP_EQUALVERIFY OP_DROP OP_ADD OP_EQUALVERIFY OP_ELSE OP_DUP 23 OP_EQUAL OP_IF OP_DROP 42 OP_PICK OP_BIN2NUM OP_1 OP_EQUAL OP_IF OP_SUB OP_EQUALVERIFY OP_ELSE 42 OP_PICK OP_BIN2NUM OP_2 OP_EQUALVERIFY OP_NIP OP_EQUAL OP_VERIFY OP_ENDIF OP_ELSE 43 OP_PICK OP_BIN2NUM OP_1 OP_EQUALVERIFY OP_DROP OP_DROP OP_EQUALVERIFY OP_ENDIF OP_ENDIF 3f OP_PICK OP_CAT 2a OP_PICK OP_BIN2NUM OP_IF OP_SWAP OP_ENDIF OP_CAT OP_ENDIF OP_CAT OP_ELSE d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK d400 OP_PICK OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_SIZE OP_NIP OP_0 OP_EQUALVERIFY OP_ENDIF 39 OP_PICK OP_CAT OP_HASH256 22 OP_PICK OP_EQUALVERIFY 31 OP_PICK OP_DUP OP_SIZE OP_1SUB OP_SPLIT OP_NIP 41 OP_EQUALVERIFY 31 OP_PICK OP_DUP OP_HASH160 2f OP_ELSE OP_14 OP_PICK OP_DUP OP_SIZE OP_1SUB OP_SPLIT OP_NIP 41 OP_EQUALVERIFY OP_14 OP_PICK OP_DUP OP_HASH160 OP_12 OP_ENDIF OP_PICK OP_EQUALVERIFY OP_CHECKSIG";
16
18
  this.UNLOCK_SCRIPT_SUFFIX = "OP_5 OP_PICK OP_5 OP_ROLL OP_5 OP_ROLL OP_5 OP_PICK OP_5 OP_PICK OP_CAT OP_CAT OP_CAT OP_CAT OP_4 OP_ROLL OP_2 OP_ROLL OP_4 OP_ROLL OP_4 OP_ROLL OP_CAT OP_CAT OP_CAT OP_SWAP OP_IFDUP OP_IF 41 OP_TOALTSTACK OP_HASH256 OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT 00 OP_CAT OP_BIN2NUM OP_1 OP_ADD OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SIZE OP_SWAP OP_CAT 022079be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f8179802 OP_SWAP OP_CAT OP_SIZE OP_SWAP OP_CAT 30 OP_SWAP OP_CAT OP_FROMALTSTACK OP_CAT 038ff83d8cf12121491609c4939dc11c4aa35503508fe432dc5a5c1905608b9218 OP_CODESEPARATOR OP_CHECKSIGVERIFY OP_ENDIF";
17
19
  }
18
20
  extractInputInfo(tx, inputIndex, providedSatoshis, providedLockingScript) {
@@ -35,8 +37,13 @@ export default class SimpleMultiTemplate {
35
37
  const changeOutput = forceNoChange ? [] : buildChangeOutput(tx, tx.outputs.length - 1);
36
38
  return { fundOutpoint, changeOutput };
37
39
  }
40
+ /** Pushes that LEAD the 11 SimpleMultiBolt fields: none here; the genesis family adds genesis/LMG + mintData. */
41
+ leadingPushes(_prevTxs, _prevVoutIdx, _txoType) {
42
+ return [];
43
+ }
38
44
  // 11 locking data args: balance, balanceCommit, pubKeyHash, pubKeyHashCommit, pubKeyHashCommit2,
39
45
  // otherGrandparentOutpoint, txoType, outputIndexN, parentOutpoint, grandparentOutpoint, issuerPubKey
46
+ // (after this.layout.leading leading pushes).
40
47
  lock(toPubKey, prevTxs, balance = new Array(16).fill(0x00), balanceCommit = new Array(16).fill(0x00), pubKeyHashCommit = new Array(20).fill(0x00), pubKeyHashCommit2 = new Array(20).fill(0x00), otherGrandparentOutpoint = new Array(36).fill(0x00), txoType = [0x20], outputIndexN = [0x00], prevVoutIdx = 0) {
41
48
  const isGenesis = prevTxs.length === 0;
42
49
  const prevTx = prevTxs.slice(-1)[0];
@@ -47,11 +54,13 @@ export default class SimpleMultiTemplate {
47
54
  writer.write(Utils.toArray(prevTx?.hash() || new Array(32).fill(0x00), "hex"));
48
55
  writer.writeUInt32LE(prevVoutIdx);
49
56
  const parentOutpoint = writer.toArray();
50
- // grandparentOutpoint = prev token's parentOutpoint (SMB lock chunk idx 8)
51
- const grandparentOutpoint = prevTokenOutputChunks?.[8].data || new Array(36).fill(0x00);
52
- // issuerPubKey: toPubKey for genesis, else prev token's issuerPubKey (SMB lock chunk idx 10)
53
- const issuerPubKey = isGenesis ? toPubKey : prevTokenOutputChunks?.[10].data;
57
+ // grandparentOutpoint = prev token's parentOutpoint (SMB lock chunk idx 8, + leading pushes)
58
+ const L = this.layout.leading;
59
+ const grandparentOutpoint = prevTokenOutputChunks?.[8 + L].data || new Array(36).fill(0x00);
60
+ // issuerPubKey: toPubKey for genesis, else prev token's issuerPubKey (SMB lock chunk idx 10, + leading pushes)
61
+ const issuerPubKey = isGenesis ? toPubKey : prevTokenOutputChunks?.[10 + L].data;
54
62
  const lockingScript = new LockingScript([
63
+ ...this.leadingPushes(prevTxs, prevVoutIdx, txoType).flatMap((d) => scriptChunksFromBin(d)),
55
64
  ...new Script().writeBin(balance).chunks,
56
65
  ...new Script().writeBin(balanceCommit).chunks,
57
66
  ...new Script().writeBin(pubKeyHash).chunks,
@@ -67,7 +76,7 @@ export default class SimpleMultiTemplate {
67
76
  ]);
68
77
  return lockingScript;
69
78
  }
70
- /** The static contract suffix (everything after the 11 data pushes), as a Script. */
79
+ /** The static contract suffix (everything after the data pushes), as a Script. */
71
80
  staticSuffix() {
72
81
  return Script.fromASM(this.LOCK_SCRIPT_SUFFIX);
73
82
  }
@@ -93,7 +102,7 @@ export default class SimpleMultiTemplate {
93
102
  });
94
103
  const { ctxHeader, ctxCodeLen, ctxCodeUnlockScriptCode, ctxCodeLockScriptCode, ctxFooter, ctxCodeLockLen } = splitCtx(ctx, 2);
95
104
  const ctxForSig = ctxHeader.concat(...[ctxCodeLockLen, ctxCodeLockScriptCode, ctxFooter]);
96
- const { sigForScript, pubkeyForScript } = createSignature(privateKey, ctxForSig, this.signatureScope);
105
+ const { sigForScript, pubkeyForScript } = await createSignature(privateKey, ctxForSig, this.signatureScope);
97
106
  // pubKeyHash1: empty when toPubKey is empty (split settle derives recipients from
98
107
  // the committed pubKeyHashCommit/Commit2, so pubKeyHash1 must be empty).
99
108
  const toPubKeyHash = (toPubKey && toPubKey.length) ? Hash.hash160(toPubKey) : [];
@@ -103,19 +112,19 @@ export default class SimpleMultiTemplate {
103
112
  const ancestorIdx = txIdx - 3;
104
113
  const hasAncestor = ancestorIdx >= 1 && txIdx >= 4 && txIdx % 2 === 0;
105
114
  const ancestorTx = hasAncestor ? Transaction.fromHex(prevTxs[ancestorIdx].toHex()) : null;
106
- // ancestorTxA pieces (89)
115
+ // ancestorTxA pieces (SMB 75, FixedBolt 77, OpenBolt 80)
107
116
  const ancestorAChunks = [];
108
- for (const piece of PIECE_NAMES) {
109
- ancestorAChunks.push(...scriptChunksFromBin(ancestorTx ? ancestorPiece(piece, ancestorTx) : []));
117
+ for (const piece of this.layout.pieces) {
118
+ ancestorAChunks.push(...scriptChunksFromBin(ancestorTx ? ancestorPiece(piece, ancestorTx, this.layout) : []));
110
119
  }
111
- // ancestorTxB pieces (89) - populated for merge settles, empty otherwise
120
+ // ancestorTxB pieces - populated for merge settles, empty otherwise
112
121
  const ancestorBTx = ancestorTxBRef ? Transaction.fromHex(ancestorTxBRef.toHex()) : null;
113
122
  const ancestorBChunks = [];
114
- for (const piece of PIECE_NAMES) {
115
- ancestorBChunks.push(...scriptChunksFromBin(ancestorBTx ? ancestorPiece(piece, ancestorBTx) : []));
123
+ for (const piece of this.layout.pieces) {
124
+ ancestorBChunks.push(...scriptChunksFromBin(ancestorBTx ? ancestorPiece(piece, ancestorBTx, this.layout) : []));
116
125
  }
117
126
  const unlockingScript = new UnlockingScript([
118
- // ancestorTxA (89), ancestorTxB (89) - no leading miscData in SimpleMultiBolt
127
+ // ancestorTxA (75), ancestorTxB (75) - no leading miscData in SimpleMultiBolt
119
128
  ...ancestorAChunks,
120
129
  ...ancestorBChunks,
121
130
  // 5 interop args (empty for transfer/split; set for merge)
@@ -171,11 +180,11 @@ export default class SimpleMultiTemplate {
171
180
  lockTime: tx.lockTime,
172
181
  scope: this.signatureScope,
173
182
  });
174
- const { sigForScript, pubkeyForScript } = createSignature(privateKey, preimage, this.signatureScope);
183
+ const { sigForScript, pubkeyForScript } = await createSignature(privateKey, preimage, this.signatureScope);
175
184
  const { fundOutpoint, changeOutput } = this.buildFundAndChangeOutputs(tx);
176
185
  const unlockingScript = new UnlockingScript([
177
- // 178 empty ancestor chunks (89 A + 89 B, no miscData)
178
- ...createEmptyFungibleAncestorChunksSMB(),
186
+ // 2 x pieces empty ancestor chunks (SMB 150, no miscData)
187
+ ...createEmptyFungibleAncestorChunksSMB(this.layout),
179
188
  // 5 empty interop args
180
189
  ...scriptChunksFromBin([]), // grandparentBoltVoutIdx
181
190
  ...scriptChunksFromBin([]), // interopBoltVoutIdx
@@ -1,7 +1,8 @@
1
1
  import { ScriptTemplate, LockingScript, Script, PrivateKey, UnlockingScript, Transaction } from '@bsv/sdk';
2
+ import { type Signer } from '../../lib/boltLib.js';
2
3
  export default class Pay2ProofTemplate implements ScriptTemplate {
3
4
  lock(pubKeyHash: number[]): LockingScript;
4
- unlock(privKey: PrivateKey, sourceSatoshis?: number, lockingScript?: Script): {
5
+ unlock(privKey: PrivateKey | Signer, sourceSatoshis?: number, lockingScript?: Script): {
5
6
  sign: (tx: Transaction, inputIndex: number) => Promise<UnlockingScript>;
6
7
  estimateLength: () => Promise<111>;
7
8
  };
@@ -43,7 +43,7 @@ export default class Pay2ProofTemplate {
43
43
  lockTime: tx.lockTime,
44
44
  scope: signatureScope
45
45
  });
46
- const { sigForScript, pubkeyForScript } = createSignature(privKey, preimage, signatureScope);
46
+ const { sigForScript, pubkeyForScript } = await createSignature(privKey, preimage, signatureScope);
47
47
  return new UnlockingScript([
48
48
  { op: sigForScript.length, data: sigForScript },
49
49
  { op: pubkeyForScript.length, data: pubkeyForScript },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "b017",
3
- "version": "0.0.0-b",
3
+ "version": "0.1.0",
4
4
  "description": "b017 — BOLT layer-1 token templates + off-chain scanner (mint/transfer/split/merge/melt). Pre-compiled contract; no sx compiler required at runtime.",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "keywords": [
@@ -40,16 +40,21 @@
40
40
  "scripts": {
41
41
  "clean": "node -e \"require('fs').rmSync('dist',{recursive:true,force:true})\"",
42
42
  "build": "npm run clean && tsc -p tsconfig.json",
43
- "build:contract": "node scripts/build-contract.mjs",
43
+ "build:contract": "node scripts/build-simple-multi.mjs",
44
+ "build:nft": "node scripts/build-min-simple-bolt.mjs",
44
45
  "test": "vitest run",
45
46
  "test:coverage": "vitest run --coverage",
47
+ "coverage:run": "vitest run --coverage --reporter=default --reporter=json --outputFile.json=coverage/test-results.json",
48
+ "coverage:gaps": "npm run coverage:run && node scripts/coverage-gaps.mjs",
49
+ "coverage:readme": "npm run coverage:run && node scripts/coverage-readme.mjs",
50
+ "coverage:check": "npm run coverage:run && node scripts/coverage-readme.mjs --check",
46
51
  "prepublishOnly": "npm run build"
47
52
  },
48
53
  "peerDependencies": {
49
54
  "@bsv/sdk": "^2.1.6"
50
55
  },
51
56
  "devDependencies": {
52
- "@bsv/sdk": "^2.1.6",
57
+ "@bsv/sdk": "^2.8.11",
53
58
  "@types/node": "^22.10.2",
54
59
  "@vitest/coverage-v8": "^2.1.9",
55
60
  "typescript": "^5.7.2",
@@ -1,24 +0,0 @@
1
- import { ScriptTemplate, LockingScript, Script, PrivateKey, Transaction, UnlockingScript } from "@bsv/sdk";
2
- export default class MinSimpleBalanceTemplate implements ScriptTemplate {
3
- private readonly UNLOCK_SCRIPT_SUFFIX;
4
- private readonly LOCK_SCRIPT_SUFFIX;
5
- /**
6
- * Build a MinSimpleBalanceBolt locking script from its 7 contract args.
7
- * Genesis mint: balance = 16-byte LE, pubKeyHash = recipient, issuerPubKey = issuer,
8
- * pubKeyHashCommitment = zeros[20], txoType = [0x00], parent/grandparent = zeros[36].
9
- */
10
- lock(balance: number[], pubKeyHash: number[], issuerPubKey: number[], pubKeyHashCommitment?: number[], txoType?: number[], parentOutpoint?: number[], grandparentOutpoint?: number[]): LockingScript;
11
- /** The static contract suffix (everything after the 7 data pushes), as a Script. */
12
- staticSuffix(): Script;
13
- /**
14
- * Spend (transfer commit/settle) this balance bolt. The balance is immutable and carried by the
15
- * lock; the 37-arg unlock layout is contract-agnostic, so it delegates to singleSpendUnlock.
16
- * Requires tx version >= 2.
17
- * @param beneficiaryPubKeyHash the next owner's 20-byte pkh
18
- * @param prevTxs prior lineage txs (mint, commit, ...); a back-reaching settle (>=4 txs) is B2b-2
19
- */
20
- unlock(privateKey: PrivateKey, beneficiaryPubKeyHash: number[], prevTxs?: Transaction[], forceNoChange?: boolean, forceNoFund?: boolean): {
21
- sign: (tx: Transaction, inputIndex: number) => Promise<UnlockingScript>;
22
- estimateLength: () => Promise<number>;
23
- };
24
- }
@@ -1,59 +0,0 @@
1
- // MinSimpleBalance.sx.template.ts
2
- // Runtime LOCK assembler for the MinSimpleBalanceBolt NFT (immutable 16-byte balance).
3
- // LOCK_SCRIPT_SUFFIX is auto-patched from the pre-compiled artifact by
4
- // scripts/build-min-simple-balance-bolt.mjs (build-time only) — do NOT hand-edit it.
5
- //
6
- // Lock layout (7 dynamic data args, balance FIRST):
7
- // balance[16] · pubKeyHash[20] · pubKeyHashCommitment[20] · txoType[1] · parentOutpoint[36] ·
8
- // grandparentOutpoint[36] · issuerPubKey[33] + LOCK_SCRIPT_SUFFIX
9
- //
10
- // The spend/unlock path (transfer commit/settle, 37 args) is provided via singleSpendUnlock.
11
- import { LockingScript, Script } from "@bsv/sdk";
12
- import { singleSpendUnlock } from "../../lib/single/singleSpend.js";
13
- export default class MinSimpleBalanceTemplate {
14
- constructor() {
15
- // Static UNLOCK suffix (after the 37 data pushes), patched from the artifact by
16
- // scripts/build-min-simple-balance-bolt.mjs — do NOT hand-edit.
17
- this.UNLOCK_SCRIPT_SUFFIX = "OP_5 OP_PICK OP_5 OP_ROLL OP_5 OP_ROLL OP_5 OP_PICK OP_5 OP_PICK OP_CAT OP_CAT OP_CAT OP_CAT OP_4 OP_ROLL OP_2 OP_ROLL OP_4 OP_ROLL OP_4 OP_ROLL OP_CAT OP_CAT OP_CAT OP_SWAP OP_IFDUP OP_IF 41 OP_TOALTSTACK OP_HASH256 OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT 00 OP_CAT OP_BIN2NUM OP_1 OP_ADD OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SIZE OP_SWAP OP_CAT 022079be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f8179802 OP_SWAP OP_CAT OP_SIZE OP_SWAP OP_CAT 30 OP_SWAP OP_CAT OP_FROMALTSTACK OP_CAT 038ff83d8cf12121491609c4939dc11c4aa35503508fe432dc5a5c1905608b9218 OP_CODESEPARATOR OP_CHECKSIGVERIFY OP_ENDIF";
18
- this.LOCK_SCRIPT_SUFFIX = "OP_2 OP_PICK OP_BIN2NUM OP_NOT OP_SWAP OP_2SWAP OP_DUP OP_BIN2NUM OP_0NOTEQUAL OP_DUP OP_NOT OP_6 OP_PICK OP_BIN2NUM OP_BOOLAND OP_5 OP_PICK OP_BOOLOR OP_IF OP_3 OP_PICK OP_11 OP_PICK OP_EQUALVERIFY OP_ENDIF OP_9 OP_PICK OP_IFDUP OP_IF OP_DUP 41 OP_TOALTSTACK OP_HASH256 OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT 00 OP_CAT OP_BIN2NUM OP_1 OP_ADD OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SIZE OP_SWAP OP_CAT 022079be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f8179802 OP_SWAP OP_CAT OP_SIZE OP_SWAP OP_CAT 30 OP_SWAP OP_CAT OP_FROMALTSTACK OP_CAT 038ff83d8cf12121491609c4939dc11c4aa35503508fe432dc5a5c1905608b9218 OP_CHECKSIGVERIFY OP_4 OP_SPLIT 20 OP_SPLIT 20 OP_SPLIT 24 OP_SPLIT OP_1 OP_SPLIT OP_NIP OP_2 OP_SPLIT OP_SWAP OP_BIN2NUM OP_SPLIT OP_8 OP_SPLIT OP_4 OP_SPLIT 20 OP_SPLIT OP_4 OP_SPLIT OP_1 OP_SPLIT OP_SWAP 41 OP_EQUALVERIFY OP_9 OP_PICK OP_2 OP_GREATERTHANOREQUAL OP_VERIFY OP_5 OP_ROLL 11 OP_SPLIT 15 OP_SPLIT 15 OP_SPLIT OP_2 OP_SPLIT 25 OP_SPLIT 25 OP_SPLIT 22 OP_SPLIT OP_DUP OP_TOALTSTACK OP_12 OP_PICK OP_DUP OP_BIN2NUM OP_1 OP_EQUALVERIFY 17 OP_PICK OP_NOTIF 1d02b0178876a914 OP_CAT 1e OP_PICK OP_CAT 88ac OP_CAT OP_ENDIF 14 18 OP_PICK OP_NOTIF 1a OP_ELSE 19 OP_ENDIF OP_PICK OP_CAT 14 19 OP_PICK OP_NOTIF 20 OP_PICK OP_ELSE OP_0 14 OP_NUM2BIN OP_ENDIF OP_CAT OP_CAT 18 OP_PICK OP_IF 0100 OP_ELSE 0121 OP_ENDIF OP_CAT 24 OP_16 OP_PICK OP_CAT OP_CAT OP_5 OP_PICK OP_CAT 17 OP_PICK OP_IF 21 1e OP_PICK OP_CAT OP_ELSE OP_3 OP_PICK OP_ENDIF OP_CAT OP_9 OP_PICK OP_SWAP OP_CAT OP_2 OP_PICK OP_CAT fd1005 OP_DUP OP_TOALTSTACK OP_15 OP_PICK OP_SWAP OP_CAT OP_SWAP OP_CAT 18 OP_PICK OP_NOTIF OP_SWAP OP_CAT OP_ELSE OP_NIP OP_ENDIF 1f OP_PICK OP_CAT OP_HASH256 OP_11 OP_PICK OP_EQUALVERIFY OP_13 OP_PICK 17 OP_PICK OP_BIN2NUM 13 OP_PICK OP_BOOLAND OP_IF 3a OP_PICK 2c OP_PICK OP_DROP OP_2 OP_CAT 3a OP_PICK OP_CAT OP_0 1a OP_NUM2BIN 3a OP_PICK 24 OP_SWAP OP_CAT OP_CAT 39 OP_PICK 22 OP_SWAP OP_CAT OP_CAT 38 OP_PICK 14 OP_SWAP OP_CAT OP_CAT 37 OP_PICK OP_SIZE OP_SWAP OP_CAT OP_CAT 36 OP_PICK 21 OP_SWAP OP_CAT OP_CAT 35 OP_PICK 4c68 OP_SWAP OP_CAT 35 OP_PICK 14 OP_SWAP OP_CAT 35 OP_PICK 14 OP_SWAP OP_CAT OP_CAT 34 OP_PICK 01 OP_SWAP OP_CAT OP_CAT 33 OP_PICK 24 OP_SWAP OP_CAT OP_CAT 32 OP_PICK 24 OP_SWAP OP_CAT OP_CAT OP_6 OP_PICK OP_CAT OP_12 OP_PICK OP_SWAP OP_CAT OP_5 OP_PICK OP_CAT OP_DUP ad68 OP_DUP OP_ROT OP_CAT OP_DROP 03fd1205 OP_SWAP 02 OP_SWAP OP_CAT OP_CAT OP_SWAP fd1005 03 OP_SWAP OP_CAT OP_TOALTSTACK 4d1005 OP_SWAP OP_CAT OP_CAT OP_CAT OP_CAT 2f OP_PICK 34 OP_SWAP OP_CAT OP_CAT OP_FROMALTSTACK OP_CAT 5579557a557a557955797e7e7e7e547a527a547a547a7e7e7e7c73630141 OP_CAT OP_FROMALTSTACK OP_FROMALTSTACK OP_SWAP OP_TOALTSTACK 20 OP_SPLIT OP_NIP 7d01 OP_SPLIT OP_DROP OP_CAT abad68 OP_CAT OP_SIZE OP_2 OP_NUM2BIN fd OP_SWAP OP_CAT OP_SWAP OP_CAT OP_CAT 2d OP_PICK OP_CAT 2c OP_PICK OP_CAT 2b OP_PICK OP_SIZE OP_SWAP OP_CAT OP_CAT 2a OP_PICK OP_CAT OP_3 OP_CAT OP_14 OP_PICK OP_CAT OP_FROMALTSTACK OP_CAT OP_9 OP_PICK OP_CAT 29 OP_PICK 14 OP_SWAP OP_CAT OP_CAT 28 OP_PICK 14 OP_SWAP OP_CAT OP_CAT 27 OP_PICK 01 OP_SWAP OP_CAT OP_CAT 26 OP_PICK 24 OP_SWAP OP_CAT OP_CAT 25 OP_PICK 24 OP_SWAP OP_CAT OP_CAT OP_3 OP_PICK OP_CAT OP_2 OP_PICK OP_CAT OP_14 OP_PICK OP_CAT 1d02b0178876a914 OP_CAT 1a OP_PICK OP_CAT 88ac OP_CAT 24 OP_PICK OP_CAT 23 OP_PICK 19 OP_SWAP OP_CAT OP_CAT 22 OP_PICK OP_CAT OP_HASH256 OP_DUP 15 OP_PICK 20 OP_SPLIT OP_DROP OP_EQUALVERIFY 01000000 OP_CAT OP_CAT OP_ELSE 3a OP_PICK 3a OP_PICK 3a OP_PICK 3a OP_PICK 3a OP_PICK 3a OP_PICK 3a OP_PICK 3a OP_PICK 3a OP_PICK 3a OP_PICK 3a OP_PICK 3a OP_PICK 3a OP_PICK 3a OP_PICK 3a OP_PICK 3a OP_PICK 3a OP_PICK 3a OP_PICK 3a OP_PICK 3a OP_PICK 3a OP_PICK 3a OP_PICK 3a OP_PICK 3a OP_PICK 3a OP_PICK 3a OP_PICK OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_SIZE OP_NIP OP_0 OP_EQUALVERIFY OP_ENDIF 20 OP_PICK OP_CAT OP_HASH256 OP_16 OP_PICK OP_EQUALVERIFY 1c OP_PICK OP_DUP OP_SIZE OP_1SUB OP_SPLIT OP_NIP 41 OP_EQUALVERIFY 1c OP_PICK OP_DUP OP_HASH160 1b OP_ELSE OP_11 OP_PICK OP_DUP OP_SIZE OP_1SUB OP_SPLIT OP_NIP 41 OP_EQUALVERIFY OP_11 OP_PICK OP_DUP OP_HASH160 OP_10 OP_ENDIF OP_PICK OP_EQUALVERIFY OP_CHECKSIG";
19
- }
20
- /**
21
- * Build a MinSimpleBalanceBolt locking script from its 7 contract args.
22
- * Genesis mint: balance = 16-byte LE, pubKeyHash = recipient, issuerPubKey = issuer,
23
- * pubKeyHashCommitment = zeros[20], txoType = [0x00], parent/grandparent = zeros[36].
24
- */
25
- lock(balance, pubKeyHash, issuerPubKey, pubKeyHashCommitment = new Array(20).fill(0x00), txoType = [0x00], parentOutpoint = new Array(36).fill(0x00), grandparentOutpoint = new Array(36).fill(0x00)) {
26
- return new LockingScript([
27
- ...new Script().writeBin(balance).chunks,
28
- ...new Script().writeBin(pubKeyHash).chunks,
29
- ...new Script().writeBin(pubKeyHashCommitment).chunks,
30
- ...new Script().writeBin(txoType).chunks,
31
- ...new Script().writeBin(parentOutpoint).chunks,
32
- ...new Script().writeBin(grandparentOutpoint).chunks,
33
- ...new Script().writeBin(issuerPubKey).chunks,
34
- ...Script.fromASM(this.LOCK_SCRIPT_SUFFIX).chunks,
35
- ]);
36
- }
37
- /** The static contract suffix (everything after the 7 data pushes), as a Script. */
38
- staticSuffix() {
39
- return Script.fromASM(this.LOCK_SCRIPT_SUFFIX);
40
- }
41
- /**
42
- * Spend (transfer commit/settle) this balance bolt. The balance is immutable and carried by the
43
- * lock; the 37-arg unlock layout is contract-agnostic, so it delegates to singleSpendUnlock.
44
- * Requires tx version >= 2.
45
- * @param beneficiaryPubKeyHash the next owner's 20-byte pkh
46
- * @param prevTxs prior lineage txs (mint, commit, ...); a back-reaching settle (>=4 txs) is B2b-2
47
- */
48
- unlock(privateKey, beneficiaryPubKeyHash, prevTxs = [], forceNoChange = false, forceNoFund = false) {
49
- return singleSpendUnlock({
50
- privateKey,
51
- beneficiaryPubKeyHash,
52
- unlockScriptSuffixASM: this.UNLOCK_SCRIPT_SUFFIX,
53
- prevTxs,
54
- forceNoChange,
55
- forceNoFund,
56
- leadingValuePushes: 1, // balance[16] is the leading lock push
57
- });
58
- }
59
- }
@@ -1,23 +0,0 @@
1
- import { ScriptTemplate, LockingScript, Script, PrivateKey, Transaction, UnlockingScript } from "@bsv/sdk";
2
- export default class MinSimpleDiscountTemplate implements ScriptTemplate {
3
- private readonly UNLOCK_SCRIPT_SUFFIX;
4
- private readonly LOCK_SCRIPT_SUFFIX;
5
- /**
6
- * Build a MinSimpleDiscountBolt locking script from its 7 contract args.
7
- * Genesis identity mint: discount = [percent], pubKeyHash = recipient, issuerPubKey = issuer,
8
- * pubKeyHashCommitment = zeros[20], txoType = [0x00], parent/grandparent = zeros[36].
9
- */
10
- lock(discount: number[], pubKeyHash: number[], issuerPubKey: number[], pubKeyHashCommitment?: number[], txoType?: number[], parentOutpoint?: number[], grandparentOutpoint?: number[]): LockingScript;
11
- /** The static contract suffix (everything after the 7 data pushes), as a Script. */
12
- staticSuffix(): Script;
13
- /**
14
- * Spend (transfer commit/settle) this discount-bolt. The discount is immutable and carried by
15
- * the lock; the unlock layout is contract-agnostic (37 args), so it delegates to singleSpendUnlock.
16
- * @param beneficiaryPubKeyHash the next owner's 20-byte pkh (commit + settle commit-to recipient)
17
- * @param prevTxs prior lineage txs (mint, commit, ...); a back-reaching settle (>=4 txs) is B2b-2
18
- */
19
- unlock(privateKey: PrivateKey, beneficiaryPubKeyHash: number[], prevTxs?: Transaction[], forceNoChange?: boolean, forceNoFund?: boolean): {
20
- sign: (tx: Transaction, inputIndex: number) => Promise<UnlockingScript>;
21
- estimateLength: () => Promise<number>;
22
- };
23
- }
@@ -1,58 +0,0 @@
1
- // MinSimpleDiscount.sx.template.ts
2
- // Runtime LOCK assembler for the MinSimpleDiscountBolt NFT (immutable 1-byte whole-% discount).
3
- // LOCK_SCRIPT_SUFFIX is auto-patched from the pre-compiled artifact by
4
- // scripts/build-min-simple-discount-bolt.mjs (build-time only) — do NOT hand-edit it.
5
- //
6
- // Lock layout (7 dynamic data args, discount FIRST — readable before ownership/amount):
7
- // discount[1] · pubKeyHash[20] · pubKeyHashCommitment[20] · txoType[1] · parentOutpoint[36] ·
8
- // grandparentOutpoint[36] · issuerPubKey[33] + LOCK_SCRIPT_SUFFIX
9
- //
10
- // The spend/unlock path (transfer commit/settle, 37 args) is implemented via singleSpendUnlock.
11
- import { LockingScript, Script } from "@bsv/sdk";
12
- import { singleSpendUnlock } from "../../lib/single/singleSpend.js";
13
- export default class MinSimpleDiscountTemplate {
14
- constructor() {
15
- // Static UNLOCK suffix (after the 37 data pushes), patched from the artifact by
16
- // scripts/build-min-simple-discount-bolt.mjs — do NOT hand-edit.
17
- this.UNLOCK_SCRIPT_SUFFIX = "OP_5 OP_PICK OP_5 OP_ROLL OP_5 OP_ROLL OP_5 OP_PICK OP_5 OP_PICK OP_CAT OP_CAT OP_CAT OP_CAT OP_4 OP_ROLL OP_2 OP_ROLL OP_4 OP_ROLL OP_4 OP_ROLL OP_CAT OP_CAT OP_CAT OP_SWAP OP_IFDUP OP_IF 41 OP_TOALTSTACK OP_HASH256 OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT 00 OP_CAT OP_BIN2NUM OP_1 OP_ADD OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SIZE OP_SWAP OP_CAT 022079be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f8179802 OP_SWAP OP_CAT OP_SIZE OP_SWAP OP_CAT 30 OP_SWAP OP_CAT OP_FROMALTSTACK OP_CAT 038ff83d8cf12121491609c4939dc11c4aa35503508fe432dc5a5c1905608b9218 OP_CODESEPARATOR OP_CHECKSIGVERIFY OP_ENDIF";
18
- this.LOCK_SCRIPT_SUFFIX = "OP_2 OP_PICK OP_BIN2NUM OP_NOT OP_SWAP OP_2SWAP OP_DUP OP_BIN2NUM OP_0NOTEQUAL OP_DUP OP_NOT OP_6 OP_PICK OP_BIN2NUM OP_BOOLAND OP_5 OP_PICK OP_BOOLOR OP_IF OP_3 OP_PICK OP_11 OP_PICK OP_EQUALVERIFY OP_ENDIF OP_9 OP_PICK OP_IFDUP OP_IF OP_DUP 41 OP_TOALTSTACK OP_HASH256 OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_1 OP_SPLIT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT 00 OP_CAT OP_BIN2NUM OP_1 OP_ADD OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_DUP OP_0NOTEQUAL OP_SPLIT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SWAP OP_CAT OP_SIZE OP_SWAP OP_CAT 022079be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f8179802 OP_SWAP OP_CAT OP_SIZE OP_SWAP OP_CAT 30 OP_SWAP OP_CAT OP_FROMALTSTACK OP_CAT 038ff83d8cf12121491609c4939dc11c4aa35503508fe432dc5a5c1905608b9218 OP_CHECKSIGVERIFY OP_4 OP_SPLIT 20 OP_SPLIT 20 OP_SPLIT 24 OP_SPLIT OP_1 OP_SPLIT OP_NIP OP_2 OP_SPLIT OP_SWAP OP_BIN2NUM OP_SPLIT OP_8 OP_SPLIT OP_4 OP_SPLIT 20 OP_SPLIT OP_4 OP_SPLIT OP_1 OP_SPLIT OP_SWAP 41 OP_EQUALVERIFY OP_9 OP_PICK OP_2 OP_GREATERTHANOREQUAL OP_VERIFY OP_5 OP_ROLL OP_2 OP_SPLIT 15 OP_SPLIT 15 OP_SPLIT OP_2 OP_SPLIT 25 OP_SPLIT 25 OP_SPLIT 22 OP_SPLIT OP_DUP OP_TOALTSTACK OP_12 OP_PICK OP_DUP OP_BIN2NUM OP_1 OP_EQUALVERIFY 17 OP_PICK OP_NOTIF 1d02b0178876a914 OP_CAT 1e OP_PICK OP_CAT 88ac OP_CAT OP_ENDIF 14 18 OP_PICK OP_NOTIF 1a OP_ELSE 19 OP_ENDIF OP_PICK OP_CAT 14 19 OP_PICK OP_NOTIF 20 OP_PICK OP_ELSE OP_0 14 OP_NUM2BIN OP_ENDIF OP_CAT OP_CAT 18 OP_PICK OP_IF 0100 OP_ELSE 0121 OP_ENDIF OP_CAT 24 OP_16 OP_PICK OP_CAT OP_CAT OP_5 OP_PICK OP_CAT 17 OP_PICK OP_IF 21 1e OP_PICK OP_CAT OP_ELSE OP_3 OP_PICK OP_ENDIF OP_CAT OP_9 OP_PICK OP_SWAP OP_CAT OP_2 OP_PICK OP_CAT fd0005 OP_DUP OP_TOALTSTACK OP_15 OP_PICK OP_SWAP OP_CAT OP_SWAP OP_CAT 18 OP_PICK OP_NOTIF OP_SWAP OP_CAT OP_ELSE OP_NIP OP_ENDIF 1f OP_PICK OP_CAT OP_HASH256 OP_11 OP_PICK OP_EQUALVERIFY OP_13 OP_PICK 17 OP_PICK OP_BIN2NUM 13 OP_PICK OP_BOOLAND OP_IF 3a OP_PICK 2c OP_PICK OP_DROP OP_2 OP_CAT 3a OP_PICK OP_CAT OP_0 1a OP_NUM2BIN 3a OP_PICK 24 OP_SWAP OP_CAT OP_CAT 39 OP_PICK 22 OP_SWAP OP_CAT OP_CAT 38 OP_PICK 14 OP_SWAP OP_CAT OP_CAT 37 OP_PICK OP_SIZE OP_SWAP OP_CAT OP_CAT 36 OP_PICK 21 OP_SWAP OP_CAT OP_CAT 35 OP_PICK 4c68 OP_SWAP OP_CAT 35 OP_PICK 14 OP_SWAP OP_CAT 35 OP_PICK 14 OP_SWAP OP_CAT OP_CAT 34 OP_PICK 01 OP_SWAP OP_CAT OP_CAT 33 OP_PICK 24 OP_SWAP OP_CAT OP_CAT 32 OP_PICK 24 OP_SWAP OP_CAT OP_CAT OP_6 OP_PICK OP_CAT OP_12 OP_PICK OP_SWAP OP_CAT OP_5 OP_PICK OP_CAT OP_DUP ad68 OP_DUP OP_ROT OP_CAT OP_DROP 03fd0205 OP_SWAP 02 OP_SWAP OP_CAT OP_CAT OP_SWAP fd0005 03 OP_SWAP OP_CAT OP_TOALTSTACK 4d0005 OP_SWAP OP_CAT OP_CAT OP_CAT OP_CAT 2f OP_PICK 34 OP_SWAP OP_CAT OP_CAT OP_FROMALTSTACK OP_CAT 5579557a557a557955797e7e7e7e547a527a547a547a7e7e7e7c73630141 OP_CAT OP_FROMALTSTACK OP_FROMALTSTACK OP_SWAP OP_TOALTSTACK 20 OP_SPLIT OP_NIP 7d01 OP_SPLIT OP_DROP OP_CAT abad68 OP_CAT OP_SIZE OP_2 OP_NUM2BIN fd OP_SWAP OP_CAT OP_SWAP OP_CAT OP_CAT 2d OP_PICK OP_CAT 2c OP_PICK OP_CAT 2b OP_PICK OP_SIZE OP_SWAP OP_CAT OP_CAT 2a OP_PICK OP_CAT OP_3 OP_CAT OP_14 OP_PICK OP_CAT OP_FROMALTSTACK OP_CAT OP_9 OP_PICK OP_CAT 29 OP_PICK 14 OP_SWAP OP_CAT OP_CAT 28 OP_PICK 14 OP_SWAP OP_CAT OP_CAT 27 OP_PICK 01 OP_SWAP OP_CAT OP_CAT 26 OP_PICK 24 OP_SWAP OP_CAT OP_CAT 25 OP_PICK 24 OP_SWAP OP_CAT OP_CAT OP_3 OP_PICK OP_CAT OP_2 OP_PICK OP_CAT OP_14 OP_PICK OP_CAT 1d02b0178876a914 OP_CAT 1a OP_PICK OP_CAT 88ac OP_CAT 24 OP_PICK OP_CAT 23 OP_PICK 19 OP_SWAP OP_CAT OP_CAT 22 OP_PICK OP_CAT OP_HASH256 OP_DUP 15 OP_PICK 20 OP_SPLIT OP_DROP OP_EQUALVERIFY 01000000 OP_CAT OP_CAT OP_ELSE 3a OP_PICK 3a OP_PICK 3a OP_PICK 3a OP_PICK 3a OP_PICK 3a OP_PICK 3a OP_PICK 3a OP_PICK 3a OP_PICK 3a OP_PICK 3a OP_PICK 3a OP_PICK 3a OP_PICK 3a OP_PICK 3a OP_PICK 3a OP_PICK 3a OP_PICK 3a OP_PICK 3a OP_PICK 3a OP_PICK 3a OP_PICK 3a OP_PICK 3a OP_PICK 3a OP_PICK 3a OP_PICK 3a OP_PICK OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_CAT OP_SIZE OP_NIP OP_0 OP_EQUALVERIFY OP_ENDIF 20 OP_PICK OP_CAT OP_HASH256 OP_16 OP_PICK OP_EQUALVERIFY 1c OP_PICK OP_DUP OP_SIZE OP_1SUB OP_SPLIT OP_NIP 41 OP_EQUALVERIFY 1c OP_PICK OP_DUP OP_HASH160 1b OP_ELSE OP_11 OP_PICK OP_DUP OP_SIZE OP_1SUB OP_SPLIT OP_NIP 41 OP_EQUALVERIFY OP_11 OP_PICK OP_DUP OP_HASH160 OP_10 OP_ENDIF OP_PICK OP_EQUALVERIFY OP_CHECKSIG";
19
- }
20
- /**
21
- * Build a MinSimpleDiscountBolt locking script from its 7 contract args.
22
- * Genesis identity mint: discount = [percent], pubKeyHash = recipient, issuerPubKey = issuer,
23
- * pubKeyHashCommitment = zeros[20], txoType = [0x00], parent/grandparent = zeros[36].
24
- */
25
- lock(discount, pubKeyHash, issuerPubKey, pubKeyHashCommitment = new Array(20).fill(0x00), txoType = [0x00], parentOutpoint = new Array(36).fill(0x00), grandparentOutpoint = new Array(36).fill(0x00)) {
26
- return new LockingScript([
27
- ...new Script().writeBin(discount).chunks,
28
- ...new Script().writeBin(pubKeyHash).chunks,
29
- ...new Script().writeBin(pubKeyHashCommitment).chunks,
30
- ...new Script().writeBin(txoType).chunks,
31
- ...new Script().writeBin(parentOutpoint).chunks,
32
- ...new Script().writeBin(grandparentOutpoint).chunks,
33
- ...new Script().writeBin(issuerPubKey).chunks,
34
- ...Script.fromASM(this.LOCK_SCRIPT_SUFFIX).chunks,
35
- ]);
36
- }
37
- /** The static contract suffix (everything after the 7 data pushes), as a Script. */
38
- staticSuffix() {
39
- return Script.fromASM(this.LOCK_SCRIPT_SUFFIX);
40
- }
41
- /**
42
- * Spend (transfer commit/settle) this discount-bolt. The discount is immutable and carried by
43
- * the lock; the unlock layout is contract-agnostic (37 args), so it delegates to singleSpendUnlock.
44
- * @param beneficiaryPubKeyHash the next owner's 20-byte pkh (commit + settle commit-to recipient)
45
- * @param prevTxs prior lineage txs (mint, commit, ...); a back-reaching settle (>=4 txs) is B2b-2
46
- */
47
- unlock(privateKey, beneficiaryPubKeyHash, prevTxs = [], forceNoChange = false, forceNoFund = false) {
48
- return singleSpendUnlock({
49
- privateKey,
50
- beneficiaryPubKeyHash,
51
- unlockScriptSuffixASM: this.UNLOCK_SCRIPT_SUFFIX,
52
- prevTxs,
53
- forceNoChange,
54
- forceNoFund,
55
- leadingValuePushes: 1, // discount[1] is the leading lock push
56
- });
57
- }
58
- }