Skip to content

LedgerHQ/ledger-device-rust-sdk

Repository files navigation

Ledger Device Rust SDK

DEV SUPPORT

Rust SDK for developing applications on Ledger hardware wallets. This workspace provides safe, idiomatic Rust abstractions over the Ledger C SDK for building embedded applications on Nano X, Nano S Plus, Stax, Flex, and Apex P devices.

Supported Devices

Nano X Nano S Plus Stax Flex Apex P

Crates

Crate Description Documentation Latest Release Changelog
ledger_device_sdk High-level Rust SDK with safe abstractions Link Dynamic TOML Badge Link
ledger_secure_sdk_sys Low-level FFI bindings to C SDK Dynamic TOML Badge Link
include_gif Proc macro for embedding images (GIF/PNG → NBGL/BAGL) Dynamic TOML Badge
testmacro Test harness for #![no_std] environments Dynamic TOML Badge

Docker builder

Docker images are available and shall be used to build and test Rust applications for Ledger devices.

full dev-tools
Rust nightly-2025-12-05 toolchain
cargo-ledger 
Rust Ledger devices custom targets 
ARM & LLVM toolchains 
Speculos 
Ragger  

Please check here for more details.

Quick Start with Docker

# Pull the Docker image
docker pull ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder:latest

# Build your app (from your project directory) using cargo-ledger
docker run --rm -v "$(pwd):/app" \
  ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder:latest \
  cargo ledger build stax

# Run examples with Speculos (dev-tools image)
docker run --rm -v "$(pwd):/app" \
  ghcr.io/ledgerhq/ledger-app-builder/ledger-app-dev-tools:latest \
  cargo run --example nbgl_home_and_settings --target stax --release

Getting Started

For detailed setup instructions, see the ledger_device_sdk README.

To start building your own app:

  1. Use the boilerplate: Clone app-boilerplate-rust for a complete working example
  2. Explore examples: Check the examples/ directory for UI patterns, APDU handling, and more
  3. Read the docs: See developers.ledger.com for comprehensive guides

Key Requirements

  • Rust nightly toolchain (see rust-toolchain.toml)
  • cargo-ledger - CLI tool for building Ledger apps (cargo install --git https://github.com/LedgerHQ/cargo-ledger)
  • arm-none-eabi-gcc (ARM toolchain)
  • Clang
  • For testing: Speculos emulator

Resources

Contributing

Contributions are welcome! Please ensure your PR:

  • Builds successfully with cargo ledger build <device> (or cargo build --release --target <device>)
  • Passes cargo clippy without warnings
  • Is formatted with cargo fmt
  • Includes tests where applicable

See individual crate READMEs for specific contribution guidelines.

About

Rust SDK for Ledger device applications

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 33

Languages