Skip to content

fix(ledger): iterate account indexes in ledgerLiveMode - #797

Open
Steve0x2a wants to merge 1 commit into
celo-org:masterfrom
Steve0x2a:fix/ledger-live-account-indexes
Open

fix(ledger): iterate account indexes in ledgerLiveMode#797
Steve0x2a wants to merge 1 commit into
celo-org:masterfrom
Steve0x2a:fix/ledger-live-account-indexes

Conversation

@Steve0x2a

@Steve0x2a Steve0x2a commented Sep 8, 2026

Copy link
Copy Markdown

Description

--ledgerLiveMode iterated the BIP-44 change index (m/44'/60'/0'/N/0) instead of the hardened account index that Ledger Live uses (m/44'/60'/N'/0/0). Only the first Ledger Live account was discoverable.

This adds accountIndexes to @celo/wallet-ledger and @celo/viem-account-ledger, and wires --ledgerLiveMode to:

  • accountIndexes: indicesToIterateOver
  • changeIndexes: [0]
  • derivationPathIndexes: [0]

Non-live --useLedger behavior is unchanged.

Credits @palango for the report, the file/line analysis, and the suggested API.

Tested

  • @celo/wallet-ledger unit tests: account indexes 0, 1, and 2 produce 44'/60'/N'/0/0 (index ≥1 distinguishes the bug from iterating change). Omitting accountIndexes still uses the account from the base path. Existing change/address iteration is unchanged.
  • @celo/viem-account-ledger unit tests: the same path construction via deriveLedgerAccounts and ledgerToWalletClient.
  • CLI base.test.ts live-mode expectations now pass accountIndexes instead of changeIndexes.

Related issues

--ledgerLiveMode iterated the BIP-44 change component, producing
m/44'/60'/0'/N/0 instead of Ledger Live's m/44'/60'/N'/0/0.

Add accountIndexes to @celo/wallet-ledger and @celo/viem-account-ledger
and wire --ledgerLiveMode to iterate the hardened account index.

Fixes celo-org#789

Signed-off-by: Yi Zhan <stevesough@gmail.com>
@Steve0x2a
Steve0x2a requested a review from a team as a code owner September 8, 2026 01:46
@changeset-bot

changeset-bot Bot commented Sep 8, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: c7e33f4

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 10 packages
Name Type
@celo/wallet-ledger Patch
@celo/viem-account-ledger Patch
@celo/celocli Patch
@celo/wallet-base Patch
@celo/wallet-hsm-aws Patch
@celo/wallet-hsm-azure Patch
@celo/wallet-hsm-gcp Patch
@celo/wallet-hsm Patch
@celo/wallet-local Patch
@celo/wallet-remote Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

--ledgerLiveMode iterates the BIP-44 change index instead of the hardened account index

1 participant