Skip to content

Comments

Add stellar network root-account command#2402

Open
mootz12 wants to merge 5 commits intomainfrom
issues/2389-add-root-account-command
Open

Add stellar network root-account command#2402
mootz12 wants to merge 5 commits intomainfrom
issues/2389-add-root-account-command

Conversation

@mootz12
Copy link
Contributor

@mootz12 mootz12 commented Feb 19, 2026

What

Add a command to compute the root-account key in the CLI

Examples:

  1. Outputs secret key or public key, uses default network of the CLI
% stellar network root-account public-key
GBZXN7PIRZGNMHGA7MUUUF4GWPY5AYPV6LY4UV2GL6VJGIQRXFDNMADI

% stellar network root-account secret
SC5O7VZUXDJ6JBDSZ74DSERXL7W3Y5LTOAMRF7RQRL3TAGAPS7LUVG3L
  1. Accepts --network args
% stellar network root-account public-key --network testnet 
GBRPYHIL2CI3FNQ4BXLFMNDLFJUNPU2HY3ZMFSHONUCEOASW7QC7OX2H
  1. Accepts --network-passphrase args. Prioritizes this over any configured or supplied --network. Like JS Keypair, does not fail if input is not a current passphrase.
% stellar network root-account secret --network-passphrase "Test SDF Future Network ; October 2022" 
SCR2DRVHQKDHCPRJXYHJPBLHB6UDRUJZC7GY5LVUUNLZ74O6XR75KK5K

Why

Closes: #2389

Known limitations

None

@github-project-automation github-project-automation bot moved this to Backlog (Not Ready) in DevX Feb 19, 2026
@mootz12 mootz12 marked this pull request as ready for review February 19, 2026 21:36
Copilot AI review requested due to automatic review settings February 19, 2026 21:36
Copy link
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

Adds a new stellar network root-account subcommand to derive the network root account keypair (secret by default, optional public key) directly from a network passphrase / configured network, removing the need for stellar-core convert-id pipelines.

Changes:

  • Introduces network root-account command that derives the root account seed from sha256(network_passphrase) and prints either S… (default) or G… (--public-key).
  • Wires the new subcommand into the network command module and updates generated help docs.
  • Adds integration tests covering default behavior, flag behavior, and passphrase override precedence.

Reviewed changes

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

Show a summary per file
File Description
cmd/soroban-cli/src/commands/network/root_account.rs Implements the new network root-account command and output selection logic.
cmd/soroban-cli/src/commands/network/mod.rs Registers the new RootAccount subcommand and plumbs errors/run dispatch.
cmd/crates/soroban-test/tests/it/config.rs Adds integration tests for the new command (default, flags, override, exclusivity).
FULL_HELP_DOCS.md Updates CLI help docs to include network root-account (and reflects current bindings subcommands).
Cargo.lock Updates lockfile to reflect dependency graph changes.

@leighmcculloch
Copy link
Member

% stellar network root-account --public-key
GBZXN7PIRZGNMHGA7MUUUF4GWPY5AYPV6LY4UV2GL6VJGIQRXFDNMADI

% stellar network root-account --secret
SC5O7VZUXDJ6JBDSZ74DSERXL7W3Y5LTOAMRF7RQRL3TAGAPS7LUVG3L

Could these be separate sub-commands using names that parallel the stellar keys command?

stellar network root-account secret
stellar network root-account address|public-key

@mootz12
Copy link
Contributor Author

mootz12 commented Feb 19, 2026

Could these be separate sub-commands using names that parallel the stellar keys command?

Yep. Originally changed it to reduce code duplication, but didn't consider that this matches the stellar keys API.

@leighmcculloch
Copy link
Member

leighmcculloch commented Feb 19, 2026

In general too the style / flavor of the stellar-cli's command are:

  • Actions are distinguished as subcommands
  • Inputs / params / variables to those actions are options

That's a bit fuzzy here where we could think of a single subcommand to get the account and different views of that, but generally is implemented in the stellar-cli as on the other end of the spectrum away from DRY.

We maybe should capture this in the contributing.md.

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

Labels

None yet

Projects

Status: Backlog (Not Ready)

Development

Successfully merging this pull request may close these issues.

Add stellar network root-account command to output root account master key and address

2 participants