BSV
$48.68
Vol 37.92m
-1.85%
BTC
$66906
Vol 48084.39m
1.22%
BCH
$353.39
Vol 613.69m
-4.13%
LTC
$72.2
Vol 847.83m
7.37%
DOGE
$0.11
Vol 1464.93m
-0.45%
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

Texas residents sue Marathon Digital over loud mining noise
Residents of Hood County in Texas allege that the noise from Marathon Digital’s operations has caused direct health complications, including...
October 15, 2024
Treechat resurrects archives from Twetch and Hodlocker
CoinGeek spoke to Treechat founder Dmitriy Fabrikant about the process of resurrecting on-chain social networks following the restoration of Twetch...
October 9, 2024
Advertisement
Advertisement
Advertisement