RateLimited°C
11-05-2024
BSV
$46.48
Vol 18.07m
-0.48%
BTC
$68748
Vol 46061.55m
-0.27%
BCH
$338.71
Vol 269.87m
-0.15%
LTC
$65.48
Vol 348.41m
-2%
DOGE
$0.16
Vol 3753.8m
7.47%
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

How to construct transactions on BSV blockchain with Python
Python coders, it's time to start learning how to build Bitcoin transactions as nChain's Senior Software Engineer, Arthur Gordon, recently...
November 5, 2024
BSV Association joins OnlyDust’s developer event sponsor list
OnlyDust is a network for open-source developers working with blockchain and decentralized projects; its purpose is to connect contributors, maintainers,...
October 23, 2024
Advertisement
Advertisement
Advertisement