6

I'm trying to find a way where I can view balance of my ledger nano s wallet without always attaching it to computer all the time.

I found something called xpub address which allows me to generate public addresses without my hardware wallet, I am now trying to figure out if there is a way (api ideally) to use this xpub address to view balance from my previously generated addresses.

2

Certainly. If you use the master public key (the xpub that you have), you can enter it into a site like blockchain.info to get the balances of many of the addresses derived from that key. Generally software that do this sort of monitoring (including your wallet software), only search a few addresses (all of the ones that have been used in a transaction and then some number ahead of those) so it may miss some of your transactions.

You can also setup a desktop wallet software like Electrum to work with your Ledger Nano S. This allows you to get new addresses and monitor your balance without having the device connected and still be able to connect your Ledger to spend from it when you want to.

3

That's exactly what the Sentinel app does: imports a read-only XPUB key in order to passively watch the balance of an offline wallet, be it paper wallet, trezor or ledger.

For use with Ledger Nano S use the following steps:

  1. From the chrome app: Click My Account.
  2. Click Account Settings in the top right corner.
  3. Click Export next to Extended public key.
  4. In the Sentinel app tap the + button and select
    • Bitcoin Wallet (BIP44) — if you set up your ledger as legacy.
    • Segwit Bitcoin Wallet (BIP49) — if you set up your ledger as segwit.

Sentinel can also be used to receive funds to your ledger in the sense that it can derive the next public address from the XPUB and display its QR-code.

If you feel paranoid you can also build the app from source: https://github.com/Samourai-Wallet/sentinel-android. Maybe it's worth mentioning that while the client code is open-source the server-side code is not, so we don't really know what is going on in the backend.

Direct query via address or xpub

Another (tedious) alternative would be to collect all the public non-empty addresses in the wallet and get their cumulative balance e.g. via https://blockchain.info/q/addressbalance/myadress1|myaddres2|myaddress3... — the result is a plain text number in satoshis; divide by 100000000 (i.e. 1e8) to get BTC.

Or, if you are comfortable sending your xpub over the internet, then you can query blockchain.info with your xpub, e.g.:

  • 1
    Just to expand on the "comfortable sending your xpub over the internet" part: an xpub key combined with a child private key can enough to reveal parent private keys, so while xpub keys are technically public, you want to be more cautious with the data than you might in other cases. – copumpkin Dec 31 '17 at 18:16
  • Wrote some script to turn TX into a CSV github.com/digitaldonkey/TransactionsExport – digitaldonkey Mar 30 at 21:18
0

You can use a watch only wallet service like Blockonnomics to see addresses/balance in your xpub. In fact it also allows you to generate new receiving addresses.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.