Skip to content

Support funding Ledger hardware wallet addresses via stellar keys fund --ledger #2555

Description

@fnando

Summary

It is currently not possible to fund a Ledger hardware wallet address using the CLI. Running stellar keys fund requires an identity that resolves to a local keypair; there is no --ledger flag, so Ledger users must derive their address out-of-band and fund it via other means.

Motivation

Hardware wallets are a primary key-management option in the CLI (stellar keys add --ledger), and funding a freshly-derived address on testnet/futurenet is a routine first step in any development workflow. Without this capability, Ledger users face an inconsistent experience — every other key type can be funded directly.

Proposed solution

Add a --ledger flag to stellar keys fund that:

  1. Connects to the attached Ledger device and derives the public key for account index 0 (i.e. m/44'/148'/0') by default.
  2. Calls Friendbot (or the configured funder) with that address, identical to how funding already works for named identities.
  3. Respects --hd-path <N> when provided, where N is the integer account index used to derive the address at m/44'/148'/N'.

Desired usage:

Fund the default Ledger account (index 0):
  stellar keys fund --ledger

Fund a specific account index:
  stellar keys fund --ledger --hd-path 1

Acceptance criteria

  • stellar keys fund --ledger connects to a Ledger device, derives the public key at index 0, and funds the corresponding account via Friendbot.
  • stellar keys fund --ledger --hd-path N funds the account derived at the given integer index.
  • A clear error is shown when no Ledger device is connected or the Stellar app is not open on the device.
  • A clear error is shown when Friendbot is unavailable (consistent with the existing behaviour for --fund on keys generate).
  • The funded address is printed to stdout so the user can confirm which account was topped up.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status
    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions