paint-brush
Rethinking Web3: How to Build Faster Using Scryptoby@sobepanek
1,380 reads
1,380 reads

Rethinking Web3: How to Build Faster Using Scrypto

by Anton Sobe-PanekJuly 27th, 2023
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

Scrypto is a new programming language based on Rust for Web3 and DeFi. Scrypto lets developers build 5x faster on average than with Solidity for a like for like implementation. 50+ projects are building in Sc Krypto and looking to launch after the Radix Babylon Mainnet upgrade in September.
featured image - Rethinking Web3: How to Build Faster Using Scrypto
Anton Sobe-Panek HackerNoon profile picture

There are plenty of new layer 1 protocols emerging every day, with some claiming to be the fastest blockchain, while others boast about being the safest protocol available. However, Radix sets itself apart by offering a new level of user experience for both end users and developers. To delve deeper into this, we sat down with RDX Works (a core development company working on the Radix Public Network) CMO, Adam Simmons, to discuss the utility of Scrypto, a new programming language based on Rust.

What’s the goal of creating yet another programming language and what problem does it solve? 

Building a decentralized application (dApp) today takes far too long, as developers spend most of their time on validations, testing and audit. Even with all that time spent on security, million dollar plus hacks in DeFi still happen every few days, totalling billions of dollars in the last two years. 

The root cause is that today’s smart contract programming languages are not fit for purpose. So for Radix, we built our own. Tailor made for the needs of Web3 and DeFi, it’s called Scrypto, and it’s built on top of Rust.

Testing with developers has shown that Scrypto lets them build 5x faster on average than with Solidity for a like for like implementation.

So to answer the question, the two overarching goals that drove the development of Scrypto are to:

  1. Make Web3 development easier, faster, and more intuitive so anyone can learn the language and bring Web3 and DeFi products to market far more quickly;
  2. Make the language and application environment inherently secure so that DeFi feels as safe as, if not more than, the traditional banking experience users have today, but without the need to trust any third party but yourself.

How have developers been finding Scrypto? Are any exciting things being built?

The Scrypto experience has resonated with developers. Over 12,000 have tried the language since it was launched in early access at the end of 2021. We’ve heard stories of people discovering Radix, learning Scrypto in 2 days, and then building a hackathon-winning derivatives dApp with just 3 days more. We’ve also heard stories of people with no background in smart contracts learn Scrypto and in just a few months build DeFi dApps that are as complex as they come:  

“I have been exploring smart contract development for less than a year, so the fact that I was able to reproduce a functional version of Liquity's lending and stable coin platform in 5 weeks is still blowing my mind.” ~aus87

With such powerful tools given to developers, we’re seeing fast growth in the Radix ecosystem. 50+ projects are building in Scrypto and looking to launch after the Radix Babylon Mainnet upgrade takes place in September, which is when dApps written in Scrypto can be deployed to the Radix mainnet. I’m personally really excited about the quality and innovation being brought by the dApps that are being built. From concentrated liquidity DEXes, to innovative lending protocols and stablecoin projects, to bridges such as LayerZero; a complete DeFi ecosystem is being built. Now is the best time to get involved - just before the ecosystem really takes off.

Although we’re seeing the start of successful growth, when you take a step back, crypto is still in its infancy. There are just 30k full time developers out of a global total of 30m. That’s 0.1% of developers. There is a long road ahead to capture the imaginations of the remaining 99.9% and I’m so excited by the dApps that Scrypto will enable as more and more developers get their hands on it. 5x productivity and eliminating many of the hacks that afflict the space is exactly what we need to move our industry forward and get more of those 30m developers to seriously try out building in Web3. 

All of this sounds amazing. But how does Scrypto actually achieve improvement in productivity and security? 

Scrypto provides developers these gains in productivity because it has purpose-built native features to manage assets built into the language itself. Scrypto is an asset-oriented programming language where tokens and NFTs are represented as a “physical” object natively understood by the platform.

These assets obey intrinsic laws of finance, such as that it shouldn’t be spent twice, that it has to have an owner, and that transactions have to net to zero. These laws are guaranteed by Radix’s virtual machine, Radix Engine, and this massively improves security because the engine is handling the thing that matters: assets. And it makes Scrypto far more intuitive than other paradigms because “physically” holding and sending assets is how we naturally think about finance. 

Contrast this to other virtual machines such as the Ethereum Virtual Machine (EVM). The EVM does not natively understand what an asset is as tokens are built by smart contract developers inside smart contracts. Users and developers don’t have an engine to rely on that guarantees how tokens should behave. And so the slightest mistake by a developer, and you could have a hack worth millions of dollars. 

I’ve heard that Scrypto and Radix Engine can be described as a game engine for finance. Could you explain this a bit more?

We can look to history to understand similar examples in software development where an engine with in-built tools has massively improved developer productivity and reduced bugs. 

Think back to the 1990s of computer game development. At that time, developers were building computer games with just a programming language such as C. While C allowed them to build any game they liked, they had to build everything from scratch, such as gravity or graphics rendering. This is where we are in DeFi and Web3 today.

Fast forward to the early 2000s, and game engines such as Unreal Engine gave game developers purpose-built native features to build computer games. Using a game engine, developers are still free to create any kind of game they like, but their productivity is massively improved, and the bugs that happen in their games are hugely reduced. The result of this increased productivity is clear - the video game industry is now larger than cinema and music combined!

That’s basically what Scrypto and Radix Engine will do for Web3 and DeFi development - by providing developers the core tools they need to manage assets, access controls, and other core features that every developer needs, while reducing the potential for bugs hacks and exploits and thus prevent developers from making mistakes.

Are there any limitations or challenges associated with using Scrypto that developers should be aware of?

No limitations or challenges to date. Scrypto is a turing-complete language where you can build anything in it. And Scrypto is super easy to learn. We’ve had developers who had limited coding backgrounds pick it up very quickly and win hackathons. Where can one learn more about Scrypto and Radix Engine? 

To learn more about Scrypto and Radix Engine, check out the Radix Full Stack website. Or if you’re a developer, feel free to dive into the docs here. The Babylon Mainnet upgrade is coming in September 2023, and so this is definitely the best time to get involved in the Radix community on Telegram and Discord. We are trying to give these tool to everyone who wants to build in Web3.