Release Notes
Release notes summarise each release. The changelog has the full details.
v2.0.0
- Major release: the SDK moves to
libnexa-tsv4 and takes and returns its objects (keys, transactions, transaction builders), so apps must move to v4 too (see the migration guide). It needs Node.js 22.18 or later. Contracts that declare a 1.x version, such aspragma nexscript ^1.2.0, need^2.0.0to compile - Add
forloops with literal bounds, unrolled at compile time, withbreakandcontinue.for,breakandcontinueare now reserved words - Add
merkleRoot()usingOP_MERKLEROOT, and merkle tree and proof helpers in@nexscript/utils - Add
new LockingBytecodeP2PKT(pkConstraintHash, groupId, amount)for token outputs to an address - Fix
checkMultiSig, which could never succeed on Nexa. It takes asignersbitfield of the keys that signed, which the SDK'smultisigSigners()computes - A contract over the node's script template limits (100,000 bytes or 50,000 ops), or over 10,000 bytes in an MCP bundle, is a compile error, and so is a function with a path that runs no
require() tx.ageandtx.timeliterals and constants are range-checked: a largertx.agevalue made the node skip the check. Move funds out of contracts that no longer compile- Contracts compiled now give the same result before and after upgrade2: sized
intconversions (casts, group indexes,hasAuthority, token and null-data outputs) produce the same bytes under both rules, andwithin()compiles to comparisons instead ofOP_WITHIN - Breaking: recompiling changes the bytecode and address of contracts that use
==or!=on bools, the token fields oftx.outputs[i],within(), sizedintcasts, group indexes,hasAuthority, grouped P2PKT or P2ST outputs,LockingBytecodeNullData,checkMultiSig, constructor parameters in an MCP bundle, or a visible parameter declared before a hidden one. Several of these fix contracts that could be spent without meeting their conditions, so move funds to the recompiled contract. To spend from an old address, keep the original artifact and the SDK version that funded it (your lockfile): the SDK derives MCP addresses itself, so for an MCP with constructor parameters the same artifact gives a new address under 2.0.0. Check that the derived address matches the funded one before moving funds - SDK: read-only inputs, with
Transaction.fromReadOnly()andTransactionBuilder.addReadOnlyInput() - Breaking: the SDK's
TransactionBuilder.build()throwsOutputSatoshisTooSmallErrorfor a token output under 546 satoshis, which it used to raise to 546 - SDK: fix token outputs losing satoshis above 546 to the fee,
withAge()not setting the sequence, andMcpContract.execute()always running the first function and failing oncheckSig - Interpreter: runs every opcode
nexcemits and verifies script template spends as the node does (verifyTemplateSpend()).prepareTemplateSpend()sets one up for the step debugger, and the first error now ends aDebugSession.ScriptMachineandDebugSessionfail on scripts over 10,000 bytes by default (maxScriptSize)
v1.2.0-beta.1
- Add
@nexscript/interpreter, a Nexa script interpreter and step debugger that uses the debug mapnexcputs in artifacts - Add
tx.inputs[i].typeandtx.outputs[i].type: whether an input is spent or read-only, and whether an output is locked with a script template - Add
tokenAuthorityon inputs and outputs, thehasAuthority()function and theAUTHORITY_*constants for checking token authorities - Add grouped
new LockingBytecodeP2ST(templateHash, constraintHash, visibleParams, groupId, amount)for token and authority outputs; an emptygroupIdbuilds an ungrouped output, so a covenant can forward any input - Breaking: token introspection uses
OP_PARSE.tokenGroupIdreturns the full group ID including subgroup data,tokenSubgroupIdis replaced bytokenParentGroupId, andtokenAmountis 0 for authorities. Contracts using these change their bytecode and address - Fix compiled contracts being rejected by the node with "Data push larger than necessary" (a regression in v1.1.0). Funds sent to an affected contract compiled with v1.1.0 or v1.1.1 cannot be spent
- Fix ASM conversion of numbers such as
-1,-2and118, which became opcodes since v1.1.0 - SDK: fix transactions with both token and plain outputs, passing on an authority from a contract, and sending part of a token from manually selected inputs
- SDK:
ElectrumNetworkProvideris faster (a single client instead of a polling cluster) and lists each UTXO once
v1.1.1
- Fix the first function of a multi-function contract disappearing from compiled ASM
- Test environment fixes for running against a clean regtest chain
v1.1.0
- Move to
libnexa-tsv3 for transactions, signing, scripts and addresses, replacingnexcore-liband@bitauth/libauth - Breaking:
ElectrumNetworkProviderwithout an explicit network reads theNETWORKenvironment variable and defaults to regtest - Breaking:
send()returns alibnexa-tsITransaction, and unlocker callbacks receive alibnexa-tsTransactionBuilder - Remove the
merkleRootmacro, to be replaced by one usingOP_MERKLEROOT - Fix price oracle signing byte order and minimal encoding of
0inencodeNumber - Tests use Vitest against a regtest node, and run in GitLab CI
v1.0.4
- Map opcodes to the function or member call they come from, for debugging in the playground
v1.0.3
- Fix token amount and group introspection, now using
OP_PARSE - Temporarily disable
tx.inputs[i].visibleParameters - Add search and a link to the playground to the documentation
- Use nexad 2.1.0.0 in tests
v1.0.2
- Use testnet-explorer.nexa.org as a rostrum testnet server
- Fix a typos in the README.md file
- Fix shields.io badges for the @nexscript/nexscript package
- Update rostrum Docker file to use the latest nightly version
v1.0.1
- Use bitauth 2.1.0
- Update jest docker files to use nexad 1.4.0.1 and rostrum 10.0.0
- Improve docker compose configuration
- Use the correct nexa derivation path in nexscript tests suite
v1.0.0
- Add new
encodeNumberandencodeDataglobal functions for minimal encoding of numbers and data, best used withnew LockingBytecodeP2ST - Add
merkleRootmacro which computes the Merkle root from a serialized proof, leaf hash and leaf index (removed in v1.1.0)
v0.9.0
- Add new advanced
TransactionBuilderclass that allows combining UTXOs from multiple different smart contracts and P2PKT UTXOs in a single transaction.
v0.8.0
- Add merkle tools: ability to derive a compact proof of a next added element, expand proof, etc.
- Fix MAST contracts at terminal laeves being unspendable
v0.7.0
- Add support for multiplex contracts (see documentation)
- Minor breaking: changed MCP contract syntax
v0.6.1
- Fix several issues in documentation
- Update electrum cash version
v0.6.0
- Implement MAST Contract Paths concept (see documentation)
v0.5.0
-
Add support for group tokens in nexscript SDK
-
Bugfix: Fix tx state code generation for non-literal parameters
v0.4.0
- Bugfix: Fix contract unused parameterss ordering
v0.3.0
- Add additional introspection operations using OP_PUSH_TX_STATE: tx.groupAmountIn, tx.groupAmountOut, tx.groupCountIn, tx.groupCountOut, tx.groupNthInput, tx.groupNthOutput
v0.2.0
- Add token introspection emulation: tokenGroupId, tokenSubgroupId, subgroupData, tokenAmount, visibleParameters
v0.1.3
- Support 'unused' modifier for visible contract parameters
v0.1.2
- Implement LockingBytecodeP2ST in a general form, supporting empty constraints and visible arguments
v0.1.1
- Add currency aliases: nexa, mnexa, mex
v0.1.0
- 🎉 Initial release.