avax-js-cli-tools icon indicating copy to clipboard operation
avax-js-cli-tools copied to clipboard

address_gen.js does not generate internal addresses

Open michaelbnewman opened this issue 4 years ago • 1 comments

address_gen.js generates external addresses only by default:

const AVAX_ACCOUNT_PATH = `m/44'/9000'/0'`;
let derivationPath = `${AVAX_ACCOUNT_PATH}/0/${i}`;

It would be nice to have option to also generate internal addresses (used when generating "spare change" in a transaction):

const AVAX_ACCOUNT_PATH = `m/44'/9000'/0'`;
let derivationPath = `${AVAX_ACCOUNT_PATH}/1/${i}`;

For some background info on the difference on external vs internal addresses, see: https://medium.com/@harshagoli/hd-wallets-explained-from-high-level-to-nuts-and-bolts-9a41545f5b0

michaelbnewman avatar Nov 22 '20 04:11 michaelbnewman

address_gen.js generates external addresses only by default:

const AVAX_ACCOUNT_PATH = `m/44'/9000'/0'`;
let derivationPath = `${AVAX_ACCOUNT_PATH}/0/${i}`;

It would be nice to have option to also generate internal addresses (used when generating "spare change" in a transaction):

const AVAX_ACCOUNT_PATH = `m/44'/9000'/0'`;
let derivationPath = `${AVAX_ACCOUNT_PATH}/1/${i}`;

For some background info on the difference on external vs internal addresses, see: https://medium.com/@harshagoli/hd-wallets-explained-from-high-level-to-nuts-and-bolts-9a41545f5b0

I added this feature in my PR in case this is still relevant

secullod avatar Apr 24 '23 17:04 secullod