Substrate has arrived
Communications @ Parity Technologies
December 18, 2018 in
4 min read
Substrate 1.0 Beta is out now, opening the door to a radical acceleration in blockchain and decentralised application development. Substrate is an open-source technology stack that makes it easy to create a blockchain customised for a particular application.
“Substrate takes all of our lessons learned in building Ethereum and Polkadot and distills that down into a stack of tooling that allows you to get all of those same rewards… for free.” —Dr. Gavin Wood
Designed for maximum technical freedom and ease
Substrate is architected to be as generic as possible in order to give you maximum technical freedom when designing your blockchain. It has a 100% abstract “execute block” function encoded in WebAssembly that can be targeted from any one of a number of languages, including C++ and Rust. The execute block function is hot-swappable, meaning you can upgrade your chain’s logic without a hard fork.
Consensus is likewise generalised. The API provided lets you roll your own consensus mechanism if you want, and it can handle most consensus algorithms out there. Substrate 1.0 Beta provides a combined Aura/GRANDPA consensus, with more consensus algorithms to be provided in subsequent releases. Down the road, consensus will be hot-swappable, meaning you can start your blockchain with one consensus mechanism and switch to another down the line without a hard fork.
Substrate allows you to easily configure your blockchain, but also take complete control over the code should you need to. This flexibility between ease and technical freedom is achieved through a modular design: Substrate is separated into Substrate Core and Substrate Runtime Module Library (SRML) and comes with a pre-assembled Substrate Node that is simple to configure.
Substrate Core is the minimal Substrate base for building blockchains. Substrate Core gives you a foundation that is far easier than building a blockchain from scratch, though you don't get a finished blockchain. It includes:
- Block synchronisation
- Extensible JSON-RPC API endpoints
- Crypto primitives library
- Pervasive and secure networking via libp2p
- Light client
- Chain specification and versioning
- Pluggable consensus
- Transaction queue and block production mechanism
- Sandboxed WebAssembly interpreter
- Interchain connectivity via the Polkadot protocol
Substrate Runtime Module Library (SRML)
The core architecture of Substrate separates the basic functionality of a network blockchain node and the chain-specific implementations by executing the latter in a separate WebAssembly environment. You have absolute freedom to write the chain logic in any language that can compile down to WebAssembly (Rust, C/C++, C#, Go, etc). You can add modules from the Substrate Runtime Module Library, or SRML. With SRML, you can take off-the-shelf components, plug them together, and build a blockchain that does what you want it to do. Modules include:
- Accounts & Balances - basic cryptocurrency, including account management and viewing
- Assets - simple, secure additional on-chain fungible assets
- Consensus - setting and modifying runtime code and storage (i.e. the set of authorities as a list of session keys on-chain), and reporting offline or misbehaving validators
- Contracts - turbo-charged Wasm-based smart contracts
- Council - council election and proposals
- Democracy - public proposals and referendums
- Sessions - key rotation for authorities
- Staking - Proof-of-Stake logic, including both staking and nominating of validator accounts
- Timestamp - have your chain know about time
- Treasury - decentralised grants, similar to a DAO
So for example, if you want to create a Proof-of-Stake smart contract blockchain, you would take Substrate Core and plug in the Accounts & Balances, Staking, and Contracts modules. Once Polkadot launches, you could also make it interoperable by plugging it into Polkadot.
Finally, Substrate Node allows you to deploy a blockchain with maximum ease. Soon you will be able to configure Substrate Node with a JSON file.
Peripheral support infrastructure
Peripheral support infrastructure has been built by Parity and open-source contributors to provide additional functionality to Substrate and Polkadot. This infrastructure includes:
- Polkadot Telemetry Service - network information including what nodes are running the chain, what software versions they are running, and sync status.
- Jaco’s UI for Substrate and Polkadot - built with React.js and RxJS. API docs and examples available.
- Substrate UI - built with the Bonds oo7 library. API Docs available.
- Polkadash - validator monitor.
- Polkabot - network monitoring and reporting.
- Polkascan - blockchain data explorer and analytics.
From GPLv3 to Apache 2.0
Substrate 1.0-beta is currently licensed under GPLv3, but in keeping with the ideal that Substrate should allow for maximum developer freedom, the Substrate repo will transition to be licensed under Apache 2.0. The widely permissive nature of the open-source license allows for commercial use, distribution, modification, patent use, and private use and opens the door for Fortune 500 companies to adopt the technology. We offer professional services to organisations looking to build with Substrate.
New: Substrate developer hub
We’re hard at work making Substrate the most developer-friendly blockchain framework. We have started a developer hub where you can:
- Get an overview.
- Learn how to install Substrate.
- Learn how to create a custom Substrate chain.
As the developer hub is a work in progress, please feel free to ask questions in the Substrate Technical chat.
Start hacking on Substrate today
“I really hope that by pushing out Substrate, we can create a whole new class of sort of development teams and development applications that sit right in the sweet spot between the two where you don't have to know everything, you don't have to do everything to develop your whole new blockchain, but you can do just enough that you do have a domain-specific chain, that has its own parameterization, and its own features that allow you to get a particular job done, and done well, that wouldn't have been possible before because smart contracts are too bloaty, and writing your own chain is too much work.” —Dr. Gavin Wood
Get started quickly by downloading Substrate and build your own custom chain.
- Watch Dr. Gavin Wood demo Substrate at the Web3 Summit (transcript).
- Read documentation at the Substrate developer hub.
- Check out a simple example of a runtime module demonstrating concepts, APIs and structures common to most runtime modules.
- Watch the Substrate workshop at Dotcon.
- Join the Parity newsletter to stay informed of important Substrate developments.
Have a question? Join the Substrate chat.