xpi-ts 0.2.22 → 0.2.24

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 (172) hide show
  1. package/dist/cjs/lib/bitcore/crypto/point.js +2 -2
  2. package/dist/cjs/lib/bitcore/index.js +162 -162
  3. package/dist/esm/lib/bitcore/crypto/point.js +2 -2
  4. package/dist/esm/lib/bitcore/index.js +42 -42
  5. package/dist/types/index.d.ts +5 -0
  6. package/dist/types/index.d.ts.map +1 -1
  7. package/dist/types/lib/bitcore/address.d.ts +116 -0
  8. package/dist/types/lib/bitcore/address.d.ts.map +1 -1
  9. package/dist/types/lib/bitcore/block/block.d.ts +214 -0
  10. package/dist/types/lib/bitcore/block/block.d.ts.map +1 -1
  11. package/dist/types/lib/bitcore/block/blockheader.d.ts +220 -0
  12. package/dist/types/lib/bitcore/block/blockheader.d.ts.map +1 -1
  13. package/dist/types/lib/bitcore/block/merkleblock.d.ts +206 -0
  14. package/dist/types/lib/bitcore/block/merkleblock.d.ts.map +1 -1
  15. package/dist/types/lib/bitcore/crypto/bn.d.ts +224 -0
  16. package/dist/types/lib/bitcore/crypto/bn.d.ts.map +1 -1
  17. package/dist/types/lib/bitcore/crypto/ecdsa.d.ts +122 -0
  18. package/dist/types/lib/bitcore/crypto/ecdsa.d.ts.map +1 -1
  19. package/dist/types/lib/bitcore/crypto/hash.d.ts +56 -0
  20. package/dist/types/lib/bitcore/crypto/hash.d.ts.map +1 -1
  21. package/dist/types/lib/bitcore/crypto/index.d.ts +4 -0
  22. package/dist/types/lib/bitcore/crypto/index.d.ts.map +1 -1
  23. package/dist/types/lib/bitcore/crypto/musig2.d.ts +282 -0
  24. package/dist/types/lib/bitcore/crypto/musig2.d.ts.map +1 -1
  25. package/dist/types/lib/bitcore/crypto/point.d.ts +87 -0
  26. package/dist/types/lib/bitcore/crypto/point.d.ts.map +1 -1
  27. package/dist/types/lib/bitcore/crypto/random.d.ts +48 -0
  28. package/dist/types/lib/bitcore/crypto/random.d.ts.map +1 -1
  29. package/dist/types/lib/bitcore/crypto/schnorr.d.ts +203 -0
  30. package/dist/types/lib/bitcore/crypto/schnorr.d.ts.map +1 -1
  31. package/dist/types/lib/bitcore/crypto/signature.d.ts +452 -0
  32. package/dist/types/lib/bitcore/crypto/signature.d.ts.map +1 -1
  33. package/dist/types/lib/bitcore/crypto/sigtype.d.ts +46 -0
  34. package/dist/types/lib/bitcore/crypto/sigtype.d.ts.map +1 -1
  35. package/dist/types/lib/bitcore/encoding/base58.d.ts +68 -0
  36. package/dist/types/lib/bitcore/encoding/base58.d.ts.map +1 -1
  37. package/dist/types/lib/bitcore/encoding/base58check.d.ts +58 -0
  38. package/dist/types/lib/bitcore/encoding/base58check.d.ts.map +1 -1
  39. package/dist/types/lib/bitcore/encoding/bufferreader.d.ts +112 -0
  40. package/dist/types/lib/bitcore/encoding/bufferreader.d.ts.map +1 -1
  41. package/dist/types/lib/bitcore/encoding/bufferwriter.d.ts +144 -0
  42. package/dist/types/lib/bitcore/encoding/bufferwriter.d.ts.map +1 -1
  43. package/dist/types/lib/bitcore/encoding/varint.d.ts +86 -0
  44. package/dist/types/lib/bitcore/encoding/varint.d.ts.map +1 -1
  45. package/dist/types/lib/bitcore/errors.d.ts +4 -0
  46. package/dist/types/lib/bitcore/errors.d.ts.map +1 -1
  47. package/dist/types/lib/bitcore/hdprivatekey.d.ts +59 -0
  48. package/dist/types/lib/bitcore/hdprivatekey.d.ts.map +1 -1
  49. package/dist/types/lib/bitcore/hdpublickey.d.ts +145 -0
  50. package/dist/types/lib/bitcore/hdpublickey.d.ts.map +1 -1
  51. package/dist/types/lib/bitcore/index.d.ts +58 -54
  52. package/dist/types/lib/bitcore/index.d.ts.map +1 -1
  53. package/dist/types/lib/bitcore/message.d.ts +63 -0
  54. package/dist/types/lib/bitcore/message.d.ts.map +1 -1
  55. package/dist/types/lib/bitcore/mnemonic/errors.d.ts +4 -0
  56. package/dist/types/lib/bitcore/mnemonic/errors.d.ts.map +1 -1
  57. package/dist/types/lib/bitcore/mnemonic/index.d.ts +4 -0
  58. package/dist/types/lib/bitcore/mnemonic/index.d.ts.map +1 -1
  59. package/dist/types/lib/bitcore/mnemonic/mnemonic.d.ts +106 -0
  60. package/dist/types/lib/bitcore/mnemonic/mnemonic.d.ts.map +1 -1
  61. package/dist/types/lib/bitcore/mnemonic/pbkdf2.d.ts +13 -0
  62. package/dist/types/lib/bitcore/mnemonic/pbkdf2.d.ts.map +1 -1
  63. package/dist/types/lib/bitcore/mnemonic/words/english.d.ts +4 -0
  64. package/dist/types/lib/bitcore/mnemonic/words/english.d.ts.map +1 -1
  65. package/dist/types/lib/bitcore/mnemonic/words/french.d.ts +5 -0
  66. package/dist/types/lib/bitcore/mnemonic/words/french.d.ts.map +1 -1
  67. package/dist/types/lib/bitcore/mnemonic/words/index.d.ts +4 -0
  68. package/dist/types/lib/bitcore/mnemonic/words/index.d.ts.map +1 -1
  69. package/dist/types/lib/bitcore/musig2/index.d.ts +14 -0
  70. package/dist/types/lib/bitcore/musig2/index.d.ts.map +1 -1
  71. package/dist/types/lib/bitcore/musig2/session.d.ts +254 -0
  72. package/dist/types/lib/bitcore/musig2/session.d.ts.map +1 -1
  73. package/dist/types/lib/bitcore/musig2/signer.d.ts +212 -0
  74. package/dist/types/lib/bitcore/musig2/signer.d.ts.map +1 -1
  75. package/dist/types/lib/bitcore/networks.d.ts +17 -0
  76. package/dist/types/lib/bitcore/networks.d.ts.map +1 -1
  77. package/dist/types/lib/bitcore/opcode.d.ts +151 -0
  78. package/dist/types/lib/bitcore/opcode.d.ts.map +1 -1
  79. package/dist/types/lib/bitcore/privatekey.d.ts +80 -0
  80. package/dist/types/lib/bitcore/privatekey.d.ts.map +1 -1
  81. package/dist/types/lib/bitcore/publickey.d.ts +195 -0
  82. package/dist/types/lib/bitcore/publickey.d.ts.map +1 -1
  83. package/dist/types/lib/bitcore/script/chunk.d.ts +51 -0
  84. package/dist/types/lib/bitcore/script/chunk.d.ts.map +1 -1
  85. package/dist/types/lib/bitcore/script/interpreter/condition-stack.d.ts +60 -0
  86. package/dist/types/lib/bitcore/script/interpreter/condition-stack.d.ts.map +1 -1
  87. package/dist/types/lib/bitcore/script/interpreter/index.d.ts +23 -0
  88. package/dist/types/lib/bitcore/script/interpreter/index.d.ts.map +1 -1
  89. package/dist/types/lib/bitcore/script/interpreter/interpreter.d.ts +86 -0
  90. package/dist/types/lib/bitcore/script/interpreter/interpreter.d.ts.map +1 -1
  91. package/dist/types/lib/bitcore/script/interpreter/script-num.d.ts +115 -0
  92. package/dist/types/lib/bitcore/script/interpreter/script-num.d.ts.map +1 -1
  93. package/dist/types/lib/bitcore/script/interpreter/types.d.ts +119 -0
  94. package/dist/types/lib/bitcore/script/interpreter/types.d.ts.map +1 -1
  95. package/dist/types/lib/bitcore/script/taproot.d.ts +297 -0
  96. package/dist/types/lib/bitcore/script/taproot.d.ts.map +1 -1
  97. package/dist/types/lib/bitcore/script.d.ts +510 -0
  98. package/dist/types/lib/bitcore/script.d.ts.map +1 -1
  99. package/dist/types/lib/bitcore/taproot/musig2.d.ts +153 -0
  100. package/dist/types/lib/bitcore/taproot/musig2.d.ts.map +1 -1
  101. package/dist/types/lib/bitcore/transaction/input/multisig.d.ts +8 -0
  102. package/dist/types/lib/bitcore/transaction/input/multisig.d.ts.map +1 -1
  103. package/dist/types/lib/bitcore/transaction/input/multisigscripthash.d.ts +8 -0
  104. package/dist/types/lib/bitcore/transaction/input/multisigscripthash.d.ts.map +1 -1
  105. package/dist/types/lib/bitcore/transaction/input/publickey.d.ts +8 -0
  106. package/dist/types/lib/bitcore/transaction/input/publickey.d.ts.map +1 -1
  107. package/dist/types/lib/bitcore/transaction/input/publickeyhash.d.ts +14 -0
  108. package/dist/types/lib/bitcore/transaction/input/publickeyhash.d.ts.map +1 -1
  109. package/dist/types/lib/bitcore/transaction/input/taproot.d.ts +22 -0
  110. package/dist/types/lib/bitcore/transaction/input/taproot.d.ts.map +1 -1
  111. package/dist/types/lib/bitcore/transaction/input.d.ts +418 -0
  112. package/dist/types/lib/bitcore/transaction/input.d.ts.map +1 -1
  113. package/dist/types/lib/bitcore/transaction/outpoint.d.ts +110 -0
  114. package/dist/types/lib/bitcore/transaction/outpoint.d.ts.map +1 -1
  115. package/dist/types/lib/bitcore/transaction/output.d.ts +83 -0
  116. package/dist/types/lib/bitcore/transaction/output.d.ts.map +1 -1
  117. package/dist/types/lib/bitcore/transaction/sighash.d.ts +69 -0
  118. package/dist/types/lib/bitcore/transaction/sighash.d.ts.map +1 -1
  119. package/dist/types/lib/bitcore/transaction/signature.d.ts +98 -0
  120. package/dist/types/lib/bitcore/transaction/signature.d.ts.map +1 -1
  121. package/dist/types/lib/bitcore/transaction/transaction.d.ts +379 -0
  122. package/dist/types/lib/bitcore/transaction/transaction.d.ts.map +1 -1
  123. package/dist/types/lib/bitcore/transaction/unspentoutput.d.ts +61 -0
  124. package/dist/types/lib/bitcore/transaction/unspentoutput.d.ts.map +1 -1
  125. package/dist/types/lib/bitcore/unit.d.ts +140 -0
  126. package/dist/types/lib/bitcore/unit.d.ts.map +1 -1
  127. package/dist/types/lib/bitcore/uri.d.ts +34 -0
  128. package/dist/types/lib/bitcore/uri.d.ts.map +1 -1
  129. package/dist/types/lib/bitcore/util/base32.d.ts +55 -0
  130. package/dist/types/lib/bitcore/util/base32.d.ts.map +1 -1
  131. package/dist/types/lib/bitcore/util/bits.d.ts +76 -0
  132. package/dist/types/lib/bitcore/util/bits.d.ts.map +1 -1
  133. package/dist/types/lib/bitcore/util/buffer.d.ts +135 -0
  134. package/dist/types/lib/bitcore/util/buffer.d.ts.map +1 -1
  135. package/dist/types/lib/bitcore/util/convertBits.d.ts +15 -0
  136. package/dist/types/lib/bitcore/util/convertBits.d.ts.map +1 -1
  137. package/dist/types/lib/bitcore/util/js.d.ts +19 -0
  138. package/dist/types/lib/bitcore/util/js.d.ts.map +1 -1
  139. package/dist/types/lib/bitcore/util/merkle.d.ts +85 -0
  140. package/dist/types/lib/bitcore/util/merkle.d.ts.map +1 -1
  141. package/dist/types/lib/bitcore/util/preconditions.d.ts +29 -0
  142. package/dist/types/lib/bitcore/util/preconditions.d.ts.map +1 -1
  143. package/dist/types/lib/bitcore/util.d.ts +7 -0
  144. package/dist/types/lib/bitcore/util.d.ts.map +1 -1
  145. package/dist/types/lib/bitcore/xaddress.d.ts +117 -0
  146. package/dist/types/lib/bitcore/xaddress.d.ts.map +1 -1
  147. package/dist/types/lib/lokad.d.ts +292 -0
  148. package/dist/types/lib/lokad.d.ts.map +1 -1
  149. package/dist/types/lib/nft.d.ts +434 -0
  150. package/dist/types/lib/nft.d.ts.map +1 -1
  151. package/dist/types/lib/rank/api.d.ts +13 -0
  152. package/dist/types/lib/rank/api.d.ts.map +1 -1
  153. package/dist/types/lib/rank/index.d.ts +153 -0
  154. package/dist/types/lib/rank/index.d.ts.map +1 -1
  155. package/dist/types/lib/rank/opcode.d.ts +6 -2
  156. package/dist/types/lib/rank/opcode.d.ts.map +1 -1
  157. package/dist/types/lib/rank/script.d.ts +10 -0
  158. package/dist/types/lib/rank/script.d.ts.map +1 -1
  159. package/dist/types/lib/rank/transaction.d.ts +11 -0
  160. package/dist/types/lib/rank/transaction.d.ts.map +1 -1
  161. package/dist/types/lib/rpc.d.ts +176 -0
  162. package/dist/types/lib/rpc.d.ts.map +1 -1
  163. package/dist/types/utils/constants.d.ts +27 -0
  164. package/dist/types/utils/constants.d.ts.map +1 -1
  165. package/dist/types/utils/env.d.ts +15 -0
  166. package/dist/types/utils/env.d.ts.map +1 -1
  167. package/dist/types/utils/string.d.ts +57 -0
  168. package/dist/types/utils/string.d.ts.map +1 -1
  169. package/dist/types/utils/wallet.d.ts +43 -1
  170. package/dist/types/utils/wallet.d.ts.map +1 -1
  171. package/package.json +1 -1
  172. package/tsconfig.types.json +2 -1
@@ -1,10 +1,81 @@
1
+ /**
2
+ * Copyright 2025-2026 The Lotusia Stewardship
3
+ * Github: https://github.com/LotusiaStewardship
4
+ * License: MIT
5
+ *
6
+ * Lotus Script Interpreter
7
+ *
8
+ * Client-side script evaluation engine for validating that crafted
9
+ * transactions will pass lotusd consensus checks before broadcasting.
10
+ *
11
+ * This is NOT a consensus implementation. It mirrors lotusd behavior
12
+ * to give wallets confidence that their transactions are well-formed.
13
+ * The authoritative interpreter is always lotusd itself.
14
+ *
15
+ * Architecture:
16
+ * - evalScript(): Executes a single script on a stack
17
+ * - verifyScript(): Orchestrates scriptSig + scriptPubKey evaluation
18
+ * - SignatureChecker interface: Pluggable signature verification
19
+ *
20
+ * Reference: lotusd/src/script/interpreter.cpp
21
+ *
22
+ * @module Interpreter
23
+ */
1
24
  import { Script } from '../../script';
2
25
  import { ScriptFlags, type ScriptResult, type ScriptExecutionMetrics, type ScriptExecutionData, type SignatureChecker } from './types';
3
26
  import type { Buffer } from 'buffer/';
27
+ /** Type alias for stack elements (byte arrays) */
4
28
  type StackElement = Buffer;
29
+ /**
30
+ * Evaluate a script on the given stack.
31
+ *
32
+ * This is the core script execution engine. It processes each opcode
33
+ * sequentially, manipulating the stack according to Lotus consensus
34
+ * rules. Conditional execution (IF/ELSE/ENDIF) is tracked via the
35
+ * ConditionStack.
36
+ *
37
+ * For client-side validation, this function verifies that a script
38
+ * will execute successfully under lotusd consensus rules.
39
+ *
40
+ * @param stack - The data stack (modified in place)
41
+ * @param scriptBuf - Raw script bytes to execute
42
+ * @param flags - Script verification flags
43
+ * @param checker - Signature verification interface
44
+ * @param metrics - Execution metrics (modified in place)
45
+ * @param execdata - Execution data for sighash (modified in place)
46
+ * @returns ScriptResult indicating success or failure with error code
47
+ */
5
48
  export declare function evalScript(stack: StackElement[], scriptBuf: Buffer, flags: number, checker: SignatureChecker, metrics: ScriptExecutionMetrics, execdata: ScriptExecutionData): ScriptResult;
49
+ /**
50
+ * Verify a scriptSig + scriptPubKey pair.
51
+ *
52
+ * This is the main entry point for client-side transaction validation.
53
+ * It evaluates scriptSig, then scriptPubKey, handling P2SH and
54
+ * OP_SCRIPTTYPE (Taproot) dispatch.
55
+ *
56
+ * For a wallet building transactions, call this after signing to
57
+ * confirm the transaction will be accepted by the network.
58
+ *
59
+ * @param scriptSig - The unlocking script (raw bytes)
60
+ * @param scriptPubKey - The locking script (raw bytes)
61
+ * @param flags - Script verification flags
62
+ * @param checker - Signature verification interface
63
+ * @returns ScriptResult with success status and error code
64
+ */
6
65
  export declare function verifyScript(scriptSig: Buffer, scriptPubKey: Buffer, flags: number, checker: SignatureChecker): ScriptResult;
66
+ /**
67
+ * Class-based wrapper around the functional interpreter API.
68
+ *
69
+ * Provides backward compatibility with existing code that expects:
70
+ * - Static flag constants (e.g., `Interpreter.SCRIPT_ENABLE_SIGHASH_FORKID`)
71
+ * - An instance `verify()` method with transaction context
72
+ * - An `errstr` property for error diagnostics
73
+ *
74
+ * New code should prefer the functional `evalScript()` / `verifyScript()`
75
+ * API directly, using `ScriptFlags` enum for flag constants.
76
+ */
7
77
  export declare class Interpreter {
78
+ /** Last error string from verify(), empty on success */
8
79
  errstr: string;
9
80
  static SCRIPT_VERIFY_NONE: ScriptFlags;
10
81
  static SCRIPT_TAPROOT_KEY_SPEND_PATH: ScriptFlags;
@@ -15,6 +86,21 @@ export declare class Interpreter {
15
86
  static SCRIPT_ENABLE_SIGHASH_FORKID: ScriptFlags;
16
87
  static SCRIPT_ENABLE_REPLAY_PROTECTION: ScriptFlags;
17
88
  static SCRIPT_VERIFY_INPUT_SIGCHECKS: ScriptFlags;
89
+ /**
90
+ * Verify a scriptSig + scriptPubKey pair in the context of a transaction.
91
+ *
92
+ * This is the high-level entry point used by Transaction.verify().
93
+ * It constructs a TransactionSignatureChecker from the provided
94
+ * transaction context and delegates to verifyScript().
95
+ *
96
+ * @param scriptSig - The unlocking script
97
+ * @param scriptPubKey - The locking script
98
+ * @param tx - The spending transaction
99
+ * @param nin - The input index being verified
100
+ * @param flags - Script verification flags
101
+ * @param satoshis - The value of the output being spent (for BIP143/Lotus sighash)
102
+ * @returns true if verification succeeds
103
+ */
18
104
  verify(scriptSig: Script, scriptPubKey: Script, tx: any, nin: number, flags: number, satoshis?: bigint): boolean;
19
105
  }
20
106
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"interpreter.d.ts","sourceRoot":"","sources":["../../../../../../lib/bitcore/script/interpreter/interpreter.ts"],"names":[],"mappings":"AA8BA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAGrC,OAAO,EAQL,WAAW,EACX,KAAK,YAAY,EACjB,KAAK,sBAAsB,EAC3B,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EACtB,MAAM,SAAS,CAAA;AAchB,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAKrC,KAAK,YAAY,GAAG,MAAM,CAAA;AAsQ1B,wBAAgB,UAAU,CACxB,KAAK,EAAE,YAAY,EAAE,EACrB,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,gBAAgB,EACzB,OAAO,EAAE,sBAAsB,EAC/B,QAAQ,EAAE,mBAAmB,GAC5B,YAAY,CAuGd;AA+xCD,wBAAgB,YAAY,CAC1B,SAAS,EAAE,MAAM,EACjB,YAAY,EAAE,MAAM,EACpB,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,gBAAgB,GACxB,YAAY,CAqGd;AAuED,qBAAa,WAAW;IAEtB,MAAM,EAAE,MAAM,CAAK;IAKnB,MAAM,CAAC,kBAAkB,cAA0B;IACnD,MAAM,CAAC,6BAA6B,cAAqC;IACzE,MAAM,CAAC,oCAAoC,cACA;IAC3C,MAAM,CAAC,wCAAwC,cACA;IAC/C,MAAM,CAAC,wBAAwB,cAAgC;IAC/D,MAAM,CAAC,uBAAuB,cAA+B;IAC7D,MAAM,CAAC,4BAA4B,cAAoC;IACvE,MAAM,CAAC,+BAA+B,cAAuC;IAC7E,MAAM,CAAC,6BAA6B,cAAqC;IAiBzE,MAAM,CACJ,SAAS,EAAE,MAAM,EACjB,YAAY,EAAE,MAAM,EACpB,EAAE,EAAE,GAAG,EACP,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,MAAM,EACb,QAAQ,CAAC,EAAE,MAAM,GAChB,OAAO;CAeX"}
1
+ {"version":3,"file":"interpreter.d.ts","sourceRoot":"","sources":["../../../../../../lib/bitcore/script/interpreter/interpreter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAQH,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAGrC,OAAO,EAQL,WAAW,EACX,KAAK,YAAY,EACjB,KAAK,sBAAsB,EAC3B,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EACtB,MAAM,SAAS,CAAA;AAchB,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAIrC,kDAAkD;AAClD,KAAK,YAAY,GAAG,MAAM,CAAA;AAmP1B;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,UAAU,CACxB,KAAK,EAAE,YAAY,EAAE,EACrB,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,gBAAgB,EACzB,OAAO,EAAE,sBAAsB,EAC/B,QAAQ,EAAE,mBAAmB,GAC5B,YAAY,CAuGd;AA+wCD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,YAAY,CAC1B,SAAS,EAAE,MAAM,EACjB,YAAY,EAAE,MAAM,EACpB,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,gBAAgB,GACxB,YAAY,CAqGd;AA4DD;;;;;;;;;;GAUG;AACH,qBAAa,WAAW;IACtB,wDAAwD;IACxD,MAAM,EAAE,MAAM,CAAK;IAKnB,MAAM,CAAC,kBAAkB,cAA0B;IACnD,MAAM,CAAC,6BAA6B,cAAqC;IACzE,MAAM,CAAC,oCAAoC,cACA;IAC3C,MAAM,CAAC,wCAAwC,cACA;IAC/C,MAAM,CAAC,wBAAwB,cAAgC;IAC/D,MAAM,CAAC,uBAAuB,cAA+B;IAC7D,MAAM,CAAC,4BAA4B,cAAoC;IACvE,MAAM,CAAC,+BAA+B,cAAuC;IAC7E,MAAM,CAAC,6BAA6B,cAAqC;IAEzE;;;;;;;;;;;;;;OAcG;IACH,MAAM,CACJ,SAAS,EAAE,MAAM,EACjB,YAAY,EAAE,MAAM,EACpB,EAAE,EAAE,GAAG,EACP,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,MAAM,EACb,QAAQ,CAAC,EAAE,MAAM,GAChB,OAAO;CAeX"}
@@ -1,26 +1,134 @@
1
+ /**
2
+ * Copyright 2025-2026 The Lotusia Stewardship
3
+ * Github: https://github.com/LotusiaStewardship
4
+ * License: MIT
5
+ *
6
+ * Script Number Arithmetic
7
+ *
8
+ * Implements the CScriptNum equivalent for Lotus script evaluation.
9
+ * Script numbers are signed integers stored as variable-length
10
+ * little-endian byte arrays with sign-magnitude encoding.
11
+ *
12
+ * Lotus uses 8-byte script numbers (int64 range), unlike Bitcoin's
13
+ * 4-byte limit. The valid range is [-2^63+1, 2^63-1].
14
+ *
15
+ * Reference: lotusd/src/script/script.h (CScriptNum)
16
+ *
17
+ * @module ScriptNum
18
+ */
1
19
  import type { Buffer } from 'buffer/';
20
+ /**
21
+ * Error thrown when script number operations overflow or
22
+ * encounter invalid encodings.
23
+ */
2
24
  export declare class ScriptNumError extends Error {
3
25
  constructor(message: string);
4
26
  }
27
+ /**
28
+ * Script number representation for stack-based arithmetic.
29
+ *
30
+ * Wraps a bigint value with serialization/deserialization that
31
+ * matches the lotusd CScriptNum wire format. All arithmetic
32
+ * operations check for overflow within the int64 range.
33
+ *
34
+ * SECURITY: The value INT64_MIN (-2^63) is explicitly excluded
35
+ * from the valid range to avoid undefined behavior in negation.
36
+ */
5
37
  export declare class ScriptNum {
6
38
  private static readonly INT64_MAX;
7
39
  private static readonly INT64_MIN_EXCLUSIVE;
40
+ /** The underlying numeric value */
8
41
  readonly value: bigint;
9
42
  constructor(value: bigint);
43
+ /**
44
+ * Decode a script number from its stack byte representation.
45
+ *
46
+ * @param buf - The byte array from the stack
47
+ * @param requireMinimal - Require minimally-encoded numbers
48
+ * @param maxSize - Maximum byte length (default: 8)
49
+ * @returns A new ScriptNum
50
+ * @throws {ScriptNumError} On overflow or non-minimal encoding
51
+ */
10
52
  static fromBuffer(buf: Buffer, requireMinimal?: boolean, maxSize?: number): ScriptNum;
53
+ /**
54
+ * Check if a byte array is minimally encoded as a script number.
55
+ *
56
+ * Minimal encoding rules:
57
+ * - Empty array encodes 0
58
+ * - No unnecessary leading zero bytes
59
+ * - Sign bit uses the MSB of the last byte
60
+ *
61
+ * @param buf - The byte array to check
62
+ * @param maxSize - Maximum allowed size
63
+ * @returns true if minimally encoded
64
+ */
11
65
  static isMinimallyEncoded(buf: Buffer, maxSize?: number): boolean;
66
+ /**
67
+ * Minimally encode a byte array in-place.
68
+ *
69
+ * Removes unnecessary padding bytes while preserving the
70
+ * numeric value and sign.
71
+ *
72
+ * @param data - Mutable byte array to encode minimally
73
+ * @returns The minimally encoded buffer
74
+ */
12
75
  static minimallyEncode(data: Buffer): Buffer;
76
+ /**
77
+ * Decode a little-endian sign-magnitude byte array to bigint.
78
+ *
79
+ * @param buf - The byte array to decode
80
+ * @returns The decoded numeric value
81
+ */
13
82
  private static decode;
83
+ /**
84
+ * Serialize this script number to its stack byte representation.
85
+ *
86
+ * @returns Minimally-encoded little-endian sign-magnitude bytes
87
+ */
14
88
  toBuffer(): Buffer;
89
+ /**
90
+ * Serialize a bigint value to script number byte format.
91
+ *
92
+ * @param value - The numeric value to serialize
93
+ * @returns Minimally-encoded byte array
94
+ */
15
95
  static serialize(value: bigint): Buffer;
96
+ /**
97
+ * Get the value as a regular number (clamped to int32 range).
98
+ *
99
+ * @returns The value clamped to [-2^31, 2^31-1]
100
+ */
16
101
  toNumber(): number;
102
+ /**
103
+ * Add two script numbers with overflow checking.
104
+ *
105
+ * @throws {ScriptNumError} On int64 overflow
106
+ */
17
107
  add(other: ScriptNum): ScriptNum;
108
+ /**
109
+ * Subtract two script numbers with overflow checking.
110
+ *
111
+ * @throws {ScriptNumError} On int64 overflow
112
+ */
18
113
  sub(other: ScriptNum): ScriptNum;
114
+ /** Negate this script number */
19
115
  negate(): ScriptNum;
116
+ /** Absolute value */
20
117
  abs(): ScriptNum;
118
+ /** Integer division */
21
119
  div(other: ScriptNum): ScriptNum;
120
+ /** Modulo */
22
121
  mod(other: ScriptNum): ScriptNum;
122
+ /**
123
+ * Multiply by power of 2 (OP_MULPOW2).
124
+ *
125
+ * Equivalent to value * 2^shift for positive shift,
126
+ * or value / 2^|shift| for negative shift.
127
+ *
128
+ * @throws {ScriptNumError} On overflow
129
+ */
23
130
  mulpow2(shift: ScriptNum): ScriptNum;
131
+ /** Bitwise AND */
24
132
  bitwiseAnd(mask: bigint): ScriptNum;
25
133
  isZero(): boolean;
26
134
  isNegative(): boolean;
@@ -30,6 +138,13 @@ export declare class ScriptNum {
30
138
  gte(other: ScriptNum | bigint): boolean;
31
139
  eq(other: ScriptNum | bigint): boolean;
32
140
  neq(other: ScriptNum | bigint): boolean;
141
+ /**
142
+ * Validate that a result is within the valid int64 range.
143
+ *
144
+ * INT64_MIN is excluded because negating it causes overflow.
145
+ *
146
+ * @throws {ScriptNumError} If value is out of range
147
+ */
33
148
  private static checkOverflow;
34
149
  }
35
150
  //# sourceMappingURL=script-num.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"script-num.d.ts","sourceRoot":"","sources":["../../../../../../lib/bitcore/script/interpreter/script-num.ts"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAMrC,qBAAa,cAAe,SAAQ,KAAK;gBAC3B,OAAO,EAAE,MAAM;CAI5B;AAYD,qBAAa,SAAS;IACpB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAmB;IACpD,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,mBAAmB,CAAoB;IAG/D,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;gBAEV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ACrB,GAAG,IAAI,SAAS;IAIhB,uBAAuB;IACvB,GAAG,CAAC,KAAK,EAAE,SAAS,GAAG,SAAS;IAIhC,aAAa;IACb,GAAG,CAAC,KAAK,EAAE,SAAS,GAAG,SAAS;IAIhC;;;;;;;OAOG;IACH,OAAO,CAAC,KAAK,EAAE,SAAS,GAAG,SAAS;IA0BpC,kBAAkB;IAClB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS;IAMnC,MAAM,IAAI,OAAO;IAIjB,UAAU,IAAI,OAAO;IAIrB,EAAE,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM,GAAG,OAAO;IAKtC,EAAE,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM,GAAG,OAAO;IAKtC,GAAG,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM,GAAG,OAAO;IAKvC,GAAG,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM,GAAG,OAAO;IAKvC,EAAE,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM,GAAG,OAAO;IAKtC,GAAG,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM,GAAG,OAAO;IAKvC;;;;;;OAMG;IACH,OAAO,CAAC,MAAM,CAAC,aAAa;CAK7B"}
@@ -1,24 +1,77 @@
1
+ /**
2
+ * Copyright 2025-2026 The Lotusia Stewardship
3
+ * Github: https://github.com/LotusiaStewardship
4
+ * License: MIT
5
+ *
6
+ * Script Interpreter Types and Constants
7
+ *
8
+ * Defines all types, error codes, script flags, and constants used by
9
+ * the Lotus script interpreter. These mirror the lotusd consensus rules
10
+ * but are tailored for client-side transaction validation.
11
+ *
12
+ * Reference: lotusd/src/script/script.h, script_flags.h, script_error.h
13
+ *
14
+ * @module InterpreterTypes
15
+ */
1
16
  import type { Buffer } from 'buffer/';
17
+ /** Maximum number of bytes pushable to the stack */
2
18
  export declare const MAX_SCRIPT_ELEMENT_SIZE = 520;
19
+ /** Maximum number of non-push operations per script */
3
20
  export declare const MAX_OPS_PER_SCRIPT = 400;
21
+ /** Maximum number of public keys per multisig */
4
22
  export declare const MAX_PUBKEYS_PER_MULTISIG = 20;
23
+ /** Maximum script length in bytes */
5
24
  export declare const MAX_SCRIPT_SIZE = 10000;
25
+ /** Maximum number of values on script interpreter stack */
6
26
  export declare const MAX_STACK_SIZE = 1000;
27
+ /** Maximum number of bytes OP_NUM2BIN can produce */
7
28
  export declare const MAX_NUM2BIN_SIZE = 68;
29
+ /**
30
+ * Threshold for nLockTime: below this value it is interpreted as
31
+ * block number, otherwise as UNIX timestamp.
32
+ */
8
33
  export declare const LOCKTIME_THRESHOLD = 500000000;
34
+ /** Maximum element size for CScriptNum (8 bytes = int64 range) */
9
35
  export declare const SCRIPTNUM_MAX_ELEMENT_SIZE = 8;
36
+ /**
37
+ * Script verification flags matching lotusd consensus.
38
+ *
39
+ * For client-side validation, the standard set of flags should be used
40
+ * to ensure crafted transactions will pass node validation.
41
+ */
10
42
  export declare enum ScriptFlags {
11
43
  VERIFY_NONE = 0,
44
+ /** Require Lotus sighash and Schnorr for Taproot key spend */
12
45
  TAPROOT_KEY_SPEND_PATH = 1,
46
+ /** Disable Taproot scripts and SIGHASH_LOTUS */
13
47
  DISABLE_TAPROOT_SIGHASH_LOTUS = 2,
48
+ /** Discourage upgradable NOPs (NOP1, NOP4-NOP10) */
14
49
  VERIFY_DISCOURAGE_UPGRADABLE_NOPS = 128,
50
+ /** Require exactly one stack element after evaluation */
15
51
  VERIFY_CLEANSTACK = 256,
52
+ /** Require OP_IF/NOTIF argument to be exactly 0x01 or empty */
16
53
  VERIFY_MINIMALIF = 8192,
54
+ /** Accept SIGHASH_FORKID or SIGHASH_LOTUS signatures */
17
55
  ENABLE_SIGHASH_FORKID = 65536,
56
+ /** Activate replay protection with different fork id */
18
57
  ENABLE_REPLAY_PROTECTION = 131072,
58
+ /** Require sigchecks in input to satisfy scriptSig length bound */
19
59
  VERIFY_INPUT_SIGCHECKS = 4194304
20
60
  }
61
+ /**
62
+ * Standard flags for client-side transaction validation.
63
+ *
64
+ * This combination matches what lotusd uses for mempool acceptance,
65
+ * ensuring crafted transactions will be accepted by the network.
66
+ */
21
67
  export declare const STANDARD_SCRIPT_VERIFY_FLAGS: number;
68
+ /**
69
+ * Script execution error codes matching lotusd ScriptError enum.
70
+ *
71
+ * These provide detailed failure reasons for script evaluation,
72
+ * enabling client-side wallets to diagnose why a transaction
73
+ * would be rejected before broadcasting.
74
+ */
22
75
  export declare enum ScriptError {
23
76
  OK = "OK",
24
77
  UNKNOWN = "UNKNOWN",
@@ -80,22 +133,88 @@ export declare enum ScriptError {
80
133
  TAPROOT_LEAF_VERSION_NOT_SUPPORTED = "TAPROOT_LEAF_VERSION_NOT_SUPPORTED",
81
134
  TAPROOT_PHASEOUT = "TAPROOT_PHASEOUT"
82
135
  }
136
+ /**
137
+ * Result of script evaluation or verification.
138
+ *
139
+ * Provides both the success/failure boolean and a detailed error code
140
+ * for diagnostics. Client-side wallets can use the error code to
141
+ * provide meaningful feedback about why a transaction would fail.
142
+ */
83
143
  export interface ScriptResult {
144
+ /** Whether the script evaluation succeeded */
84
145
  success: boolean;
146
+ /** Detailed error code (ScriptError.OK on success) */
85
147
  error: ScriptError;
86
148
  }
149
+ /**
150
+ * Metrics collected during script execution.
151
+ *
152
+ * Tracks signature check count for INPUT_SIGCHECKS validation.
153
+ */
87
154
  export interface ScriptExecutionMetrics {
155
+ /** Number of signature checks performed */
88
156
  sigChecks: number;
89
157
  }
158
+ /**
159
+ * Data generated during script execution for sighash computation.
160
+ *
161
+ * Reference: lotusd/src/script/script_exec_data.h
162
+ */
90
163
  export interface ScriptExecutionData {
164
+ /** Opcode position of the last executed OP_CODESEPARATOR */
91
165
  codeseparatorPos: number;
166
+ /** SHA-256d of the complete script being executed */
92
167
  executedScriptHash: Buffer;
93
168
  }
169
+ /**
170
+ * Interface for signature verification during script execution.
171
+ *
172
+ * Client-side implementations provide transaction context so the
173
+ * interpreter can verify signatures against the spending transaction.
174
+ *
175
+ * Reference: lotusd BaseSignatureChecker / TransactionSignatureChecker
176
+ */
94
177
  export interface SignatureChecker {
178
+ /**
179
+ * Verify a raw signature against a sighash
180
+ *
181
+ * @param signature - The raw signature bytes (without sighash byte)
182
+ * @param publicKey - The public key bytes
183
+ * @param sighash - The 32-byte sighash to verify against
184
+ * @returns true if the signature is valid
185
+ */
95
186
  verifySignature(signature: Buffer, publicKey: Buffer, sighash: Buffer): boolean;
187
+ /**
188
+ * Check a transaction signature (with sighash type byte appended)
189
+ *
190
+ * @param signature - Signature with sighash type byte
191
+ * @param publicKey - The public key bytes
192
+ * @param execdata - Script execution data for sighash computation
193
+ * @param scriptCode - The script code for sighash computation
194
+ * @param flags - Script verification flags
195
+ * @returns true if the signature is valid
196
+ */
96
197
  checkSignature(signature: Buffer, publicKey: Buffer, execdata: ScriptExecutionData | undefined, scriptCode: Buffer, flags: number): boolean;
198
+ /**
199
+ * Check OP_CHECKLOCKTIMEVERIFY constraint
200
+ *
201
+ * @param lockTime - The lock time value from the stack
202
+ * @returns true if the lock time constraint is satisfied
203
+ */
97
204
  checkLockTime(lockTime: bigint): boolean;
205
+ /**
206
+ * Check OP_CHECKSEQUENCEVERIFY constraint
207
+ *
208
+ * @param sequence - The sequence value from the stack
209
+ * @returns true if the sequence constraint is satisfied
210
+ */
98
211
  checkSequence(sequence: bigint): boolean;
99
212
  }
213
+ /**
214
+ * A no-op signature checker that always returns false.
215
+ *
216
+ * Used when evaluating scripts that should not contain signature
217
+ * operations (e.g., scriptSig evaluation in isolation).
218
+ */
100
219
  export declare const NULL_SIGNATURE_CHECKER: SignatureChecker;
101
220
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../lib/bitcore/script/interpreter/types.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAMrC,eAAO,MAAM,uBAAuB,MAAM,CAAA;AAG1C,eAAO,MAAM,kBAAkB,M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AAQD,eAAO,MAAM,sBAAsB,EAAE,gBAKpC,CAAA"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../lib/bitcore/script/interpreter/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAKrC,oDAAoD;AACpD,eAAO,MAAM,uBAAuB,MAAM,CAAA;AAE1C,uDAAuD;AACvD,eAAO,MAAM,kBAAkB,MAAM,CAAA;AAErC,iDAAiD;AACjD,eAAO,MAAM,wBAAwB,KAAK,CAAA;AAE1C,qCAAqC;AACrC,eAAO,MAAM,eAAe,QAAS,CAAA;AAErC,2DAA2D;AAC3D,eAAO,MAAM,cAAc,OAAQ,CAAA;AAEnC,qDAAqD;AACrD,eAAO,MAAM,gBAAgB,KAAK,CAAA;AAElC;;;GAGG;AACH,eAAO,MAAM,kBAAkB,YAAc,CAAA;AAE7C,kEAAkE;AAClE,eAAO,MAAM,0BAA0B,IAAI,CAAA;AAI3C;;;;;GAKG;AACH,oBAAY,WAAW;IACrB,WAAW,IAAI;IAEf,8DAA8D;IAC9D,sBAAsB,IAAS;IAE/B,gDAAgD;IAChD,6BAA6B,IAAS;IAEtC,oDAAoD;IACpD,iCAAiC,MAAS;IAE1C,yDAAyD;IACzD,iBAAiB,MAAS;IAE1B,+DAA+D;IAC/D,gBAAgB,OAAU;IAE1B,wDAAwD;IACxD,qBAAqB,QAAU;IAE/B,wDAAwD;IACxD,wBAAwB,SAAU;IAElC,mEAAmE;IACnE,sBAAsB,UAAU;CACjC;AAED;;;;;GAKG;AACH,eAAO,MAAM,4BAA4B,QAKL,CAAA;AAIpC;;;;;;GAMG;AACH,oBAAY,WAAW;IACrB,EAAE,OAAO;IACT,OAAO,YAAY;IACnB,UAAU,eAAe;IACzB,SAAS,cAAc;IAGvB,WAAW,gBAAgB;IAC3B,SAAS,cAAc;IACvB,QAAQ,aAAa;IACrB,UAAU,eAAe;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