Skip to content

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

@leighmcculloch

Description

@leighmcculloch

What problem does your feature solve?

Deriving the root account's master key and address for a network currently requires using stellar-core convert-id with some shell pipeline glue. For example, in quickstart:

NETWORK_ID=$(printf "$NETWORK_PASSPHRASE" | sha256sum | cut -f 1 -d " ")
network_id_keys=$(stellar-core convert-id $NETWORK_ID | awk -F': ' '/strKey: /{print $2}' | tail -2)
NETWORK_ROOT_SECRET_KEY=$(printf "$network_id_keys" | head -1)
NETWORK_ROOT_ACCOUNT_ID=$(printf "$network_id_keys" | tail -1)

This requires stellar-core to be available and involves brittle parsing of its output. The same logic would be useful in ops tooling for network setup.

What would you like to see?

Add a stellar network root command with subcommands to output the root account's master key and address for a given network. For example:

stellar network root-account master-key --network testnet
# outputs: S...

stellar network root-account address --network testnet
# outputs: G...

The command would derive these from the network passphrase, the same way stellar-core convert-id does today, but without needing stellar-core installed.

What alternatives are there?

  • Continue using stellar-core convert-id with shell parsing, as quickstart does today. This requires stellar-core to be available and is fragile.
  • Implement the derivation in a standalone script using the JS SDK's Keypair.master(Networks.TESTNET) equivalent. This works but adds a dependency on the JS SDK instead of keeping it in the CLI.

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

Status
Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions