I was curious when you do a
dumpwallet in the default bitcoin client the output file gives you an xprv and then followed by WIF keys, corresponding address, and the hdkeypath.
I noticed the order of the keys are not sequential with the keypath. For example when I did a dump of a test wallet with no balances I get:
hdkeypath=m/0'/0'/390' hdkeypath=m/0'/0'/489' hdkeypath=m/0'/0'/779' hdkeypath=m/0'/0'/48'
Is there a method behind the order or is it all random?