Rust Libraries Overview

Rust is used as a key part of the Radix stack, and is published to crates.io with each release.

There are a few Radix libraries which might be useful for integration or reference:

  • The Engine Rust Libraries - which power the Radix Engine in the node, resim and resim
  • The Radix Engine Toolkit core
  • Wallet-compatible derivation
  • Sargon

Engine Rust Crates

These crates are published to crates.io at each protocol update.

All these crates inter-depend, so you must ensure you use the same version across all imported crates. These crates don't use standard semver - we recommend explicitly fixing the version for each protocol update, and manually updating.

Key libraries include:

Most libraries have an expansive prelude which cover most of their key functionality, and is recommended to avoid import paths breaking between different versions.

There are also other crates, such as radix-engine, radix-engine-interface and many others. But these aren't typically used as libraries by integrators.

Rust Toolkit

The toolkit core is built in Rust, but it isn't published to crates.io and is mostly built to be exposed over UniFFI or WASM. It isn't intended to be used directly.

We may more formally create a rust toolkit with a more stable API at some point, but for now we recommend using the Engine crates directly (notably, the radix-transactions crate).

Wallet compatible derivation

The wallet-compatible-derivation crate and CLI can be used to derive keys from mnemonics in the same manner as the official Radix Wallet, which enables creating a programmatic integration which can also be imported into a Radix wallet.

Sargon

The sargon crate is a UniFFI library which forms the core of the official Android and iOS wallets.

It's not intended to be consumed by anyone else, but might form a useful reference. It imports both the engine libraries and toolkit core.

Babylon Node

The babylon node has a rust-core, which might be a useful reference.