01 Introduction to Scrypto 101
1.1 Welcome to Scrypto 101
Welcome to the Scrypto 101 course! This course has been designed to give you all the tools and knowledge you will need to be able to start building useful dApps (decentralized applications) on the Radix network using Scrypto.
The course offers a comprehensive overview of dApp development using Scrypto, beginning with basic concepts like Radix, the Radix Engine, and the process of setting up the essential tools for network development. It then progresses to more advanced topics, including the creation of fungible and non-fungible resources, concluding with insights into managing authorization rules.
If some of the terms used here don't quite make sense to you, do not worry! We will explain what all of this means in the following chapters. Plus we have included a glossary at the end of this chapter to help with terminology as well.
This course is designed in a way that allows you to learn at your own pace but you can expect it to take around two weeks to complete if you are going through a couple of lessons each day. By the end of the course, you should feel confident participating in Scrypto challenges and hackathons - and even bring your awesome ideas to working prototypes!
Before you jump in to the course, make sure to:
The course offers a comprehensive overview of dApp development using Scrypto, beginning with basic concepts like Radix, the Radix Engine, and the process of setting up the essential tools for network development. It then progresses to more advanced topics, including the creation of fungible and non-fungible resources, concluding with insights into managing authorization rules.
If some of the terms used here don't quite make sense to you, do not worry! We will explain what all of this means in the following chapters. Plus we have included a glossary at the end of this chapter to help with terminology as well.
This course is designed in a way that allows you to learn at your own pace but you can expect it to take around two weeks to complete if you are going through a couple of lessons each day. By the end of the course, you should feel confident participating in Scrypto challenges and hackathons - and even bring your awesome ideas to working prototypes!
Before you jump in to the course, make sure to:
- Join the Radix Discord. On there, you will find the #scrypto and #scrypto-rust-beginners channels. This is the place where you can ask questions you have while going through the course. Both the RDX works team and the community will be there to help.
- Sign up to the developer program to get all the updates about Radix and Scrypto, and get access to exclusive developer content. Note that you will need to join this developer program to be able to submit your blueprint exercise at the end of this course.
//Why you should learn Scrypto
Scrypto is a Rust-based programming language designed to write and develop dApps with asset-oriented features to facilitate the management of assets. The need to develop Scrypto wasn’t without thoughtful reasons. The proliferation of smart contracts in recent years saw novel applications being built with tangible and practical use cases, most particularly in finance. However, with so many hacks happening and poor experience for both the users and the developers, Radix had to take a different approach.
Radix isn’t simply providing a new and different language to develop dApps, it is re-architecting the entire tech stack for the purpose of providing the platform that will be able to deliver DeFi to the mainstream. The whole stack allows Scrypto to offer the best developer experience for building decentralized applications.
Radix isn’t simply providing a new and different language to develop dApps, it is re-architecting the entire tech stack for the purpose of providing the platform that will be able to deliver DeFi to the mainstream. The whole stack allows Scrypto to offer the best developer experience for building decentralized applications.
//The core ideas of Scrypto are the following:
- Asset-Oriented - The term “Asset-Oriented” is a term that captures and centers the design philosophy developers should keep in mind when developing dApps. Since assets such as fungible or non-fungible tokens are primary concepts in DeFi, we have enabled assets as a platform feature. Developers should then orient their thinking as to how these assets should be utilized to create useful features.
- Security - The introduction to Web3/DeFi enables a platform feature where value can be transferred across the network, not just information. The result of this placed a heavy burden on networks such as Ethereum to manage billions of dollars worth of assets. As such, developers were given the responsibility to handle several critical areas, such as how their assets should behave or how they should manage authorization, all from scratch. This results in creating additional complexities, difficult-to-read code, and difficult to audit code. Which has ultimately led to billions of dollars worth of smart contract hacks.
The DeFi space revolves around the interaction of assets. When we deposit collateral into Aave, make swaps on Uniswap, or collect NFTs, we are interacting with assets. Yet, ironically, current smart-contract languages and platforms do not make assets first-class citizens and rather let developers redefine them from scratch over and over again. The Radix Engine handles asset movement and states through a finite state machine (FSM), a computational model that is usually used for mission critical systems, such as nuclear power plants. The FSM imposes strict rules on how assets are managed in the system, making the handling of assets predictable and reliable. - On-Chain Authorization - The Radix Engine’s FSM allows a well-integrated and flexible security model. As such, developers can build versatile permissions and authorization models for their dApps that rely on the Radix Engine’s security guarantees. This means you no longer need to be an expert in smart contract security and can focus on what you do, Build great dApps!
- Blueprint Catalog - Our on-chain cataloging featureallows developers to contribute to and access pieces of functionality that can be directly reused, configured, combined, and extended on-network. On top of that, developers can define royalty fees that are paid whenever someone (or another smart-contract) uses their piece of code. The network thus becomes a true shared computing environment, taking open source development into the decentralized era.
- Developer Experience - Having a DeFi engine that natively understands the concepts that developers use the most naturally empowers them with the freedom to focus on what they do best: developing great applications. When business logic and asset logic are decoupled, we can create a programming experience where the Radix Engine handles the asset logic, and the edge cases associated with them, which leaves the creative expressions of business logic to the developer. This significantly reduces the security overhead the developer has to think about and allows them to spend more time extending application features.