@neuraiproject/neurai-scripts 0.5.1 → 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.
- package/dist/NeuraiScripts.global.js +42 -0
- package/dist/NeuraiScripts.global.js.map +1 -1
- package/dist/browser.js +42 -0
- package/dist/browser.js.map +1 -1
- package/dist/core/opcodes.d.ts +11 -0
- package/dist/index.cjs +42 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +42 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -153,6 +153,26 @@ const OP_CHECKSIG = 0xac;
|
|
|
153
153
|
const OP_CHECKSIGVERIFY = 0xad;
|
|
154
154
|
const OP_CHECKMULTISIG = 0xae;
|
|
155
155
|
const OP_CHECKMULTISIGVERIFY = 0xaf;
|
|
156
|
+
// ---------- Extended hash opcodes ----------
|
|
157
|
+
// NIP-030: KECCAK256 / BLAKE2B in previously unassigned slots.
|
|
158
|
+
const OP_KECCAK256 = 0xba;
|
|
159
|
+
const OP_BLAKE2B = 0xbb;
|
|
160
|
+
// NIP-034a: modern hash opcodes (BLAKE3, SHA3-256, SHA-512).
|
|
161
|
+
// NIP-036: OP_POSEIDON — SNARK-friendly Poseidon hash over the BN254
|
|
162
|
+
// scalar field. Occupies slot 0xc9.
|
|
163
|
+
const OP_BLAKE3 = 0xc8;
|
|
164
|
+
const OP_POSEIDON = 0xc9;
|
|
165
|
+
const OP_SHA3_256 = 0xca;
|
|
166
|
+
const OP_SHA512 = 0xcb;
|
|
167
|
+
// ---------- Extended signature opcodes ----------
|
|
168
|
+
// NIP-035: strict-profile RFC 8032 PureEd25519 verifier in slot 0xdd.
|
|
169
|
+
// Stack contract: (sig64, msg, pubkey32 -- 0|1). Slots 0xd8..0xdc are
|
|
170
|
+
// reserved by NIP-033 (BLS12-381 family), unassigned in current code.
|
|
171
|
+
const OP_CHECKSIG_ED25519 = 0xdd;
|
|
172
|
+
// NIP-039: generic OP_CHECKSIG-compatible signature accumulator in slot
|
|
173
|
+
// 0xde. Stack contract: (sig, count, pubkey -- count + 0|1). Works with
|
|
174
|
+
// both legacy secp256k1 and PQ ML-DSA-44 keys via CPubKey::Verify().
|
|
175
|
+
const OP_CHECKSIGADD = 0xde;
|
|
156
176
|
// ---------- Expansion / NOPs ----------
|
|
157
177
|
// Only the NOPs not aliased by DePIN-Test opcodes are exported as NOPs.
|
|
158
178
|
// OP_NOP2 == OP_CHECKLOCKTIMEVERIFY (0xb1)
|
|
@@ -192,6 +212,17 @@ const OP_REFINPUTCOUNT = 0xd4;
|
|
|
192
212
|
// scriptPubKey. Symmetric to TXFIELD_AUTHSCRIPT_COMMITMENT for inputs;
|
|
193
213
|
// ignores any trailing OP_XNA_ASSET asset wrapper bytes.
|
|
194
214
|
const OP_OUTPUTAUTHCOMMITMENT = 0xd5;
|
|
215
|
+
// ---------- Input value introspection (NIP-024) ----------
|
|
216
|
+
// Pushes the satoshi value of a selected input's spent prevout.
|
|
217
|
+
const OP_INPUTVALUE = 0xd6;
|
|
218
|
+
// ---------- Chain context introspection (NIP-026) ----------
|
|
219
|
+
// Pushes chain-context fields (block height, median time, etc.) selected
|
|
220
|
+
// by a single-byte selector consumed from the stack.
|
|
221
|
+
const OP_CHAINCONTEXT = 0xd7;
|
|
222
|
+
// ---------- Merkle inclusion (NIP-031) ----------
|
|
223
|
+
// Native Merkle inclusion verifier. Consumes (leaf, scheme_id, proof,
|
|
224
|
+
// root) and pushes a boolean. Flag off → bad-opcode.
|
|
225
|
+
const OP_CHECKMERKLEINCLUSION = 0xc1;
|
|
195
226
|
// ---------- Byte manipulation (DePIN-Test) ----------
|
|
196
227
|
const OP_CAT = 0x7e;
|
|
197
228
|
const OP_SPLIT = 0xb7;
|
|
@@ -266,16 +297,22 @@ var opcodes = /*#__PURE__*/Object.freeze({
|
|
|
266
297
|
OP_9: OP_9,
|
|
267
298
|
OP_ABS: OP_ABS,
|
|
268
299
|
OP_ADD: OP_ADD,
|
|
300
|
+
OP_BLAKE2B: OP_BLAKE2B,
|
|
301
|
+
OP_BLAKE3: OP_BLAKE3,
|
|
269
302
|
OP_BOOLAND: OP_BOOLAND,
|
|
270
303
|
OP_BOOLOR: OP_BOOLOR,
|
|
271
304
|
OP_CAT: OP_CAT,
|
|
305
|
+
OP_CHAINCONTEXT: OP_CHAINCONTEXT,
|
|
272
306
|
OP_CHECKLOCKTIMEVERIFY: OP_CHECKLOCKTIMEVERIFY,
|
|
307
|
+
OP_CHECKMERKLEINCLUSION: OP_CHECKMERKLEINCLUSION,
|
|
273
308
|
OP_CHECKMULTISIG: OP_CHECKMULTISIG,
|
|
274
309
|
OP_CHECKMULTISIGVERIFY: OP_CHECKMULTISIGVERIFY,
|
|
275
310
|
OP_CHECKSEQUENCEVERIFY: OP_CHECKSEQUENCEVERIFY,
|
|
276
311
|
OP_CHECKSIG: OP_CHECKSIG,
|
|
312
|
+
OP_CHECKSIGADD: OP_CHECKSIGADD,
|
|
277
313
|
OP_CHECKSIGFROMSTACK: OP_CHECKSIGFROMSTACK,
|
|
278
314
|
OP_CHECKSIGVERIFY: OP_CHECKSIGVERIFY,
|
|
315
|
+
OP_CHECKSIG_ED25519: OP_CHECKSIG_ED25519,
|
|
279
316
|
OP_CHECKTEMPLATEVERIFY: OP_CHECKTEMPLATEVERIFY,
|
|
280
317
|
OP_CODESEPARATOR: OP_CODESEPARATOR,
|
|
281
318
|
OP_DEPTH: OP_DEPTH,
|
|
@@ -296,6 +333,8 @@ var opcodes = /*#__PURE__*/Object.freeze({
|
|
|
296
333
|
OP_IFDUP: OP_IFDUP,
|
|
297
334
|
OP_INPUTASSETFIELD: OP_INPUTASSETFIELD,
|
|
298
335
|
OP_INPUTCOUNT: OP_INPUTCOUNT,
|
|
336
|
+
OP_INPUTVALUE: OP_INPUTVALUE,
|
|
337
|
+
OP_KECCAK256: OP_KECCAK256,
|
|
299
338
|
OP_LESSTHAN: OP_LESSTHAN,
|
|
300
339
|
OP_LESSTHANOREQUAL: OP_LESSTHANOREQUAL,
|
|
301
340
|
OP_MAX: OP_MAX,
|
|
@@ -320,6 +359,7 @@ var opcodes = /*#__PURE__*/Object.freeze({
|
|
|
320
359
|
OP_OUTPUTVALUE: OP_OUTPUTVALUE,
|
|
321
360
|
OP_OVER: OP_OVER,
|
|
322
361
|
OP_PICK: OP_PICK,
|
|
362
|
+
OP_POSEIDON: OP_POSEIDON,
|
|
323
363
|
OP_PUSHDATA1: OP_PUSHDATA1,
|
|
324
364
|
OP_PUSHDATA2: OP_PUSHDATA2,
|
|
325
365
|
OP_PUSHDATA4: OP_PUSHDATA4,
|
|
@@ -334,6 +374,8 @@ var opcodes = /*#__PURE__*/Object.freeze({
|
|
|
334
374
|
OP_ROT: OP_ROT,
|
|
335
375
|
OP_SHA1: OP_SHA1,
|
|
336
376
|
OP_SHA256: OP_SHA256,
|
|
377
|
+
OP_SHA3_256: OP_SHA3_256,
|
|
378
|
+
OP_SHA512: OP_SHA512,
|
|
337
379
|
OP_SIZE: OP_SIZE,
|
|
338
380
|
OP_SPLIT: OP_SPLIT,
|
|
339
381
|
OP_SUB: OP_SUB,
|