ava-labs / ava-labs/avax-js-cli-tools

address_gen.js does not generate internal addresses

Open
#9 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
20
Forks
15
PR merge metrics
No merged PRs in 30d

Description

[address_gen.js](https://github.com/ava-labs/avax-js-cli-tools/blob/master/address_gen.js) generates external addresses only by default:

``` javascript
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):

``` javascript
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

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with address_gen.js and trace how it builds the derivation path and accepts command-line options. Add a way to generate internal addresses using the /1/i branch while preserving the current external /0/i default. Done means both address types can be generated and the existing external behavior remains unchanged.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
blockchain, cli
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.