TECHNOLOGY

Doing Jstz to Tezos: JavaScript is Coming to the Blockchain

Discover Jstz (pronounced "justice"), the next step in the evolution towards Tezos X: a Smart Rollup powered by JavaScript.

TRILITECH

1,300 words, 7 minute read

Jstz Blog Cover

*Jstz is part of the Tezos X vision and as such, a result of collaboration between multiple Tezos development teams. A prototype is currently being built and tested by the Developer Experience team at Trilitech. *

Beyond sheer performance, scaling the utility of blockchain is crucial to widespread adoption — and one of the core pillars of the Tezos X vision. After all, the fastest, most cost-efficient blockchain is useless if people have nothing to do, or nowhere to go from there. And they’ll only have those things if someone builds them first. That’s why we need to bring in more developers – and to empower them to create.

Today, blockchains come with a hefty barrier to entry for builders getting into the space. Most networks support a single bespoke language and tools that don’t plug in very well – if at all – outside their borders. High effort plus limited reach? Not really a dev magnet.

But what if we removed this obstacle? What if, instead of demanding a huge effort from developers, we met them where they are – giving them the freedom to use the language and tools they already know and love? And what if these tools happen to form the backbone of the web as we know it, used by nearly 23 million developers worldwide?

Enter Jstz, an upcoming layer 2 rollup being built on Tezos to allow developers to use JavaScript and its vast resources. But more than just enabling the language itself, what sets Jstz apart is that it’s being designed to comply with standard JavaScript APIs, enabling builders to tap into a massive ecosystem of familiar, battle-tested JS tools and libraries.

Coming in the wake of Etherlink, Jstz is a huge step towards Tezos X and the ultimate vision of an OP blockchain-based, cloud-like backend for all kinds of applications.

The early days of blockchain development #

Back when blockchain technology was new and the territory uncharted, creators usually came up with new, purpose-built programming languages specific to each protocol. This was the natural approach to make sure the tools were up to the task.

Tezos, for example, went down the path of security – and Michelson was created to enable formal verification from the start. While this approach has some appeal and clear benefits (in this case, a mathematical proof that a deployed smart contract respects its specification), there are always trade-offs down the line.

Turns out not everyone is willing to go through (or able to afford) the extra effort introduced by using a new programming language, and only a tiny fraction of the already limited pool of software engineers globally is comfortable making the leap.

Why? Some reasons:

But Jstz changes everything.

Jstz: a league of its own #

If Etherlink reduces the barrier to entry and welcomes Solidity/EVM developers into Tezos, Jstz tears down the barrier altogether and opens up the blockchain to the world – taking us closer to a widely interoperable future.

JavaScript is the English of programming languages and the closest we have to the Internet’s universal tongue.

On the surface, the first thing that Jstz enables is the use of JavaScript and TypeScript to create and deploy smart contracts. While that in itself is already helpful, it’s not particularly unique – there have been other attempts at enabling the use of JavaScript for blockchain development.

However, most implementations have so far been limited to the use of JavaScript as a language, and are limited in the width and breadth of libraries and other tools that they can actually support.

The thing is, the language alone is not as useful without the ecosystem around it.

A JavaScript runtime on Tezos #

In contrast to this limited approach, Jstz is being built to offer the familiarity of a Web2-like experience – but supercharged with the best perks of Web3, like built-in identity, wallet, and payments.

When fully operational, developers shouldn’t experience any significant differences between using Jstz and any other server-side JavaScript runtime, like Cloudflare Workers or Deno. That’s because Jstz won’t rely on compiling or transpiling JavaScript code to a different virtual machine; it’ll run JavaScript natively.

By supporting JavaScript runtime APIs, Jstz will allow builders to use not just the syntax, but a massive selection of libraries by simply installing almost any package in the npm ecosystem.

As Jstz evolves, new features and functionalities will be introduced to further combine – and extend – the best of Web2 and Web3. Some of the planned features include: #

Potential future applications are fairly limitless, ranging from a simple HTTP echo server, to using Next.js (server-side react components).

Come build the future #

As it’s usually the case with human ingenuity, though, sometimes the best things are the ones you didn’t plan for. The byproduct can be much bigger than the product. Jstz opens the doors; what comes out of it is largely in the hands of the community of builders.

So we call on all of you, JavaScript developers, to come forth and experiment. Bring your wildest ideas, share your thoughts, and help us figure out what wonders will come from this.

Just head to the Jstz GitHub repository to learn more and start contributing!

Why should you care? A silly analogy #

Let’s entertain a crude and very silly analogy to illustrate why any of this matters.

Picture an archipelago of isolated islands in the middle of a vast ocean. Each island only speaks their own language within their boundaries, and what knowledge they have is limited to their internal affairs. Currently, most blockchains are like these islands, scattered across the blockchain space.

If you want to do business on one island, you need to learn their language. If you’re not a local, you can’t access their knowledge or infrastructure, and you can’t bring in external resources to help you out. You’re quite literally lost in translation.

This isolation and self-reliance seriously restricts collaboration. It means that each island can only grow as much – and as fast – as its people can build. The wider archipelago remains a collection of mostly disconnected specks of land.

Imagine if one of the islands began adopting the languages of other islands. That’d open the doors for other islanders to come and set up shop, bringing in their tools, resources, and accumulated knowledge. That cosmopolitan island would suddenly become a lot more interesting.

Now, imagine that this island also added something like English to its language mix. Suddenly, the doors are open not just to other islands across the archipelago, but also to unthinkably more massive continents across the whole planet – bringing the entire web to the island… and Jstz for all.

That little island is now connected to everything. It’s not so little anymore; it’s a global hub where anyone can do business and a melting pot for new ideas. Well, we all know what happens when value, human ingenuity, and ideas get together and just hang out.

And where’s that island, you might ask? Well, here’s a clue: X marks the spot.