Skip to content
Blockchain Association of Cameroon
BAC-L1-SUB-103Substrate / Polkadot SDKIntermediate

Rust for the constrained runtime environment

A runtime compiles to WebAssembly: no standard library, no implicit allocation, no non-determinism. The rules change.

Level
L1Blockchain developer
Duration
4 h
Track
Substrate / Polkadot SDK
Maintainer
Polkadot / Substrate Lead Architect

Learning objectives

  • 01Build a module in a no-standard-library environment
  • 02Encode and decode structures with a compact codec
  • 03Identify the sources of non-determinism forbidden in a runtime

Guided lab

Convert an existing module to the constrained environment and compile it to WebAssembly.

Independent lab

Measure the resulting WebAssembly binary size and reduce it through documented design choices.

Security angle

Floating point, system clock, randomness not supplied by the chain: three ways to break determinism and thus consensus.

Assessment

Module compiled to WebAssembly, with a note on the non-determinism sources eliminated.