Skip to content

LedgerHQ/app-solana

 
 

Repository files navigation

Build Status

Solana app for Ledger Wallet

Overview

This app adds support for the Solana native token to Ledger Nano S hardware wallet.

Current Features:

  • Pubkey queries
  • Parse, display and sign all Solana CLI generated transaction formats
  • Blind sign arbitrary transactions (Enabled via settings)

Prerequisites

For building the app

Build the Ledger App Builder Docker image

  1. Clone the git repository
git clone https://github.com/LedgerHQ/ledger-app-builder.git
  1. Change directories
cd ledger-app-builder
  1. Checkout the target commit
git checkout 73c9e07
  1. Build the image
docker build -t ledger-app-builder:73c9e07 .
  • If permissions errors are encountered, ensure that your user is in the docker group and that the session has been restarted

For working with the device

Install Python3 PIP

Ubuntu Linux:

sudo apt install pip3

MacOS

brew install python3

Install ledgerblue python module

pip3 install ledgerblue

Locally clone SDK repos corresponding to those included in the Docker image

  • Setup environment
cat >>"${HOME}"/.profile <<EOF
LEDGER_SDK_BASE_PATH= # set to a writable path
: "${LEDGER_SDK_BASE_PATH:?}"
export NANOS_SDK="${LEDGER_SDK_BASE_PATH}"/nanos-secure-sdk
export NANOX_SDK="${LEDGER_SDK_BASE_PATH}"/nanox-secure-sdk
export NANOSP_SDK="${LEDGER_SDK_BASE_PATH}"/nanosplus-secure-sdk
EOF
  • Update the current session's environment
. "${HOME}"/.profile # Or close and reopen your terminal
  • Clone the repositories
# Nano S SDK
git clone --branch 2.1.0 --depth 1 https://github.com/LedgerHQ/nanos-secure-sdk.git "${NANOS_SDK}"

# Nano X SDK
git clone --branch 2.0.2-2 --depth 1 https://github.com/LedgerHQ/nanox-secure-sdk.git "${NANOX_SDK}"

# Nano S+ SDK
git clone --branch 1.0.3 --depth 1 https://github.com/LedgerHQ/nanosplus-secure-sdk.git "${NANOSP_SDK}"

For running the test suite

Build

It is highly recommended that you read and understand the Ledger App Builder build process before proceeding. A convenience wrapper script (./docker-make) has been provided for simplicity

docker-make manages the current target SDK for you, automatically setting BOLOS_SDK to the correct path when the Docker container is launched. A TARGET_SDK must be specified when building from clean and clean must be run before switching

TARGET_SDK

Moniker Device
s Nano S
x Nano X
sp Nano S+
./docker-make <TARGET_SDK>

Clean

./docker-make clean

Working with the device

Requires that the BOLOS_SDK envvar be set. This can be achieved by first building for the desired target device.

Load

make load-only

Delete

make delete

Test

Unit

Run C tests:

make -C libsol

Integration

First enable blind-signing in the App settings

cargo run --manifest-path tests/Cargo.toml

Packages

No packages published

Languages

  • C 77.9%
  • Rust 11.7%
  • Python 4.6%
  • C++ 3.7%
  • Shell 1.0%
  • Makefile 0.8%
  • CMake 0.3%