Skip to content

Latest commit

 

History

History
91 lines (67 loc) · 5.36 KB

README.md

File metadata and controls

91 lines (67 loc) · 5.36 KB

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 crates.io Link
ledger_secure_sdk_sys Low-level FFI bindings to C SDK crates.io Link
include_gif Proc macro for embedding images (GIF/PNG → NBGL/BAGL) crates.io
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)
# Run from the crate directory: the workspace root is a virtual manifest, and
# examples/config.toml is what wires Speculos in as the target runner.
docker run --rm -v "$(pwd):/app" -w /app/ledger_device_sdk \
  ghcr.io/ledgerhq/ledger-app-builder/ledger-app-dev-tools:latest \
  cargo run --example nbgl_home_and_settings --target stax --release \
    --features io_new --config examples/config.toml

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.