Is there any service/api for deriving HD wallet addresses from a master public key?

4

1

I need this for a tool i'm writing that generates a transaction history report. think: accounting, auditing, etc. The tool does not and should not have access to the private keys.

Ideally, the API would:

  1. not require creating a wallet first. I only need it to derive keys.
  2. return only addresses that have been used (received funds), up to the gap defined in bip44.

Alternatively, are there any command-line tools that can do this?

danda

Posted 2015-07-30T21:59:08.280

Reputation: 41

I have created a 2of3 wallet on Coinbase. I have 3 different xpub. I tried all 3 xpub on goochain.net but in all appear 0 balance. But I have 2 btc. How to monitor the 2of3 of coinbase using xpub? – Leonardo – 2016-01-02T13:58:54.527

@Leonardo, that sounds like the beginnings of a good question, perhaps you should ask a separate question! The field you entered in before is for answers, not questions. Does coinbase show you an address that starts with a '3' somewhere? That's where the 2-of-3 coins should be held. – morsecoder – 2016-01-03T18:28:47.603

Answers

4

I ended up writing my own command-line tool to perform wallet discovery and print out a report.

It supports single xpub derivation as well as multisig m-of-n wallets, specifically CoPay wallets.

It determines if each address has been used or not by querying blockchain.info or also toshi or insight servers (the latter two can be run locally.)

Anyone interested can check it out at: https://github.com/dan-da/hd-wallet-addrs

I plan to add a web frontend soon. Update: Web frontend is here.

Also, blockonomics is pretty good and very fast. They don't seem to support CoPay/multisig yet though.

danda

Posted 2015-07-30T21:59:08.280

Reputation: 41

1

I have 3 ways I go about this:

  1. BX tool by libbitcoin
  2. Python libraries, namely pybitcointools ...
  3. and PyCoin

Both have a CLI interface, though PyCoin is more comprehensive. The address scanning is something that can be achieved with this pybitcointools fork.

You'll need to clarify your preferences in terms of shell/OS/programming language for me to detail this specifically. If you're comfortable with pybitcointools I can detail that.

Wizard Of Ozzie

Posted 2015-07-30T21:59:08.280

Reputation: 4 920

@danda I will detail the method which best suits your situation, so take a look at these options and chime in on your preference. I can detail them all, if needs be. – Wizard Of Ozzie – 2015-07-31T06:21:37.263

linux / php CLI. After more investigation it looks like https://github.com/Bit-Wasp/bitcoin-lib-php is probably my best bet, and also doing it locally keeps the xpub private vs calling an online service.

– danda – 2015-07-31T18:25:41.137

0

Goochain web service does exactly what you request: It provides addresses used listing of the wallet. It doesn't have access to the private keys. Just input xpub... in search field, and it would display all transaction on any BIP32 and BIP44 derived addresses.

goochain.net

This is not API but a web service.

antonio-fr

Posted 2015-07-30T21:59:08.280

Reputation: 21

hmm, goochain looks like they have the functionality but I see no way to programmatically call their service, so it doesn't solve my problem. Also it is not clear to me if they find change addresses, which I need. – danda – 2015-07-31T18:18:18.500

This is only a web service that provides basic accounting and transaction history. Goochain displays all used addresses from a xpub. It displays change and payment addresses (/0 and /1), additionally it searches on the direct chain (so you can provide xpub for any branch) – antonio-fr – 2015-08-01T22:32:11.610

0

You can search xpubs using blockonomics api .Would return both main chain and change addreses along with their balance

dark knight

Posted 2015-07-30T21:59:08.280

Reputation: 1 631

They must have removed that option because their docs say nothing about xpubs – priestc – 2016-04-20T22:30:21.670

its does actually https://www.blockonomics.co/views/faqs.html (How to search HD wallet)

– dark knight – 2016-04-21T04:42:45.937

0

Try Goochain's Watch-Only Wallet Services for BIP32 addresses created via Ledger, Trezor, or Mycelium. Based on the xpub, their tool only returns addresses that have been used on-chain previously.

cbinrva

Posted 2015-07-30T21:59:08.280

Reputation: 11

0

https://samouraiwallet.com/sentinel.html

Samourai wallet has another app called Sentinel which is a watch-only bitcoin wallet. The app does not handle private keys for spending (aside from sweeping). Sentinel provides transaction, balance, and receive addresses for each public key provided.

KryptoKidz

Posted 2015-07-30T21:59:08.280

Reputation: 135