Skip to content

Waves wallet application for Ledger Nano S

License

Notifications You must be signed in to change notification settings

LedgerHQ/app-waves

 
 

Repository files navigation

ledger-app-waves 🔷 Build Status

Introduction 🔐

This is a Ledger devices wallet app for Waves platform.

Special thanks to Jean Passot, Cédric Mesnil, and Oto from the Ledger team, Jake Bordens from the Ledger/Birst community for their support and advices. Thanks to the Waves community for trusting the tokens on this application.

For app APDU protocol and an integration manual please take a look at this.

Building 👷

Also there're ledger docker image, you can use it to build it.

Nano S

rm -rf bin/ debug/ dep/ obj/ app.hex src/glyphs.c src/glyphs.h && make BOLOS_ENV=/opt/ledger/ BOLOS_SDK=/home/nanos-secure-sdk

Nano X

rm -rf bin/ debug/ dep/ obj/ app.hex src/glyphs.c src/glyphs.h && make BOLOS_ENV=/opt/ledger/ BOLOS_SDK=/home/ledger/sdk-nanox-1.2.4-1.3

Nano S plus

rm -rf bin/ debug/ dep/ obj/ app.hex src/glyphs.c src/glyphs.h && make BOLOS_ENV=/opt/ledger/ BOLOS_SDK=/home/nanosplus-secure-sdk/

Installation 📲

You can download the official version of this application, signed and verified by the Ledger team, from the official Ledger Live application.

Building and installing from the source code is usually required in order to develop or customize the application. In addition, you will receive a warning that this application was received from an unreliable source. Try to avoid this, it may be unsafe.

If you build the app not in the Docker, but in your host OS then just call make load. Note that you should have the python env with ledgerblue installed. If you can't install ledgerblue, try install the dependencies into your system. There're some more details also.

If you use Docker to build the app, then call this from app root on you host OS:

Nano S

python -m ledgerblue.loadApp --appFlags 0x240 --path "44'/5741564'" --curve secp256k1 --curve ed25519 --tlv --targetId 0x31100004 --delete --fileName bin/app.hex --appName Waves --appVersion 1.1.0 --dataSize 64 --icon 010000000000ffffffffffffff7ffe3ffc1ff80ff007e003c003c007e00ff01ff83ffc7ffeffffffff

Nano X (Only with developer firmware)

Note that at the time of publication of this manual (March 2020), the installation of your applications is possible only on special devices for developers.

python -m ledgerblue.loadApp --appFlags 0x240 --path "44'/5741564'" --curve secp256k1 --curve ed25519 --tlv --targetId 0x33000004 --delete --fileName bin/app.hex --appName "Waves" --appVersion 1.1.0 --dataSize 256 --icon 010000000000ffffff000030001ec00ff807ffe3fff97ffc0ffe013f8007c0000000

Nano S plus

python -m ledgerblue.loadApp --appFlags 0x240 --path "44'/5741564'" --curve secp256k1 --curve ed25519 --tlv --targetId 0x33100004 --targetVersion="1.0.2" --delete --fileName bin/app.hex --appName "Waves" --appVersion 1.1.4 --dataSize $((0x`cat debug/app.map |grep _envram_data | tr -s ' ' | cut -f2 -d' '|cut -f2 -d'x'` - 0x`cat debug/app.map |grep _nvram_data | tr -s ' ' | cut -f2 -d' '|cut -f2 -d'x'`))

If you want to build under nano x, you need to do it via this.

Debugging 🙇

To simplify the development and debugging process, it is recommended to follow the Ledger debugging instructions and try to find a solution of your problem here. All this has been tested only with the Ledger Nano S.

  1. Install a debug firmware (according to the instructions above)
  2. Install a custom CA for PIN bypass (according to the instructions above)
  3. Build and use USBTool (according to the instructions above).

Hint: before that on Mac OS X you should install a libusb-compat package: brew install libusb-compat, then just call make clean && make from the app root

  1. Change debug flag in Makefile to DEBUG = 1
  2. Build and install the app adding the --rootPrivateKey key from the second step

Now the device should ask you only one confirmation instead of several! Take care of your buttons, fingers and time 😊

  1. Start usbtool on the PC, then your app on Ledger device, send some APDU and look at the debug output in usbtool stdout!
  2. Check the Ledger device emulator, but at the time of writing (March 2020), it does not support most system calls. For now it perhaps only suitable for debugging an app UI on Ubuntu.

Happy hacking!

About

Waves wallet application for Ledger Nano S

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C 84.8%
  • Python 7.1%
  • C++ 6.9%
  • Other 1.2%