Skip to content
Bitcoin wallet application for Ledger Blue and Nano S
Branch: master
Clone or download
btchip Merge pull request #111 from TamtamHero/master
fix Nano X/S dashboard icon
Latest commit 195695e Apr 16, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
doc
glyphs fix Nano X/S dashboard icon Apr 16, 2019
include remove Hcash and Posw coins Mar 18, 2019
js Change Ledger Blue to Ledger App Feb 6, 2019
src fix Nano X/S dashboard icon Apr 16, 2019
.gitignore Refresh icons for Blue 2.0 Jan 22, 2017
LICENSE Initial commit May 26, 2016
Makefile Update with latest Nano X SDK Apr 5, 2019
README.md Change Ledger Blue to Ledger App Feb 6, 2019
TODO.md
bitcoin.png Change png to 644 Feb 6, 2019
bitcoin_cash.png Change png to 644 Feb 6, 2019
bitcoin_gold.png
bitcoin_private.png Change png to 644 Feb 6, 2019
bitcoin_testnet.png
blue_app_bitcoin.gif Display the full (scrollable) destination address on Nano S Jul 25, 2017
blue_app_bitcoin_cash.gif Fix mixed Segwit/regular inputs signing, add Bitcoin Cash app Aug 1, 2017
blue_app_bitcoin_gold.gif
blue_app_bitcoin_private.gif Add missing Blue icons Jul 9, 2018
blue_app_bitcoin_testnet.gif
blue_app_dash.gif Display the full (scrollable) destination address on Nano S Jul 25, 2017
blue_app_digibyte.gif Add DGB, Hcash, QTUM Nov 30, 2017
blue_app_dogecoin.gif Display the full (scrollable) destination address on Nano S Jul 25, 2017
blue_app_gamecredits.gif GameCredits: update with approved graphics Oct 31, 2018
blue_app_horizen.gif Rebrand Horizen Aug 28, 2018
blue_app_komodo.gif Display the full (scrollable) destination address on Nano S Jul 25, 2017
blue_app_litecoin.gif Display the full (scrollable) destination address on Nano S Jul 25, 2017
blue_app_nix.gif Add PR #98 Feb 1, 2019
blue_app_peercoin.gif
blue_app_pivx.gif
blue_app_qtum.gif Add DGB, Hcash, QTUM Nov 30, 2017
blue_app_stealth.gif
blue_app_stratis.gif Display the full (scrollable) destination address on Nano S Jul 25, 2017
blue_app_vertcoin.gif
blue_app_viacoin.gif Add native Segwit addresses support and pivx, vertcoin, viacoin Oct 20, 2017
blue_app_xsn.gif Merge PR #56 and bump version Jan 22, 2019
blue_app_zcash.gif Display the full (scrollable) destination address on Nano S Jul 25, 2017
blue_app_zclassic.gif Add Icons and Images Nov 27, 2018
blue_app_zcoin.gif
dash.png Change png to 644 Feb 6, 2019
digibyte.png Change png to 644 Feb 6, 2019
dogecoin.png
gamecredits.png GameCredits: update with approved graphics Oct 31, 2018
horizen.png
komodo.png Change png to 644 Feb 6, 2019
litecoin.png Change png to 644 Feb 6, 2019
nanos_app_bitcoin.gif
nanos_app_bitcoin_cash.gif
nanos_app_bitcoin_gold.gif Add Bitcoin Gold support Nov 21, 2017
nanos_app_bitcoin_private.gif Add Bitcoin Private, ZenCash, CashAddr support Apr 18, 2018
nanos_app_bitcoin_testnet.gif Display the full (scrollable) destination address on Nano S Jul 25, 2017
nanos_app_dash.gif Display the full (scrollable) destination address on Nano S Jul 25, 2017
nanos_app_digibyte.gif
nanos_app_dogecoin.gif
nanos_app_gamecredits.gif GameCredits: update with approved graphics Oct 31, 2018
nanos_app_horizen.gif fix horizen icon Aug 28, 2018
nanos_app_komodo.gif
nanos_app_litecoin.gif Display the full (scrollable) destination address on Nano S Jul 25, 2017
nanos_app_nix.gif Add PR #98 Feb 1, 2019
nanos_app_peercoin.gif Display the full (scrollable) destination address on Nano S Jul 25, 2017
nanos_app_pivx.gif
nanos_app_qtum.gif Add DGB, Hcash, QTUM Nov 30, 2017
nanos_app_stealth.gif update stealthcoin to stealth Jun 14, 2018
nanos_app_stratis.gif Display the full (scrollable) destination address on Nano S Jul 25, 2017
nanos_app_vertcoin.gif
nanos_app_viacoin.gif
nanos_app_xsn.gif Merge PR #56 and bump version Jan 22, 2019
nanos_app_zcash.gif
nanos_app_zclassic.gif Add Icons and Images Nov 27, 2018
nanos_app_zcoin.gif
nanox_app_bitcoin.gif
nanox_app_bitcoin_cash.gif Add support for Nano X Mar 8, 2019
nanox_app_bitcoin_gold.gif
nanox_app_bitcoin_private.gif Add support for Nano X Mar 8, 2019
nanox_app_bitcoin_testnet.gif
nanox_app_dash.gif
nanox_app_digibyte.gif Add support for Nano X Mar 8, 2019
nanox_app_dogecoin.gif
nanox_app_gamecredits.gif
nanox_app_horizen.gif Add support for Nano X Mar 8, 2019
nanox_app_komodo.gif Add support for Nano X Mar 8, 2019
nanox_app_litecoin.gif
nanox_app_nix.gif Add support for Nano X Mar 8, 2019
nanox_app_peercoin.gif Add support for Nano X Mar 8, 2019
nanox_app_pivx.gif
nanox_app_qtum.gif Add support for Nano X Mar 8, 2019
nanox_app_stealth.gif Add support for Nano X Mar 8, 2019
nanox_app_stratis.gif Add support for Nano X Mar 8, 2019
nanox_app_vertcoin.gif Add support for Nano X Mar 8, 2019
nanox_app_viacoin.gif Add support for Nano X Mar 8, 2019
nanox_app_xsn.gif Add support for Nano X Mar 8, 2019
nanox_app_zcash.gif
nanox_app_zclassic.gif
nanox_app_zcoin.gif Add support for Nano X Mar 8, 2019
nix.png Add PR #98 Feb 1, 2019
peercoin.png Change png to 644 Feb 6, 2019
pivx.png
qtum.png Change png to 644 Feb 6, 2019
stealth.png Change png to 644 Feb 6, 2019
stratis.png
vertcoin.png Change png to 644 Feb 6, 2019
viacoin.png Change png to 644 Feb 6, 2019
xsn.png
zcash.png Change png to 644 Feb 6, 2019
zclassic.png
zcoin.png updated Makefile for auto-deploy Aug 28, 2018

README.md

ledger-app-btc

Bitcoin wallet application for Ledger Blue and Nano S

This follows the beta specification at https://ledgerhq.github.io/btchip-doc/bitcoin-technical-beta.html - with the regular set of APDUs for standard wallet operations enabled.

Can be tested quickly tested with the Python API at https://github.com/LedgerHQ/btchip-python and Electrum (force noPin = True in getClient in plugins/ledger/ledger.py)

This application is compatible with the Ledger Bitcoin Wallet Chrome Application available on Github at https://github.com/LedgerHQ/blue-app-btc and on Chrome Web Store at https://chrome.google.com/webstore/detail/ledger-wallet-bitcoin/kkdpmhnladdopljabkgpacgpliggeeaf

Using the beta high level communication API (1.1.2+)

The high level communication API provides a set of functions to directly sign transactions in Chrome, Opera or Firefox with the U2F extension with no Chrome app installed.

To use this API, make sure that "Browser Mode" is activated in the Settings of the Nano S application. This setting is not compatible with the former communication API, and needs to be disabled to use the Ledger Wallet Chrome application

Usage

Include the necessary headers (copied from the js/ directory) in your web page

<head>
  <script src="thirdparty/q.js"></script>
  <script src="thirdparty/async.min.js"></script>
  <script src="thirdparty/u2f-api.js"></script>
  <script src="dist/ledger-btc.js"></script>
</head>

Create a communication object

var dongle = new LedgerBtc(20);

For each UTXO included in your transaction, create a transaction object from the raw serialized version of the transaction used in this UTXO

var tx1 = dongle.splitTransaction("01000000014ea60aeac5252c14291d428915bd7ccd1bfc4af009f4d4dc57ae597ed0420b71010000008a47304402201f36a12c240dbf9e566bc04321050b1984cd6eaf6caee8f02bb0bfec08e3354b022012ee2aeadcbbfd1e92959f57c15c1c6debb757b798451b104665aa3010569b49014104090b15bde569386734abf2a2b99f9ca6a50656627e77de663ca7325702769986cf26cc9dd7fdea0af432c8e2becc867c932e1b9dd742f2a108997c2252e2bdebffffffff0281b72e00000000001976a91472a5d75c8d2d0565b656a5232703b167d50d5a2b88aca0860100000000001976a9144533f5fb9b4817f713c48f0bfe96b9f50c476c9b88ac00000000");

var tx2 = dongle.splitTransaction("...")

To sign a transaction involving standard (P2PKH) inputs, call createPaymentTransactionNew_async with the folowing parameters

  • inputs is an array of [ transaction, output_index, optional redeem script, optional sequence ] where
    • transaction is the previously computed transaction object for this UTXO
    • output_index is the output in the transaction used as input for this UTXO (counting from 0)
    • redeem script is the optional redeem script to use when consuming a Segregated Witness input
    • sequence is the sequence number to use for this input (when using RBF), or non present
  • associatedKeysets is an array of BIP 32 paths pointing to the path to the private key used for each UTXO
  • changePath is an optional BIP 32 path pointing to the path to the public key used to compute the change address
  • outputScript is the hexadecimal serialized outputs of the transaction to sign
  • lockTime is the optional lockTime of the transaction to sign, or default (0)
  • sigHashType is the hash type of the transaction to sign, or default (all)

This method returns the signed transaction ready to be broadcast

dongle.createPaymentTransactionNew_async(
   [ [tx, 1] ], 
   ["0'/0/0"], 
   undefined, 
   "01905f0100000000001976a91472a5d75c8d2d0565b656a5232703b167d50d5a2b88ac").then(
     function(result) { console.log(result);}).fail(
     function(error) { console.log(error); });
);

To obtain the signature of multisignature (P2SH) inputs, call signP2SHTransaction_async with the folowing parameters

  • inputs is an array of [ transaction, output_index, redeem script, optional sequence ] where
    • transaction is the previously computed transaction object for this UTXO
    • output_index is the output in the transaction used as input for this UTXO (counting from 0)
    • redeem script is the mandatory redeem script associated to the current P2SH input
    • sequence is the sequence number to use for this input (when using RBF), or non present
  • associatedKeysets is an array of BIP 32 paths pointing to the path to the private key used for each UTXO
  • outputScript is the hexadecimal serialized outputs of the transaction to sign
  • lockTime is the optional lockTime of the transaction to sign, or default (0)
  • sigHashType is the hash type of the transaction to sign, or default (all)

This method returns the signed transaction ready to be broadcast

dongle.signP2SHTransaction_async(
   [ [tx, 1, "52210289b4a3ad52a919abd2bdd6920d8a6879b1e788c38aa76f0440a6f32a9f1996d02103a3393b1439d1693b063482c04bd40142db97bdf139eedd1b51ffb7070a37eac321030b9a409a1e476b0d5d17b804fcdb81cf30f9b99c6f3ae1178206e08bc500639853ae"] ], 
   ["0'/0/0"], 
   "01905f0100000000001976a91472a5d75c8d2d0565b656a5232703b167d50d5a2b88ac").then(
     function(result) { console.log(result);}).fail(
     function(error) { console.log(error); });
);
You can’t perform that action at this time.