Bitcoin Builders: sCrypt and building on Bitcoin

In the latest episode of Bitcoin Builders, Bitcoin Association’s Brett Banfe had the opportunity to sit down with Xiaohui Liu – sCrypt Inc Founder and

Written by

Ryan Brothwell

Published On

12 Apr 2023

In the latest episode of Bitcoin Builders, Bitcoin Association’s Brett Banfe had the opportunity to sit down with Xiaohui Liu – sCrypt Inc Founder and CEO. Liu details some of the exciting projects his company is working on right now and what to expect going forward.

sCrypt is a high-level smart contract language for BSV. The BSV blockchain supports smart contracts with its Forth-like stack-based Script language, but writing smart contracts in native Script is cumbersome and error-prone. sCrypt aims to address this and is designed to facilitate writing complex smart contracts running on-chain.

Deprecation of sCrypt as a standalone language

Liu began the interview by noting that sCrypt as a standalone language has now been deprecated and it will just be the TypeScript Domain-Specific Language (DSL). Liu explained that sCrypt started as its own programming language similar to Javascript acting as a high-level scripting language since the launch of Bitcoin.

He added that there are over 30 million Javascript developers worldwide while there are only around 30,000 Web3 developers worldwide. So the idea is to give these millions of developers a high-level tool to code without learning things from scratch.

Liu noted that sCrypt also offers far more functionality than TypeScript which is more of a generic tool. On the surface, it looks exactly the same, but under the hood, it compiles to Bitcoin script.

Why should I develop using Bitcoin?

Liu said that one of the most common questions he is asked by web2 developers looking to enter the ecosystem is ‘Why would I want to programme this on Bitcoin’? While there are multiple benefits, Liu noted that one of the biggest ones is multi-party authentication.

“If you all trusted each other then you would most likely stick with a web2 platform. But if you don’t, then this is the only trustless platform to work on,” he said. Liu added that another significant advantage of using Bitcoin is the incredible interoperability it offers.

“For a public blockchain, as it is only one chain, every app is by default interoperable with other apps running on the chain.”

Smart contracts on Bitcoin

Smart contracts on Bitcoin are based on the UTXO model, which is very different from an account model like Ethereum used. Each Bitcoin transaction consists of some inputs and outputs. An output contains:

  • The amount of bitcoins it contains
  • Bytecodes (called the locking script)

While an input contains:

  • A reference to the previous transaction output
  • Bytecodes (the unlocking script)

An Unspent Transaction Output (UTXO) is an output not consumed in any transaction yet. The low-level bytecode/opcode is called Bitcoin Script, which is interpreted by the Bitcoin Virtual Machine (BVM).

Demonstration of sCrypt 

As part of the interview, Liu gave a demonstration on sCrypt, including:

  • All the available documentation and where to find information about the language;
  • How to write a contract;
  • How to test a contract;
  • Debugging and deployment;
  • How to integrate with a frontend;
  • Several tutorials for users to try out.

You can watch the full interview and demonstration below:


Latest News

Get the latest updates on the Blockchain industry and BSV ecosystem, including new projects, developments, and events.

All News