“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, Co-founder of Parity Technologies, Polkadot and Ethereum.

Designed for freedom and ease

Parity architected Substrate to:

be as generic as possible

provide technical freedom when designing a blockchain.

It has a 100% abstract ‘execute block’ function encoded in WASM. Developers can target this from a number of languages, including C++ and Rust (Substrate is authored in Rust and there is also a JavaScript implementation for a Substrate client that runs directly in the browser). The execute block function is hot-swappable, meaning developers can upgrade a blockchain’s logic. This means it will be possible to start a blockchain with one consensus mechanism and switch to another down the line – avoiding a potential hard fork.

Substrate also generalises consensus. Parity claims the API can:

enable developers to ‘roll their own consensus system’

handle most consensus algorithms which currently exist.

Substrate 1.0 Beta on release offers a combined Aura/GRANDPA consensus, with additional consensus algorithms coming subsequent releases. It offers a light client out-of-the-box so that a blockchain can work natively on mobile devices. There is pooled security and interoperability via integration with the Polkadot protocol.

Substrate Core

Substrate Core is the minimal Substrate base for building blockchains. Substrate Core offers a foundation which should be far easier to work with than building a blockchain from scratch (though it does not result in a finished blockchain). This includes:

pervasive and secure networking via libp2p

storage

telemetry

light client

block synchronisation

extensible JSON-RPC API endpoints

low-level JavaScript utilities

transaction queue and block production mechanism

sandboxed WebAssembly interpreter

interchain connectivity (via the Polkadot protocol)

crypto primitives library

chain specification and versioning

pluggable consensus (see above)

substrate Runtime Module Library (SRML).

SRML, Polkadot and Substrate Node

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. Developers the freedom to write the chain logic in any language that can compile down to WebAssembly (Rust, C/C++, C#, Go, etc). With the SRML you can:

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.

The example Parity gives is for a Proof-of-Stake smart contract blockchain. For this a developer would take Substrate Core and plug in the Accounts & Balances, Staking and Contracts modules. Once Polkadot has become available (a future), developers can make a blockchain interoperable – by plugging it into Polkadot.

The Substrate Node enables a developer to deploy a blockchain with ease. In the future Parity says it will be possible configure the Substrate Node with a JSON file.

Enterprise Times: what does this mean

Substrate 1.0-beta is currently licensed under GPLv3. In keeping, however, with the objective that Substrate should enable maximum developer freedom, the Substrate repo will transition to an Apache 2.0 licence. This will allow for commercial use, distribution, modification, patent use as well as private use. The Parity hope is this will open the door for Fortune 500 companies to adopt the technology (unsurprisingly, Parity offers professional services to organisations interested in building with Substrate).

In an environment where real blockchain implementation is proving harder than free-form discussion of blockchain’s abstract benefits, all and any tools which facilitate or simplify blockchain development are welcome. How easy Substrate will be to exploit will require objective experience. Enterprise Times will be interested to hear from any developers who would like to comment.