Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
009e11c
Add minimal user-defined functions implementation (#413)
rkalis Jun 26, 2026
790d4a2
Bump version to 0.14.0-next.0
rkalis Jun 26, 2026
7bcaf86
Add SDK debugging support for user-defined functions (#418)
rkalis Jul 7, 2026
425e9bd
Add OP_SWAP OP_MUL optimisation
rkalis Jul 7, 2026
3a9b337
Add includePrerelease to debug compiler version check
rkalis Jul 7, 2026
b3471bb
Update compileString to work with in-memory import resolution
rkalis Jul 7, 2026
79efcf0
Improve pragma version handling for imported files
rkalis Jul 7, 2026
53bee23
Update docs and release notes
rkalis Jul 7, 2026
2fe3918
Bump version to 0.14.0-next.1
rkalis Jul 7, 2026
3a6cfd2
Add multi return values to user-defined functions (#423)
rkalis Jul 14, 2026
5c681ff
Global constants + inlining optimisations (#426)
rkalis Jul 23, 2026
6ec38a4
Bump version to 0.14.0-next.2
rkalis Jul 23, 2026
a5ce8c4
Add stack trace to failing require statements inside functions (#429)
rkalis Jul 28, 2026
faa73a4
Add unused modifier support to cashc (#425)
rkalis Jul 30, 2026
1903a34
Allow for simple arithmetic in global constant definitions (#431)
rkalis Jul 30, 2026
5c16940
Bump version to 0.14.0-next.3 & update release notes
rkalis Jul 30, 2026
14f7c06
Update docs to mention 'unused' parameters to buy op-cost budget
rkalis Aug 4, 2026
687f70e
Add support for importing from node_modules
rkalis Aug 6, 2026
e491f8f
Include push overhead in function inlining size check
mr-zwets Aug 6, 2026
3bef546
update dependencies
mr-zwets Aug 11, 2026
ab73981
Add support for reassigning variables inside tuple assignments (#436)
rkalis Aug 18, 2026
202ec4d
Remove old bytecode optimisation
rkalis Aug 18, 2026
0a48bbc
Add safe OP_NOT OP_NOT optimisations
rkalis Aug 18, 2026
45b3fbc
Add fixture for double negation optimisation
rkalis Aug 18, 2026
981eb07
Breaking changes to SignatureTemplate (#440)
rkalis Aug 18, 2026
61a4b6a
Bump version to 0.14.0-next.4 & update release notes
rkalis Aug 20, 2026
498b9ea
Improve compiler optimisation speed (#441)
rkalis Sep 1, 2026
ab46c49
Refactor compiler fixtures so every fixture is its own file
rkalis Sep 1, 2026
40d7e01
Fix date parsing timezone dependence issue
rkalis Sep 1, 2026
42be089
docs: add documentation for sighash flags (#421)
mr-zwets Sep 1, 2026
616996b
fix: don't throw on tx resubmission in MockNetworkProvider
rkalis Sep 1, 2026
ee2804c
fix: fix failing test after MockNetworkProvider fix
rkalis Sep 1, 2026
07a1667
feat: allow using constant and unused modifiers in tuple assignment
rkalis Sep 1, 2026
a166040
feat: make unused variables a warning rather than an error
rkalis Sep 3, 2026
7b69948
feat: add compiler warning for assignments that don't get read after
rkalis Sep 3, 2026
d17a213
Merge branch 'master' into next
rkalis Sep 15, 2026
a39275c
fix: check inputs' locking bytecode against unlocker locking bytecode…
rkalis Sep 15, 2026
3ed8b46
chore: bump version to 0.14.0-next.5 & update release notes
rkalis Sep 15, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
16 changes: 13 additions & 3 deletions .cspell.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "0.1",
"version": "0.2",
"language": "en-GB",
"words": [
"aave",
Expand All @@ -11,6 +11,7 @@
"authchain",
"anyhedge",
"anyonecanpay",
"backpointer",
"badlength",
"bchjs",
"bchreg",
Expand All @@ -31,9 +32,10 @@
"boolor",
"bytecode",
"bytesize",
"callees",
"cashaddress",
"cashc",
"cashproof",
"cashlibs",
"cashscript",
"cashtokens",
"castable",
Expand All @@ -48,11 +50,16 @@
"chipnet",
"cleanstack",
"cleanup",
"cleanups",
"remappings",
"codegen",
"cryptocurrency",
"collateralized",
"datasig",
"defi",
"deserialisation",
"destructures",
"divmod",
"docblock",
"electroncash",
"electrum",
Expand All @@ -79,7 +86,6 @@
"hashprevouts",
"hashsequence",
"hashtype",
"hashtypes",
"hodl",
"hodling",
"htlc",
Expand Down Expand Up @@ -108,6 +114,8 @@
"lshift",
"LSHIFTNUM",
"LSHIFTBIN",
"math",
"mathlib",
"mecenas",
"meep",
"minimaldata",
Expand All @@ -116,6 +124,7 @@
"n",
"narrowings",
"noncompressed",
"nonexistent",
"nonfinal",
"nonschnorr",
"nops",
Expand All @@ -130,6 +139,7 @@
"op",
"opcode",
"opcodes",
"opcost",
"opcount",
"OUTPOINTINDEX",
"OUTPOINTTXHASH",
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -108,3 +108,6 @@ typings/
manual-test.ts

.claude/

# Test fixtures that emulate installed packages (re-included despite the node_modules ignore above)
!packages/cashc/test/import-fixtures/**/node_modules/
4 changes: 3 additions & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# CLAUDE.md

NEVER stage or unstage changes, just leave them in the working directory.

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

## Project Overview
Expand Down Expand Up @@ -82,7 +84,7 @@ Shared between compiler and SDK:
- `source-map.ts` — source map encoding/decoding (format: `sl:sc:el:ec:h` per opcode, `;`-separated, with field inheritance compression)
- `bitauth-script.ts` — formats bytecode as human-readable BitAuth script (used in debugging)
- `types.ts` — shared types including `SourceTagKind`, `SourceTagEntry`
- `optimisations.ts` / `cashproof-optimisations.ts` — peephole optimization rules
- `optimisations.ts` — peephole optimization rules

## Code Conventions

Expand Down
18 changes: 0 additions & 18 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,24 +38,6 @@ When updating the grammar file in `src/grammar/CashScript.g4`, we also need to m
yarn antlr
```

### Running `cashproof`

Most of the bytecode optimisations that the `cashc` compiler uses can be verified for correctness using the [`cashproof` tool](https://github.com/EyeOfPython/cashproof). This tool needs to be installed separately by installing its dependencies using `pip` and cloning its repository from GitHub.

From there, you can run `python <cashproof_path> [filenames]` to verify that the optimisations contained in these files are provably correct.

Example:
```bash
python <cashproof_path> packages/cashc/test/cashproof/0.1.2=0.2.0.equiv
```

Note that if you want to run `cashproof` on the "main" CashScript optimisations file, you need to first extract the optimisations from the `cashc` compiler and save them in a separate file. This can be done using the following commands:

```bash
cp packages/utils/src/cashproof-optimisations.ts opt.equiv && sed -i '' '/`/d' opt.equiv
python <cashproof_path> opt.equiv
```

## cashscript

### Running tests
Expand Down
8 changes: 4 additions & 4 deletions examples/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "cashscript-examples",
"private": true,
"version": "0.13.3",
"version": "0.14.0-next.5",
"description": "Usage examples of the CashScript SDK",
"main": "p2pkh.js",
"type": "module",
Expand All @@ -12,9 +12,9 @@
},
"dependencies": {
"@bitauth/libauth": "^3.1.0-next.8",
"@types/node": "^22.17.0",
"cashc": "^0.13.3",
"cashscript": "^0.13.3",
"@types/node": "^24.13.3",
"cashc": "^0.14.0-next.5",
"cashscript": "^0.14.0-next.5",
"eslint": "^8.56.0",
"typescript": "^5.9.2"
}
Expand Down
10 changes: 5 additions & 5 deletions examples/testing-suite/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "testing-suite",
"version": "0.13.3",
"version": "0.14.0-next.5",
"description": "Example project to develop and test CashScript contracts",
"main": "index.js",
"type": "module",
Expand All @@ -18,12 +18,12 @@
},
"dependencies": {
"@bitauth/libauth": "^3.1.0-next.8",
"cashc": "^0.13.3",
"cashscript": "^0.13.3"
"cashc": "^0.14.0-next.5",
"cashscript": "^0.14.0-next.5"
},
"devDependencies": {
"tsx": "^4.20.3",
"tsx": "^4.23.12",
"typescript": "^5.9.2",
"vitest": "^4.0.15"
"vitest": "^4.1.10"
}
}
9 changes: 6 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,20 @@
"examples/testing-suite"
],
"devDependencies": {
"@types/node": "^22.17.0",
"@types/node": "^24",
"@typescript-eslint/eslint-plugin": "^7.0.0",
"@typescript-eslint/parser": "^7.0.0",
"cspell": "^9.2.0",
"cspell": "^10.0.1",
"eslint": "^8.54.0",
"eslint-config-airbnb-typescript": "^18.0.0",
"eslint-plugin-import": "^2.31.0",
"lerna": "^3.22.1",
"tsx": "^4.20.3",
"tsx": "^4.23.12",
"typescript": "^5.9.2"
},
"resolutions": {
"ws": "^8.21.3"
},
"scripts": {
"test": "lerna run test --ignore cashscript-examples --ignore testing-suite",
"lint": "lerna run lint --ignore cashscript-examples --ignore testing-suite",
Expand Down
17 changes: 8 additions & 9 deletions packages/cashc/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cashc",
"version": "0.13.3",
"version": "0.14.0-next.5",
"description": "Compile Bitcoin Cash contracts to Bitcoin Cash Script or artifacts",
"keywords": [
"bitcoin",
Expand Down Expand Up @@ -48,21 +48,20 @@
},
"dependencies": {
"@bitauth/libauth": "^3.1.0-next.8",
"@cashscript/utils": "^0.13.3",
"@cashscript/utils": "^0.14.0-next.5",
"antlr4": "^4.13.2",
"commander": "^14.0.0",
"semver": "^7.7.2"
"semver": "^7.8.5"
},
"devDependencies": {
"@types/node": "^22.17.0",
"@types/semver": "^7.7.0",
"@vitest/coverage-v8": "^4.0.15",
"cpy-cli": "^5.0.0",
"@types/node": "^24.13.3",
"@types/semver": "^7.8.0",
"@vitest/coverage-v8": "^4.1.10",
"eslint": "^8.54.0",
"eslint-plugin-import": "^2.31.0",
"tsx": "^4.20.3",
"tsx": "^4.23.12",
"typescript": "^5.9.2",
"vitest": "^4.0.15"
"vitest": "^4.1.10"
},
"gitHead": "bf02a4b641d5d03c035d052247a545109c17b708"
}
Loading
Loading