BSV
$70.81
Vol 133.41m
1.23%
BTC
$95328
Vol 91950.67m
0.21%
BCH
$526.97
Vol 1637.93m
3.36%
LTC
$127.68
Vol 3616.84m
6.22%
DOGE
$0.4
Vol 10993.11m
-3.05%
Getting your Trinity Audio player ready...

This post was first published on Medium.

After months of intense development, we are super thrilled to introduce scryptTS: a Typescript framework to write smart contracts on Bitcoin.

scryptTS a Typescript framework to write smart contracts on Bitcoin

scryptTS is a Typescript-based domain specific language (DSL) for coding smart contracts on Bitcoin, based on our experience of developing and fostering the sCrypt ecosystem in the past three years. Developers can directly code smart contracts in Typescript, one of the most popular programming languages in the world and used by millions of developers every day.

Barrier to Bitcoin smart contract developer adoption

The current smart contract development on Bitcoin is based on sCrypt, a high-level programming language to write smart contracts. Its IDE has drawn over 4,000 downloads since launch. Despite its drastic improvement over developing in Bitcoin Script, an assembly-like low-level set of instructions for Bitcoin, Bitcoin companies and projects still have difficulty finding qualified smart contract developers, hindering wide Bitcoin adoption. This is mainly because sCrypt is still a relatively niche language, given its nascency.

Based on our years of developing sCrypt contracts ourselves and talking with hundreds of developers in and beyond Bitcoin, we summarize the major pain points of new developers as follows:

  • they have to learn a new programming language
  • they have to learn new tools.

The requirement to learn something new and different from their daily development workflow poses a significant barrier to entry and degrades developer experience. Consequently, the number of Bitcoin developers today is small compared to that of other blockchains.

The ultimate solution: scryptTS

To fix these pain points, we have designed scryptTS from the ground up. Its design principle is to reuse existing programming languages and tools that many developers are already familiar with.

Credit electric Capital
Credit: Electric Capital

The number of Web3/blockchain developers is merely ~0.07% of all developers, and the number of sCrypt developers is actually even smaller than that.

Javascript is the most popular programming languages. Typescript basically adds types into it. For smart contracts that control users’ funds, type safety is paramount. That is why we choose Typescript.

1. Familiar and simple syntax

scryptTS is simply Typescript. Creating a loop is just writing “for” and conditional “if.” There is NO new syntax to learn.

Below is an example of writing an Ackermann function.

Here is another example of implementing the most popular smart contract in use today: Pay-to-PubKey-Hash (P2PKH).

2. Huge ecosystem

All existing Typescript/Javascript libraries can be seamlessly integrated with scryptTS. Below is an example to test scryptTS smart contracts using Mocha, which is among the most popular Typescript/Javascript testing frameworks.

3. Package management

scryptTS does not need its own package manager. It just uses npm, Typescript/Javascript’s package manager. One can publish his own scryptTS contract using npm. Anyone else can just import and reuse it as a dependency via npm.

4. IDE and Debugging

One can use his favorite Typescript IDE to code and debug scryptTS smart contracts, including Visual Studio Code, WebStorm, Vim, and Atom. Below is an example of using Visual Studio Code to debug a scryptTS contract, no extension needed!

example of using Visual Studio Code to debug a scryptTS contract
See the full animation here

We need you

The scryptTS framework has just gotten off the ground. We want to hear feedback from you. Try it today at https://scrypt.io/scrypt-ts. Your can find examples at https://github.com/sCrypt-Inc/scryptTS-examples. We have also launched a free course on Youtube. Join us on Discord (channel #scrypt) or Slack to talk directly to the team and other enthusiasts.

Watch: The BSV Global Blockchain Convention presentation, Smart Contracts and Computation on BSV

Recommended for you

AMD powers El Capitan; Google tackles quantum errors
El Capitan can crunch 2.79 quadrillion calculations per second, more than the computing power of a million iPhones, but makers...
December 2, 2024
Russia proposes winter BTC mining ban until 2031
A commission led by Deputy Prime Minister Alexander Novak has proposed banning block reward mining in Siberia from November to...
November 28, 2024
Advertisement
Advertisement
Advertisement