Getting all funded priv keys from a HD xprv key?

(Woyen) #1

Hey guys!

I’m very excited about this project!
I want to build an application and one of the things I’d need to do is what I specified in the subject.
Could that be done? I’m guessing it can.
Could anyone point me to some code ideas to get started?

I’m just starting out and honestly have no idea where to begin.
Anything related would help a lot.

Thank you!

(Braydon Fuller) #2

If you haven’t visited these already:

(Woyen) #4

Hi! Thanks, working great!

Just a question, when do I stop deriving? I would guess all HD key wallets would derive contiguous keys right?
Such as: m/0/0/0, m/0/0/1, m/0/0/2
Otherwise you’d never know when to stop deriving.

Is that correct? Can I get the balance of an XPUB by looking for addresses with transactions and stop as soon as an address doesn’t have a transaction in the BC?

(Braydon Fuller) #5

BIP044 describes this process:

(Woyen) #6

Thanks, shouldn’t have skimped over the standard, will read it fully now.

(Jeshan Babooa) #7

@braydon How would the discovery work in bitcore? Any link (e.g sample, doc) you can point me to? I couldn’t find any