Skip to main content

Release Notes

Release notes summarise each release. The changelog has the full details.

v2.0.0​

  • Major release: the SDK moves to libnexa-ts v4 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 as pragma nexscript ^1.2.0, need ^2.0.0 to compile
  • Add for loops with literal bounds, unrolled at compile time, with break and continue. for, break and continue are now reserved words
  • Add merkleRoot() using OP_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 a signers bitfield of the keys that signed, which the SDK's multisigSigners() 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.age and tx.time literals and constants are range-checked: a larger tx.age value 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 int conversions (casts, group indexes, hasAuthority, token and null-data outputs) produce the same bytes under both rules, and within() compiles to comparisons instead of OP_WITHIN
  • Breaking: recompiling changes the bytecode and address of contracts that use == or != on bools, the token fields of tx.outputs[i], within(), sized int casts, 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() and TransactionBuilder.addReadOnlyInput()
  • Breaking: the SDK's TransactionBuilder.build() throws OutputSatoshisTooSmallError for 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, and McpContract.execute() always running the first function and failing on checkSig
  • Interpreter: runs every opcode nexc emits and verifies script template spends as the node does (verifyTemplateSpend()). prepareTemplateSpend() sets one up for the step debugger, and the first error now ends a DebugSession. ScriptMachine and DebugSession fail 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 map nexc puts in artifacts
  • Add tx.inputs[i].type and tx.outputs[i].type: whether an input is spent or read-only, and whether an output is locked with a script template
  • Add tokenAuthority on inputs and outputs, the hasAuthority() function and the AUTHORITY_* constants for checking token authorities
  • Add grouped new LockingBytecodeP2ST(templateHash, constraintHash, visibleParams, groupId, amount) for token and authority outputs; an empty groupId builds an ungrouped output, so a covenant can forward any input
  • Breaking: token introspection uses OP_PARSE. tokenGroupId returns the full group ID including subgroup data, tokenSubgroupId is replaced by tokenParentGroupId, and tokenAmount is 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, -2 and 118, 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: ElectrumNetworkProvider is 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-ts v3 for transactions, signing, scripts and addresses, replacing nexcore-lib and @bitauth/libauth
  • Breaking: ElectrumNetworkProvider without an explicit network reads the NETWORK environment variable and defaults to regtest
  • Breaking: send() returns a libnexa-ts ITransaction, and unlocker callbacks receive a libnexa-ts TransactionBuilder
  • Remove the merkleRoot macro, to be replaced by one using OP_MERKLEROOT
  • Fix price oracle signing byte order and minimal encoding of 0 in encodeNumber
  • 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 encodeNumber and encodeData global functions for minimal encoding of numbers and data, best used with new LockingBytecodeP2ST
  • Add merkleRoot macro 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 TransactionBuilder class 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.