Bitcoin Cash (BCH) developers now have a new tool for building decentralized applications: Spedn, a high-level smart contract programming language announced by developer Tendo Pein on Wednesday. Spedn is designed specifically for the BCH protocol, aiming to address the limitations of Bitcoin Script, the native stack-based language that Pein described as difficult to use for complex contracts.
Why Spedn? The Pain Points of Bitcoin Script
Bitcoin Script is a stack-oriented language similar to Forth, which requires developers to manage the stack manually and often leads to unreadable, error-prone code. Spedn takes a different approach: it is statically typed, meaning all variable types are checked at compile time, eliminating guesswork about return values. The language is purely functional, free from side effects—a common source of bugs in smart contracts. Its syntax is familiar to C programmers, with curly braces and semicolons, but it also borrows from Haskell’s functional paradigms, combining the best of both worlds.
Core Features and Built-in Functions
The Spedn compiler, available via command line, supports math operations, hashing functions (SHA-256, RIPEMD-160), cryptographic checks (including signatures and timelocks), and lexical scoping. Developers can write contract templates using a straightforward file structure. Pein provided a quick-start guide and a detailed explanation of how Spedn abstracts away low-level Bitcoin Script operations. This makes it possible to write contracts that would otherwise require hundreds of lines of raw Script.
Real-World Examples: Zero-Conf Forfeits and Chainbet
To demonstrate Spedn’s capabilities, Pein included two complete contract examples. The first is a zero-confirmation forfeit contract, based on a proposal by BCH developer Awemany. This contract secures zero-confirmation transactions by forcing malicious spenders to forfeit funds if they attempt double-spending before the transaction is confirmed. The second example implements the Chainbet protocol, created by Jonald Fyookball. Chainbet enables on-chain, decentralized betting with multiple steps; Spedn expresses the entire state machine elegantly. Both examples are available in the Spedn documentation, allowing developers to test and modify them.
Comparison to Ethereum’s Solidity
Just as Solidity revolutionized development on Ethereum, Spedn aims to do the same for BCH. However, Pein cautioned that Spedn is still in its infancy: “Many breaking changes may come and it’s far from being an ‘out of the box’ solution for smart contracts developers.” He is actively seeking contributors for syntax ideas, code review, unit tests, and bug reports. The project is open source, hosted on GitHub, and the documentation includes a formal language specification.
Conclusion
Spedn represents a significant step forward for the Bitcoin Cash ecosystem, offering a developer-friendly, safe, and expressive language for building smart contracts. While it is not yet production-ready, its design choices—static typing, pure functions, C-like syntax—position it as a promising alternative to raw Bitcoin Script. As the community tests and refines Spedn, BCH could see an influx of new applications in decentralized finance, payment channels, and beyond.

