Bitcoin Forum
December 15, 2024, 01:01:40 PM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: BIP32: scan gap limit without a full node  (Read 1304 times)
keeshux (OP)
Newbie
*
Offline Offline

Activity: 26
Merit: 6


View Profile WWW
August 31, 2014, 12:26:19 PM
 #1

Considering the gap limit as the number of unused addresses before stopping generating chain addresses, I wonder how you would scan such addresses in an SPV environment. Would you rely on web services like blockchain.info or biteasy.com for setting up the Bloom filter for the initial sync?

This is the sync preamble of a HD wallet:

  • 1. Establish a gap limit G.
  • 2. Generate some spare m/k'/0/i addresses starting from i = 0.
  • 3. Look up the blockchain for usage of the above addresses in any transactions.
  • 4. Stop when at least G consecutive unused addresses are found.
  • 5. Load a Bloom filter with all the generated addresses before the gap.
  • 6. Start syncing.

Well, I don't know how to efficiently implement step 3, given that relying on 3rd parties is not ideal.

Thanks!
dabura667
Sr. Member
****
Offline Offline

Activity: 475
Merit: 252


View Profile
August 31, 2014, 03:48:09 PM
 #2

Code:
http://btc.blockr.io/api/v1/address/info/198aMn6ZYAczwrE5NvNTUMyJ5qkfy4g3Hi,1L8meqhMTRpxasdGt8DHSJfscxgHHzvPgk

Replace the addresses with what you want to query, it will come back as a json.

My Tip Address:
1DXcHTJS2DJ3xDoxw22wCt11FeAsgfzdBU
keeshux (OP)
Newbie
*
Offline Offline

Activity: 26
Merit: 6


View Profile WWW
August 31, 2014, 06:30:24 PM
 #3

Code:
http://btc.blockr.io/api/v1/address/info/198aMn6ZYAczwrE5NvNTUMyJ5qkfy4g3Hi,1L8meqhMTRpxasdGt8DHSJfscxgHHzvPgk

Replace the addresses with what you want to query, it will come back as a json.

Quote
Well, I don't know how to efficiently implement step 3, given that relying on 3rd parties is not ideal.

dabura, I'm looking for robust solutions (if any) based on the Bitcoin network itself, I don't like at all the idea that syncing a thin client requires an external service provider. A more natural process should exist to check "used" addresses, perhaps something like the filterload extension. The only concern is privacy because the peer needs to learn about our exact addresses to scan them for usage. The same applies to the web services approach though.
fbueller
Sr. Member
****
Offline Offline

Activity: 412
Merit: 287


View Profile
September 01, 2014, 03:51:48 AM
 #4

Connect to random stratum servers and request your transactions through them! That's what electrum does.

Bitwasp Developer.
keeshux (OP)
Newbie
*
Offline Offline

Activity: 26
Merit: 6


View Profile WWW
September 01, 2014, 04:53:58 PM
 #5

Thanks fbueller, very useful information. Lurking around I stumbled upon BIP 33 that could even provide a solution at the Bitcoin network level. Is this scheduled for implementation in Bitcoin Core?
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!