Let us say that we create 3 bitcoin address and 4 ethereum address. This means that we have 3 public private key for bitcoin and 4 public private key for ether.

After recovery using the 24 word seed, How the new ledger nano s knows that I have used 3 address in bitcoin and 4 address in ethereum.

I wonder how this happens. Could you please help me to understand ?

  • My guess would be that it scans the blockchain and looks to see how many addresses from the address sequences have been used. As far as I can tell, this is how JAXX works.
    – lungj
    Commented Sep 26, 2017 at 13:51
  • @lungj but the number of address is infinite right ?
    – iappmaker
    Commented Sep 26, 2017 at 14:08
  • It’s bounded by the number of unique Ethereum addresses. But even if it weren’t, it’s also bounded by the number of transactions you can make.
    – lungj
    Commented Sep 26, 2017 at 14:18
  • Even if the system assumed you never need more than a trillion addresses (enough for about 50 transactions per second for the average person’s lifetime), it would have to check no more than 40 addresses to figure out where to it left off (per chain).
    – lungj
    Commented Sep 26, 2017 at 14:40
  • Unable to understand your latest comment
    – iappmaker
    Commented Sep 26, 2017 at 17:27

1 Answer 1


BIP44 defines the address gap limit to be 20. Which means during recovery, as when importing your master public key in a wallet for monitoring, the software looks 20 addresses ahead of the last used address.

If functioning normally, the software should only derive a new public address if the last one hasn't seen any transaction. You can't force the Ledger Nano app to create a new address. From BIP44 again:

Wallet software should warn when the user is trying to exceed the gap limit on an external chain by generating a new address.

This is to avoid the problem of having to potentially re-generate and scan an arbitrary number or public addresses.

So basically the recovery procedure is:

  • Derivate 20 keys from the master public key
  • Scan all adresses
  • Take the last used one (child X) and generate keys up to X+20
  • Scan the new addresses
  • Rinse and repeat last 2 steps until nothing new shows up

There is a bit longer and general explanation of the system here.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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