How to create smart contracts on Bitcoin

sCrypt, the high-level smart contract language for Bitcoin SV (BSV), has made significant progress since its CoinGeek London 2020 release. The release of sCrypt has attracted many developers to the Bitcoin blockchain because it gives them an easy way to create smart contracts. For the developers coming from other blockchain networks, sCrypt is basically Solidity for Bitcoin and easily allows creators to achieve Satoshi’s Vision.

sCrypt’s progress

Since its release, sCrypt has been downloaded over 100 times and has a 5-star rating. Recently, the sCrypt team has optimized its compiler, released a debugger, and has published several articles that show developers how to leverage sCrypt to write smart contracts.

“We have made great strides in optimizing the compiler,” said sCrypt founder and CEO Xiaohui Liu. “This optimization reduces generated script output by up to 500%, which directly translates to 80% cost saving on running smart contracts. The addition of the debugger into the existing IDE ranks it the best and most sophisticated smart contract IDE we have ever seen in the entire blockchain industry.”

The recent additions have made sCrypt more cost- and time-efficient for developers around the world. And the resources the company has published have sparked enthusiasm and interest both inside and out of the Bitcoin community.

Limitless potential

“Contrary to popular belief, Bitcoin has had smart contracting capability since its inception,” said Liu. “’The design supports a tremendous variety of possible transaction types that I designed years ago,’ as Satoshi wrote. Money transfer is merely one type of transaction. We have already seen Bitcoin being used as a global database to store arbitrary data (e.g., in OP_RETURN). What is more exciting and generally unknown is it can also be used as a global computer, thanks to its built-in scripting capabilities. It can perform general-purpose computation in a more scalable, economic, and secure way.”

Bitcoin was always meant to be used as much more than a peer-to-peer electronic cash system, and innovations like sCrypt are helping developers create tools, applications, and services that allow them to use Bitcoin as much more than the money transfer system or store-of-value that many people believe it to be.

“After the Genesis upgrade, Bitcoin Script became unlimited at the protocol level. However, Script is a very low-level language and similar to assembly,” said Liu. “It remains extremely hard, if not impossible, to program any non-trivial contracts in Script, even after its limits are removed. Being a high-level programming language that compiles to Script, sCrypt abstracts all the complexities away from developers, so they can develop sophisticated contracts as easily as they do in mainstream modern languages like Javascript. This friendly tool will facilitate developers to write and run any smart contracts other blockchains can do, and more, thanks to Bitcoin’s unbounded scalability.”

The Genesis protocol upgrade removed any of the parameters around Bitcoin that were preventing it from scaling to its maximum ability. However, without the proper tools in place, it was still very difficult to write script. sCrypt realized that the Bitcoin network had this problem and decided to solve it by giving software developers an easy to use tool that would simplify writing and running smart contracts.

“We have already seen a plethora of novel contracts developed in a short time using sCrypt,” said Liu.

We have seen: 

• A counter contract that demonstrates how to maintain state.
• A token contract that runs at layer 1 and is enforced by miners.
• An insurance contract that hedges farmers against bad weather.
• An inheritance contract that automatically transfers Bitcoins to beneficiaries after the creator’s passing.”

This is just the beginning for sCrypt, as more developers download and use their tool, we expect many more revolutionary contracts to be created via sCrypt.

Bitcoin has had a great amount of value-added to its chain since it halved on April 10. Tools like sCrypt, and innovative, unprecedented platforms and services like Trademail, Twetch, and Bitping are moving the Bitcoin space forward in a major way.

New to Bitcoin? Check out CoinGeek’s Bitcoin for Beginners section, the ultimate resource guide to learn more about Bitcoin—as originally envisioned by Satoshi Nakamoto—and blockchain.

[10]
[10]