CashScript is a high-level programming language for smart contracts on Bitcoin Cash. Maintained by @RoscoKalis and @GeukensMathieu

Joined December 2022
Include

Only show posts containing:

Exclude

Hide posts containing:

Time range
-
Minimum likes
Full scope, roadmap and compensation breakdown on the campaign page. Every pledge and every share helps 💚 flipstarter.cashscript.org/e…
1
3
38
✅ Formal verification: we're starting with a new version of CashProof to formally verify the compiler's optimisations. Long term, we expect formal verification to become an essential part of contract development, so we'll keep expanding our tooling for it.
1
2
13
⚙️ Typesafe inline assembly lets you hand-write parts of a contract while the compiler tracks the stack and checks types. Together with new optimisations, CashScript contracts can match handwritten script. No excuses left, script wizards 🧙
1
2
15
🧱 Structs let you define structured data once and access its fields by name, with the SDK handling encoding & decoding. That's a big deal for contract systems like Moria and ParyonUSD that share state through NFT commitments.
1
2
16
Doubling our time commitment last year paid off. We delivered our main goals (loops & functions) and more: • 7 releases + 8 prereleases • 64 issues closed • npm downloads more than doubled (14.9k → 31.4k a year) • New Contract Design docs & guides
1
2
17
The CashScript Flipstarter for 2026-27 is live! Last year we shipped loops and functions for the 2026 upgrade. Next up: 🧱 Structs ⚙️ Typesafe inline assembly ✅ Formal verification Help fund another year of BCH smart contract tooling 👇 flipstarter.cashscript.org/e…
1
4
2
7
462
CashScript retweeted
Few people know Bitcoin Cash has smart contracts that are easy to write. The language is called @CashScriptBCH . It has been around since 2019, it looks like Solidity, and it compiles down to the native scripting system that already runs on Bitcoin Cash. No sidechain, no virtual machine bolted on top, no bridge holding your money while the contract executes. Here is a complete escrow contract: pragma cashscript ^0.14.0; contract TransferWithTimeout(pubkey sender, pubkey recipient, int timeout) { function transfer(sig recipientSig) { require(checkSig(recipientSig, recipient)); } function timeout(sig senderSig) { require(checkSig(senderSig, sender)); require(tx.time >= timeout); } } Two ways to spend. The recipient can take the money whenever they sign. The sender can take it back after the timeout. That is a working escrow, and it fits in a screenshot. WHAT MAKES IT DIFFERENT FROM SOLIDITY CashScript borrows Solidity's syntax and almost none of its problems. On Ethereum, a contract is an account with storage that lives forever. On Bitcoin Cash, a contract is an address that holds coins and nothing else. There is no stored state to corrupt, no self-destruct, no delegatecall, and no reentrancy, because there is nothing to re-enter. A transaction either satisfies the contract's conditions or it does not, and every node checks that in isolation. There is also no gas. You pay a fee based on the size of the transaction, not on a computation budget that can spike while you are waiting. A contract that costs a fraction of a cent to use is arithmetic. WHAT CHANGED THIS YEAR Bitcoin Cash activated four upgrades in May 2026 under the name Layla, and they matter directly to anyone writing CashScript. Bounded loops arrived. Before, if a contract needed to check five outputs, you wrote the same verification logic five times. Now you write it once and loop. Functions arrived as well, so shared validation lives in one place. Bitwise operations came back, which lets a contract pack several permissions into a single token commitment and check one bit instead of comparing whole values. And Pay to Script made contract outputs a standard type, instead of a wrapper the rest of the network had to work around. The tooling followed. The compiler learned loops, the new bitwise operators and Pay to Script first. Then came reusable functions with multiple return values, imports so contracts can share code across files, global constants, and stack traces when a function fails. The practical difference is not cosmetic. One team rebuilding a prediction market contract collapsed pages of duplicated verification into a loop with a variable offset. More importantly, batch operations became possible: multiple buyers in one transaction, where before the contract hardcoded one. WHAT IS ALREADY BUILT This is not a proposal. Contracts written in CashScript are holding real money today. @BCH_BULL is the clearest example. It is a consumer app for leveraged long, short and hedge positions on BCH against dollars, gold, BTC and other assets, at up to 7.77x leverage, with no custodian. Every position is its own smart contract, generated on demand, and those contracts come from AnyHedge, which is written in CashScript. @ParyonUSD , the collateralised stablecoin, runs on 26 separate CashScript contracts. They are open source under an MIT licence, published to npm as a package other developers can import, and they have been through two external audits, the first delivered in three passes. Borrowing, redemption, liquidation and a stability pool are all enforced by script on the base layer. The same pattern shows up across the ecosystem. FundTokens runs on 20 CashScript contracts. Paytaca use it for escrow in peer to peer trades, where two strangers need a rule instead of a middleman. Tapswap uses it for non-custodial token sale offers. Bitcats Heroes, Cash-Ninjas and BCH PUMP all ship contracts written in it, for NFTs and token launches. One honest note on the ceiling. Cauldron, the main DEX on BCH, is written in raw Script rather than CashScript, and its constant product contract is a stack of opcodes that most developers would not want to hand-write. That route stays open for teams that need it. CashScript is the layer above, and its own documentation ships a version of that same DEX contract rewritten in the high-level language. WHY THIS MATTERS MORE THAN IT SOUNDS Every other ecosystem solves programmability by adding a layer. A rollup, a sidechain, a bridge, a sequencer. Each one is a new system with its own bugs, its own trust assumptions and its own operators. Bitcoin Cash solves it inside the transaction. A CashScript contract is just a locking script, and the coins in it are protected by the same proof-of-work as every other coin on the chain. There is no second system to audit, because the contract is the system. The code is short because the model removes entire categories of failure before you write a line. WHERE IT GOES NEXT The interesting shift is what developers can now build without leaving the base layer. Loops and functions turn a contract from a fixed decision tree into something that can iterate over a batch. Bitwise operations turn a token commitment into a compact permission record. Pay to Script shrinks the cost of the outputs those contracts create. Put together, that is the toolset for order books, vesting schedules, escrows with arbiters, recurring payments, and lending markets that settle atomically. Bitcoin Cash is programmable bitcoin. bitcoin-cash:native
2
13
1
36
975
Replying to @Lightswarm
Thank you for the significant contribution to this release Jerry 🫡💪
5
22
v0.14.0: ✨ Reusable functions, globals, and imports ✨ xitter.cf/CashScriptBCH/status/2…
CashScript v0.14.0 was just released! What's new? 🧩 Reusable functions 📌 Global constants 📚 Imports & shareable libraries 🐞 Stack traces when debugging 🛡️ Safer transaction testing
2
14
Make sure to join our Telegram channel to keep up with active development, and let us know what you build with functions! 👇 t.me/CashScriptBCH
4
53
v0.14.0 contains a number of breaking changes, so please refer to the migration guide below 👇 cashscript.org/docs/releases…
1
4
51
These are just the highlights, but there's much more in this release, including new optimisations, faster compilation for large contracts and the new 'unused' modifier. For the full list of changes, please refer to the release notes 👇 cashscript.org/docs/releases…
1
4
29
5/ Safer testing The MockNetworkProvider now validates every transaction against the BCH VM, using the real locking bytecode of the spent UTXOs. So invalid transactions fail in your tests, not when you broadcast them.
1
5
45
4/ Debugging with stack traces Our debugging tools fully support user-defined functions. When a require fails inside a function, you get the exact file and line that failed, plus a stack trace of the calls that led there.
1
5
47
3/ Imports Functions and constants can now live in separate files and be imported, even from npm packages. This opens the door to shared CashScript libraries. Here's the contract from 1/ with its helpers moved into a library file. It compiles to the exact same bytecode.
1
2
2
11
524
2/ Global constants No more magic numbers or extra constructor arguments for fixed values. Declare constants at the top level of your file, with arithmetic and concatenation evaluated at compile time.
1
6
51
1/ Reusable functions We teased them last release, and here they are! Define functions at the top level of your file, with one, multiple or no return values. The compiler uses BCH's native OP_DEFINE/OP_INVOKE from the Layla upgrade, or inlines them when that's smaller.
1
3
14
151
CashScript v0.14.0 was just released! What's new? 🧩 Reusable functions 📌 Global constants 📚 Imports & shareable libraries 🐞 Stack traces when debugging 🛡️ Safer transaction testing
2
16
3
35
1,204
DeFi is happening on Bitcoin Cash/ $BCH! @RoscoKalis
Our latest episode is here. Forks and Reunions. As always, there is no time limit and this is another epic installment. Grab some snacks and get stuck in. The guests are none other than @cculianu is the creator of Fulcrum, an efficient privacy-preserving SPV client and a pro science carnivore. @stevethurmond is the most ardent advocate for Cash Stamps and believes Bitcoin was designed as a peer-to-peer electronic cash system and actively promotes Bitcoin Cash as fulfilling that vision There are also a host of other guests that drop in during this marathon. They discuss 👑The Evolution of Bitcoin Cash bitcoin-cash:native 👑The Problem with IOU Systems like Lightning 👑The Changing Culture of Bitcoin Cash 👑The Difficulty of Recreating bitcoin:native's Genesis 👑The End of Crypto-Friendly Spaces in Europe youtube.com/live/SJkwCaQLRuc…
2
10
2
32
2,610
We just upgraded the developer experience for all CashScript developers, whether you prefer the playground or a code editor. The playground and VS Code extension now feature full compilation results and show you any compile errors immediately. 🫡🚀
3
6
2
19
1,544