Skip to content

Support for stellar keys address --ledger #2556

@fnando

Description

@fnando

Summary

stellar keys address currently requires a named identity that resolves to a local keypair or stored key. There is no --ledger flag, so it is not possible to retrieve the public address of a Ledger hardware wallet account directly from the CLI.

Motivation

Knowing the address derived from a Ledger device is a fundamental operation — needed before funding, before sharing an address with a counterparty, and before scripting any workflow that involves a hardware wallet. Without this, users must open a separate tool (e.g. Ledger Live or a web wallet) just to look up their own address, which breaks the CLI-first development experience.

Proposed solution

Add a --ledger flag to stellar keys address 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. Prints the corresponding Stellar address to stdout.
  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:

Print the address for the default Ledger account (index 0):
  stellar keys address --ledger

Print the address for a specific account index:
  stellar keys address --ledger --hd-path 1

Acceptance criteria

  • stellar keys address --ledger connects to a Ledger device, derives the public key at index 0, and prints the corresponding Stellar address to stdout.
  • stellar keys address --ledger --hd-path N prints the address 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.

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