Skip to content

Add --ledger to stellar keys address#2557

Merged
fnando merged 2 commits intomainfrom
keys-address-ledger
May 5, 2026
Merged

Add --ledger to stellar keys address#2557
fnando merged 2 commits intomainfrom
keys-address-ledger

Conversation

@fnando
Copy link
Copy Markdown
Member

@fnando fnando commented May 5, 2026

What

Add a --ledger flag to stellar keys address that connects to an attached
Ledger hardware wallet and prints the Stellar address derived at
m/44'/148'/N'. N defaults to 0 and can be set with --hd-path N.

stellar keys address --ledger
stellar keys address --ledger --hd-path 1

The flag is scoped to keys address only. public_key::Cmd was split into
Args (still flattened by keys fund) and Cmd (used by keys address and
adds --ledger), so keys fund does not inherit the new flag. --ledger is
mutually exclusive with the positional identity name; if neither is provided,
clap rejects the command. Errors from a missing/locked device or a closed
Stellar app surface through the existing signer::ledger error chain.

Verified end-to-end against a real Ledger device.

Closes #2556.

Why

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
--ledger, users have to open Ledger Live or a web wallet just to look up
their own address, which breaks the CLI-first development experience.

Known limitations

  • --ledger is intentionally only on keys address. keys fund --ledger
    (and other commands) will be added in separate changes.
  • Nothing is persisted — there is no keys add --ledger yet, so each
    invocation re-derives from the device and --hd-path lives only on the
    current call.

Copilot AI review requested due to automatic review settings May 5, 2026 19:39
@github-project-automation github-project-automation Bot moved this to Backlog (Not Ready) in DevX May 5, 2026
Comment thread cmd/crates/soroban-test/src/lib.rs
@fnando fnando self-assigned this May 5, 2026
@fnando fnando moved this from Backlog (Not Ready) to Needs Review in DevX May 5, 2026
@fnando fnando requested review from leighmcculloch and mootz12 May 5, 2026 19:41
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds Ledger-backed address lookup to stellar keys address, refactors the shared key-address argument parsing, and updates related help text. In the Stellar CLI, it extends key-management flows so users can derive a hardware-wallet address directly from the CLI.

Changes:

  • Split keys public-key into shared Args plus a Cmd that adds --ledger for keys address.
  • Updated keys fund to reuse the shared args without exposing the new flag.
  • Refreshed help/docs and removed an unused soroban-test helper.

Review findings:

  • keys fund still accepts positional ledger / ledger:N, so Ledger support is not actually scoped to keys address.
  • The new keys address help text/docs still imply omitting NAME falls back to a default identity, but the command now errors unless NAME or --ledger is provided.
  • The new Ledger runtime path only has parser/unit coverage; it is missing soroban-test emulator/integration coverage.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.

File Description
FULL_HELP_DOCS.md Documents the new keys public-key/address Ledger option and revised usage text.
cmd/soroban-cli/src/commands/keys/public_key.rs Adds --ledger, splits shared args, and introduces parser tests for keys address.
cmd/soroban-cli/src/commands/keys/fund.rs Switches keys fund to the shared public-key args and adds a parser test rejecting --ledger.
cmd/crates/soroban-test/src/lib.rs Removes an unused TestEnv::test_address helper.

Comment thread cmd/soroban-cli/src/commands/keys/public_key.rs
Comment thread cmd/soroban-cli/src/commands/keys/public_key.rs Outdated
Comment thread FULL_HELP_DOCS.md
Comment thread cmd/soroban-cli/src/commands/keys/fund.rs
Comment thread cmd/soroban-cli/src/commands/keys/public_key.rs
@fnando fnando force-pushed the keys-address-ledger branch from 68f58a8 to 3939779 Compare May 5, 2026 21:29
@fnando fnando enabled auto-merge (squash) May 5, 2026 21:30
@fnando fnando merged commit b76dfb7 into main May 5, 2026
211 checks passed
@fnando fnando deleted the keys-address-ledger branch May 5, 2026 21:45
@github-project-automation github-project-automation Bot moved this from Needs Review to Done in DevX May 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Support for stellar keys address --ledger

3 participants