@neuraiproject/neurai-scripts 0.5.0 → 0.6.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.
@@ -101,6 +101,14 @@ export declare const OP_CHECKSIG = 172;
101
101
  export declare const OP_CHECKSIGVERIFY = 173;
102
102
  export declare const OP_CHECKMULTISIG = 174;
103
103
  export declare const OP_CHECKMULTISIGVERIFY = 175;
104
+ export declare const OP_KECCAK256 = 186;
105
+ export declare const OP_BLAKE2B = 187;
106
+ export declare const OP_BLAKE3 = 200;
107
+ export declare const OP_POSEIDON = 201;
108
+ export declare const OP_SHA3_256 = 202;
109
+ export declare const OP_SHA512 = 203;
110
+ export declare const OP_CHECKSIG_ED25519 = 221;
111
+ export declare const OP_CHECKSIGADD = 222;
104
112
  export declare const OP_NOP1 = 176;
105
113
  export declare const OP_NOP9 = 184;
106
114
  export declare const OP_NOP10 = 185;
@@ -122,6 +130,9 @@ export declare const OP_REFINPUTFIELD = 210;
122
130
  export declare const OP_REFINPUTASSETFIELD = 211;
123
131
  export declare const OP_REFINPUTCOUNT = 212;
124
132
  export declare const OP_OUTPUTAUTHCOMMITMENT = 213;
133
+ export declare const OP_INPUTVALUE = 214;
134
+ export declare const OP_CHAINCONTEXT = 215;
135
+ export declare const OP_CHECKMERKLEINCLUSION = 193;
125
136
  export declare const OP_CAT = 126;
126
137
  export declare const OP_SPLIT = 183;
127
138
  export declare const OP_REVERSEBYTES = 188;
package/dist/index.cjs CHANGED
@@ -155,6 +155,26 @@ const OP_CHECKSIG = 0xac;
155
155
  const OP_CHECKSIGVERIFY = 0xad;
156
156
  const OP_CHECKMULTISIG = 0xae;
157
157
  const OP_CHECKMULTISIGVERIFY = 0xaf;
158
+ // ---------- Extended hash opcodes ----------
159
+ // NIP-030: KECCAK256 / BLAKE2B in previously unassigned slots.
160
+ const OP_KECCAK256 = 0xba;
161
+ const OP_BLAKE2B = 0xbb;
162
+ // NIP-034a: modern hash opcodes (BLAKE3, SHA3-256, SHA-512).
163
+ // NIP-036: OP_POSEIDON — SNARK-friendly Poseidon hash over the BN254
164
+ // scalar field. Occupies slot 0xc9.
165
+ const OP_BLAKE3 = 0xc8;
166
+ const OP_POSEIDON = 0xc9;
167
+ const OP_SHA3_256 = 0xca;
168
+ const OP_SHA512 = 0xcb;
169
+ // ---------- Extended signature opcodes ----------
170
+ // NIP-035: strict-profile RFC 8032 PureEd25519 verifier in slot 0xdd.
171
+ // Stack contract: (sig64, msg, pubkey32 -- 0|1). Slots 0xd8..0xdc are
172
+ // reserved by NIP-033 (BLS12-381 family), unassigned in current code.
173
+ const OP_CHECKSIG_ED25519 = 0xdd;
174
+ // NIP-039: generic OP_CHECKSIG-compatible signature accumulator in slot
175
+ // 0xde. Stack contract: (sig, count, pubkey -- count + 0|1). Works with
176
+ // both legacy secp256k1 and PQ ML-DSA-44 keys via CPubKey::Verify().
177
+ const OP_CHECKSIGADD = 0xde;
158
178
  // ---------- Expansion / NOPs ----------
159
179
  // Only the NOPs not aliased by DePIN-Test opcodes are exported as NOPs.
160
180
  // OP_NOP2 == OP_CHECKLOCKTIMEVERIFY (0xb1)
@@ -194,6 +214,17 @@ const OP_REFINPUTCOUNT = 0xd4;
194
214
  // scriptPubKey. Symmetric to TXFIELD_AUTHSCRIPT_COMMITMENT for inputs;
195
215
  // ignores any trailing OP_XNA_ASSET asset wrapper bytes.
196
216
  const OP_OUTPUTAUTHCOMMITMENT = 0xd5;
217
+ // ---------- Input value introspection (NIP-024) ----------
218
+ // Pushes the satoshi value of a selected input's spent prevout.
219
+ const OP_INPUTVALUE = 0xd6;
220
+ // ---------- Chain context introspection (NIP-026) ----------
221
+ // Pushes chain-context fields (block height, median time, etc.) selected
222
+ // by a single-byte selector consumed from the stack.
223
+ const OP_CHAINCONTEXT = 0xd7;
224
+ // ---------- Merkle inclusion (NIP-031) ----------
225
+ // Native Merkle inclusion verifier. Consumes (leaf, scheme_id, proof,
226
+ // root) and pushes a boolean. Flag off → bad-opcode.
227
+ const OP_CHECKMERKLEINCLUSION = 0xc1;
197
228
  // ---------- Byte manipulation (DePIN-Test) ----------
198
229
  const OP_CAT = 0x7e;
199
230
  const OP_SPLIT = 0xb7;
@@ -268,16 +299,22 @@ var opcodes = /*#__PURE__*/Object.freeze({
268
299
  OP_9: OP_9,
269
300
  OP_ABS: OP_ABS,
270
301
  OP_ADD: OP_ADD,
302
+ OP_BLAKE2B: OP_BLAKE2B,
303
+ OP_BLAKE3: OP_BLAKE3,
271
304
  OP_BOOLAND: OP_BOOLAND,
272
305
  OP_BOOLOR: OP_BOOLOR,
273
306
  OP_CAT: OP_CAT,
307
+ OP_CHAINCONTEXT: OP_CHAINCONTEXT,
274
308
  OP_CHECKLOCKTIMEVERIFY: OP_CHECKLOCKTIMEVERIFY,
309
+ OP_CHECKMERKLEINCLUSION: OP_CHECKMERKLEINCLUSION,
275
310
  OP_CHECKMULTISIG: OP_CHECKMULTISIG,
276
311
  OP_CHECKMULTISIGVERIFY: OP_CHECKMULTISIGVERIFY,
277
312
  OP_CHECKSEQUENCEVERIFY: OP_CHECKSEQUENCEVERIFY,
278
313
  OP_CHECKSIG: OP_CHECKSIG,
314
+ OP_CHECKSIGADD: OP_CHECKSIGADD,
279
315
  OP_CHECKSIGFROMSTACK: OP_CHECKSIGFROMSTACK,
280
316
  OP_CHECKSIGVERIFY: OP_CHECKSIGVERIFY,
317
+ OP_CHECKSIG_ED25519: OP_CHECKSIG_ED25519,
281
318
  OP_CHECKTEMPLATEVERIFY: OP_CHECKTEMPLATEVERIFY,
282
319
  OP_CODESEPARATOR: OP_CODESEPARATOR,
283
320
  OP_DEPTH: OP_DEPTH,
@@ -298,6 +335,8 @@ var opcodes = /*#__PURE__*/Object.freeze({
298
335
  OP_IFDUP: OP_IFDUP,
299
336
  OP_INPUTASSETFIELD: OP_INPUTASSETFIELD,
300
337
  OP_INPUTCOUNT: OP_INPUTCOUNT,
338
+ OP_INPUTVALUE: OP_INPUTVALUE,
339
+ OP_KECCAK256: OP_KECCAK256,
301
340
  OP_LESSTHAN: OP_LESSTHAN,
302
341
  OP_LESSTHANOREQUAL: OP_LESSTHANOREQUAL,
303
342
  OP_MAX: OP_MAX,
@@ -322,6 +361,7 @@ var opcodes = /*#__PURE__*/Object.freeze({
322
361
  OP_OUTPUTVALUE: OP_OUTPUTVALUE,
323
362
  OP_OVER: OP_OVER,
324
363
  OP_PICK: OP_PICK,
364
+ OP_POSEIDON: OP_POSEIDON,
325
365
  OP_PUSHDATA1: OP_PUSHDATA1,
326
366
  OP_PUSHDATA2: OP_PUSHDATA2,
327
367
  OP_PUSHDATA4: OP_PUSHDATA4,
@@ -336,6 +376,8 @@ var opcodes = /*#__PURE__*/Object.freeze({
336
376
  OP_ROT: OP_ROT,
337
377
  OP_SHA1: OP_SHA1,
338
378
  OP_SHA256: OP_SHA256,
379
+ OP_SHA3_256: OP_SHA3_256,
380
+ OP_SHA512: OP_SHA512,
339
381
  OP_SIZE: OP_SIZE,
340
382
  OP_SPLIT: OP_SPLIT,
341
383
  OP_SUB: OP_SUB,