72 stable releases

new 1.21.5 Mar 13, 2025
1.21.3 Feb 26, 2025
1.19.0 Dec 16, 2024
1.18.4 Nov 7, 2024
1.0.1 Nov 24, 2023

#29 in Hardware support

Download history 389/week @ 2024-11-20 349/week @ 2024-11-27 395/week @ 2024-12-04 619/week @ 2024-12-11 350/week @ 2024-12-18 108/week @ 2024-12-25 709/week @ 2025-01-01 683/week @ 2025-01-08 646/week @ 2025-01-15 1036/week @ 2025-01-22 1278/week @ 2025-01-29 1350/week @ 2025-02-05 1566/week @ 2025-02-12 2406/week @ 2025-02-19 2322/week @ 2025-02-26 1131/week @ 2025-03-05

7,485 downloads per month
Used in ledger_device_ui_sdk

Apache-2.0

465KB
10K SLoC

Rust 8K SLoC // 0.0% comments C 2K SLoC // 0.0% comments GNU Style Assembly 36 SLoC

Ledger device SDK for Rust Applications

Dynamic TOML Badge

Crate that allows developing Ledger device apps in Rust with a default configuration.

Contains:

  • some safe wrappers over common syscalls
  • IO abstractions
  • signature abstractions
  • UI libraries (the ui module for Nano (S/SP/X) apps, nbgl module for Stax and Flex apps)

Supported devices

Nano X Nano S Plus Stax Flex

Usage

Building requires adding rust-src to your Rust installation, and both Clang and arm-none-eabi-gcc. On Ubuntu, gcc-multilib might also be required.

Using rustc nightly builds is mandatory as some unstable features are required.

If you wish to install the ARM gcc toolchain using your distribution's packages, these commands should work:

# On Debian and Ubuntu
sudo apt install clang gcc-arm-none-eabi gcc-multilib

# On Fedora or Red Hat Entreprise Linux
sudo dnf install clang arm-none-eabi-gcc arm-none-eabi-newlib

# On ArchLinux
sudo pacman -S clang arm-none-eabi-gcc arm-none-eabi-newlib

This SDK provides custom target files. One for each supported device.

Building for Nano X

cargo build --release --target=nanox

Building for Nano S+

cargo build --release --target=nanosplus

Building for Stax

cargo build --release --target=stax

Building for Flex

cargo build --release --target=flex

Contributing

You can submit an issue or even a pull request if you wish to contribute.

Make sure you've followed the installation steps above. In order for your PR to be accepted, it will have to pass the CI, which performs the following checks:

  • Check if the code builds on nightly
  • Check that clippy does not emit any warnings
  • check that your code follows rustfmt's format (using cargo fmt)

Dependencies

~6–9MB
~146K SLoC