From ea0f408f1b67c9edf2895826ef3cc80914d4d97b Mon Sep 17 00:00:00 2001 From: Leigh <351529+leighmcculloch@users.noreply.github.com> Date: Wed, 17 Jun 2026 02:54:01 +0000 Subject: [PATCH 1/7] update stellar-strkey to 0.0.17 --- Cargo.lock | 37 ++++++++++++++++++---- Cargo.toml | 2 +- cmd/crates/soroban-spec-tools/src/utils.rs | 6 ++-- cmd/soroban-cli/src/utils.rs | 4 +-- 4 files changed, 36 insertions(+), 13 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0c6256ecb..ec24547d4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1870,7 +1870,7 @@ dependencies = [ "embedded-io-async", "futures-sink", "futures-util", - "heapless", + "heapless 0.8.0", ] [[package]] @@ -2455,6 +2455,17 @@ dependencies = [ "stable_deref_trait", ] +[[package]] +name = "heapless" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25ba4bd83f9415b58b4ed8dc5714c76e626a105be4646c02630ad730ad3b5aa4" +dependencies = [ + "hash32", + "stable_deref_trait", + "zeroize", +] + [[package]] name = "heck" version = "0.3.3" @@ -5442,7 +5453,7 @@ dependencies = [ "stellar-asset-spec", "stellar-ledger", "stellar-rpc-client", - "stellar-strkey 0.0.16", + "stellar-strkey 0.0.17", "stellar-xdr", "strsim", "strum 0.17.1", @@ -5654,7 +5665,7 @@ dependencies = [ "serde", "serde_json", "soroban-spec", - "stellar-strkey 0.0.16", + "stellar-strkey 0.0.17", "stellar-xdr", "thiserror 1.0.69", "tokio", @@ -5709,7 +5720,7 @@ dependencies = [ "soroban-spec-tools", "stellar-ledger", "stellar-rpc-client", - "stellar-strkey 0.0.16", + "stellar-strkey 0.0.17", "test-case", "testcontainers", "thiserror 1.0.69", @@ -5830,7 +5841,7 @@ dependencies = [ "serde_json", "serial_test", "sha2 0.10.9", - "stellar-strkey 0.0.16", + "stellar-strkey 0.0.17", "stellar-xdr", "test-case", "testcontainers", @@ -5880,14 +5891,26 @@ version = "0.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "084afcb0d458c3d5d5baa2d294b18f881e62cc258ef539d8fdf68be7dbe45520" dependencies = [ - "clap", "crate-git-revision 0.0.6", "data-encoding", - "heapless", + "heapless 0.8.0", +] + +[[package]] +name = "stellar-strkey" +version = "0.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0247b168bdee20244445e3d9cdea697dde6211e88742dd04acfd1b498661e936" +dependencies = [ + "clap", + "crate-git-revision 0.0.9", + "data-encoding", + "heapless 0.9.3", "serde", "serde_json", "serde_with", "thiserror 1.0.69", + "zeroize", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 77ed26e8e..d684f7ab4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -75,7 +75,7 @@ version = "26.0.0" # Dependencies from elsewhere shared by crates: [workspace.dependencies] -stellar-strkey = "0.0.16" +stellar-strkey = "0.0.17" sep5 = "0.1.0" base64 = "0.21.2" thiserror = "1.0.46" diff --git a/cmd/crates/soroban-spec-tools/src/utils.rs b/cmd/crates/soroban-spec-tools/src/utils.rs index f030cc0f8..744063f7d 100644 --- a/cmd/crates/soroban-spec-tools/src/utils.rs +++ b/cmd/crates/soroban-spec-tools/src/utils.rs @@ -22,9 +22,9 @@ pub fn contract_id_from_str(contract_id: &str) -> Result<[u8; 32], stellar_strke .or_else(|_| { // strkey failed, try to parse it as a hex string, for backwards compatibility. padded_hex_from_str(contract_id, 32) - .map_err(|_| stellar_strkey::DecodeError::Invalid)? + .map_err(|_| stellar_strkey::DecodeError::InvalidPayloadLength)? .try_into() - .map_err(|_| stellar_strkey::DecodeError::Invalid) + .map_err(|_| stellar_strkey::DecodeError::InvalidPayloadLength) }) - .map_err(|_| stellar_strkey::DecodeError::Invalid) + .map_err(|_| stellar_strkey::DecodeError::InvalidPayloadLength) } diff --git a/cmd/soroban-cli/src/utils.rs b/cmd/soroban-cli/src/utils.rs index df1f54f45..7be7fc51e 100644 --- a/cmd/soroban-cli/src/utils.rs +++ b/cmd/soroban-cli/src/utils.rs @@ -109,9 +109,9 @@ pub fn contract_id_from_str( // strkey failed, try to parse it as a hex string, for backwards compatibility. stellar_strkey::Contract( soroban_spec_tools::utils::padded_hex_from_str(contract_id, 32) - .map_err(|_| stellar_strkey::DecodeError::Invalid)? + .map_err(|_| stellar_strkey::DecodeError::InvalidPayloadLength)? .try_into() - .map_err(|_| stellar_strkey::DecodeError::Invalid)?, + .map_err(|_| stellar_strkey::DecodeError::InvalidPayloadLength)?, ) }, ) From ce09d34a16971b65f9ac29cfaff696c9478fc487 Mon Sep 17 00:00:00 2001 From: Leigh <351529+leighmcculloch@users.noreply.github.com> Date: Wed, 17 Jun 2026 05:32:22 +0000 Subject: [PATCH 2/7] adapt cli to strkey 0.0.17 private key api --- cmd/crates/soroban-test/src/lib.rs | 1 + cmd/soroban-cli/src/commands/keys/secret.rs | 2 +- .../src/commands/network/root_account/secret.rs | 2 +- cmd/soroban-cli/src/config/key.rs | 2 +- cmd/soroban-cli/src/config/secret.rs | 8 ++++---- 5 files changed, 8 insertions(+), 7 deletions(-) diff --git a/cmd/crates/soroban-test/src/lib.rs b/cmd/crates/soroban-test/src/lib.rs index 55921de18..4c6a8c762 100644 --- a/cmd/crates/soroban-test/src/lib.rs +++ b/cmd/crates/soroban-test/src/lib.rs @@ -297,6 +297,7 @@ impl TestEnv { self.cmd::(&format!("--hd-path={hd_path}")) .private_key() .unwrap() + .as_unredacted() ) } diff --git a/cmd/soroban-cli/src/commands/keys/secret.rs b/cmd/soroban-cli/src/commands/keys/secret.rs index 9fc00279c..b2a97395f 100644 --- a/cmd/soroban-cli/src/commands/keys/secret.rs +++ b/cmd/soroban-cli/src/commands/keys/secret.rs @@ -40,7 +40,7 @@ impl Cmd { if self.phrase { println!("{}", self.seed_phrase()?); } else { - println!("{}", self.private_key()?); + println!("{}", self.private_key()?.as_unredacted()); } Ok(()) diff --git a/cmd/soroban-cli/src/commands/network/root_account/secret.rs b/cmd/soroban-cli/src/commands/network/root_account/secret.rs index a99ab8d45..36cb7800d 100644 --- a/cmd/soroban-cli/src/commands/network/root_account/secret.rs +++ b/cmd/soroban-cli/src/commands/network/root_account/secret.rs @@ -13,7 +13,7 @@ impl Cmd { pub fn run(&self) -> Result<(), Error> { let root_key = self.args.root_key()?; let private_key = PrivateKey::from_payload(&root_key)?; - println!("{private_key}"); + println!("{}", private_key.as_unredacted()); Ok(()) } } diff --git a/cmd/soroban-cli/src/config/key.rs b/cmd/soroban-cli/src/config/key.rs index 6180e2ed5..371f57544 100644 --- a/cmd/soroban-cli/src/config/key.rs +++ b/cmd/soroban-cli/src/config/key.rs @@ -177,7 +177,7 @@ mod test { } #[test] fn secret_key() { - let secret_key = format!("{}", stellar_strkey::ed25519::PrivateKey([0; 32])); + let secret_key = format!("{}", stellar_strkey::ed25519::PrivateKey([0; 32]).as_unredacted()); let secret = Secret::SecretKey { secret_key }; let key = Key::Secret(secret); round_trip(&key); diff --git a/cmd/soroban-cli/src/config/secret.rs b/cmd/soroban-cli/src/config/secret.rs index 754097dd6..93630d545 100644 --- a/cmd/soroban-cli/src/config/secret.rs +++ b/cmd/soroban-cli/src/config/secret.rs @@ -130,7 +130,7 @@ impl FromStr for Secret { impl From for Secret { fn from(value: PrivateKey) -> Self { Secret::SecretKey { - secret_key: format!("{value}"), + secret_key: format!("{}", value.as_unredacted()), } } } @@ -285,7 +285,7 @@ mod tests { assert!(matches!(secret, Secret::SecretKey { .. })); assert_eq!(public_key.to_string(), TEST_PUBLIC_KEY); - assert_eq!(private_key.to_string(), TEST_SECRET_KEY); + assert_eq!(private_key.as_unredacted().to_string(), TEST_SECRET_KEY); } #[test] @@ -296,7 +296,7 @@ mod tests { assert!(matches!(secret, Secret::SeedPhrase { .. })); assert_eq!(public_key.to_string(), TEST_PUBLIC_KEY); - assert_eq!(private_key.to_string(), TEST_SECRET_KEY); + assert_eq!(private_key.as_unredacted().to_string(), TEST_SECRET_KEY); } #[test] @@ -463,7 +463,7 @@ mod tests { let pk = secret.public_key(Some(0)).unwrap(); let sk = secret.private_key(Some(0)).unwrap(); assert_eq!(pk.to_string(), TEST_PUBLIC_KEY); - assert_eq!(sk.to_string(), TEST_SECRET_KEY); + assert_eq!(sk.as_unredacted().to_string(), TEST_SECRET_KEY); } #[test] From 697f4e9a980e3a783d6801524c9883ba98b9bef7 Mon Sep 17 00:00:00 2001 From: Leigh <351529+leighmcculloch@users.noreply.github.com> Date: Wed, 17 Jun 2026 05:41:12 +0000 Subject: [PATCH 3/7] format private key rendering changes --- cmd/soroban-cli/src/config/key.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cmd/soroban-cli/src/config/key.rs b/cmd/soroban-cli/src/config/key.rs index 371f57544..5f281f3ed 100644 --- a/cmd/soroban-cli/src/config/key.rs +++ b/cmd/soroban-cli/src/config/key.rs @@ -177,7 +177,10 @@ mod test { } #[test] fn secret_key() { - let secret_key = format!("{}", stellar_strkey::ed25519::PrivateKey([0; 32]).as_unredacted()); + let secret_key = format!( + "{}", + stellar_strkey::ed25519::PrivateKey([0; 32]).as_unredacted() + ); let secret = Secret::SecretKey { secret_key }; let key = Key::Secret(secret); round_trip(&key); From 218fdf0ac97b385e041dd8c41bd86f174f6d8bc9 Mon Sep 17 00:00:00 2001 From: Leigh <351529+leighmcculloch@users.noreply.github.com> Date: Wed, 17 Jun 2026 06:11:06 +0000 Subject: [PATCH 4/7] update strkey cli tests for 0.0.17 stdin interface Co-Authored-By: Claude Opus 4.8 Claude-Session: https://claude.ai/code/session_01XiSfu2MM5xbdGjxj7oXys8 --- cmd/crates/soroban-test/tests/it/strkey.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/cmd/crates/soroban-test/tests/it/strkey.rs b/cmd/crates/soroban-test/tests/it/strkey.rs index 77e594848..785fe803c 100644 --- a/cmd/crates/soroban-test/tests/it/strkey.rs +++ b/cmd/crates/soroban-test/tests/it/strkey.rs @@ -5,10 +5,8 @@ fn decode() { let sandbox = TestEnv::default(); sandbox .new_assert_cmd("strkey") - .args([ - "decode", - "GAZTAML6YJA5PGKDXONKPSHKL6FYT6OG5I2R7YB7R3B5CETRG7KIJONK", - ]) + .args(["decode"]) + .write_stdin("GAZTAML6YJA5PGKDXONKPSHKL6FYT6OG5I2R7YB7R3B5CETRG7KIJONK") .assert() .success() .stdout( @@ -24,7 +22,8 @@ fn encode() { let sandbox = TestEnv::default(); sandbox .new_assert_cmd("strkey") - .args(["encode", r#"{"public_key_ed25519":"3330317ec241d79943bb9aa7c8ea5f8b89f9c6ea351fe03f8ec3d1127137d484"}"#]) + .args(["encode"]) + .write_stdin(r#"{"public_key_ed25519":"3330317ec241d79943bb9aa7c8ea5f8b89f9c6ea351fe03f8ec3d1127137d484"}"#) .assert() .success() .stdout("GAZTAML6YJA5PGKDXONKPSHKL6FYT6OG5I2R7YB7R3B5CETRG7KIJONK\n"); From 787292129e21a2224661d06f492651240952f7ca Mon Sep 17 00:00:00 2001 From: Leigh <351529+leighmcculloch@users.noreply.github.com> Date: Wed, 17 Jun 2026 14:49:35 +0000 Subject: [PATCH 5/7] update stellar-strkey to 0.0.18 0.0.18 includes the strkey CLI fix (accept owned variant keys for Decoded). It is not yet on crates.io, so temporarily patch stellar-strkey to the release/v0.0.18 branch to validate ahead of the release. Remove the patch once 0.0.18 is published. --- Cargo.lock | 15 +++++++-------- Cargo.toml | 8 +++++++- deny.toml | 5 ++++- 3 files changed, 18 insertions(+), 10 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ec24547d4..69f20a3a4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5029,7 +5029,7 @@ checksum = "35a5a225b0cc092f0c818c7e51faf9d63d07da8c3157d6250096ca4b8708cfe3" dependencies = [ "ed25519-dalek", "ows-signer", - "stellar-strkey 0.0.16", + "stellar-strkey 0.0.18", "thiserror 2.0.18", "tiny-bip39", ] @@ -5453,7 +5453,7 @@ dependencies = [ "stellar-asset-spec", "stellar-ledger", "stellar-rpc-client", - "stellar-strkey 0.0.17", + "stellar-strkey 0.0.18", "stellar-xdr", "strsim", "strum 0.17.1", @@ -5665,7 +5665,7 @@ dependencies = [ "serde", "serde_json", "soroban-spec", - "stellar-strkey 0.0.17", + "stellar-strkey 0.0.18", "stellar-xdr", "thiserror 1.0.69", "tokio", @@ -5720,7 +5720,7 @@ dependencies = [ "soroban-spec-tools", "stellar-ledger", "stellar-rpc-client", - "stellar-strkey 0.0.17", + "stellar-strkey 0.0.18", "test-case", "testcontainers", "thiserror 1.0.69", @@ -5841,7 +5841,7 @@ dependencies = [ "serde_json", "serial_test", "sha2 0.10.9", - "stellar-strkey 0.0.17", + "stellar-strkey 0.0.18", "stellar-xdr", "test-case", "testcontainers", @@ -5898,9 +5898,8 @@ dependencies = [ [[package]] name = "stellar-strkey" -version = "0.0.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0247b168bdee20244445e3d9cdea697dde6211e88742dd04acfd1b498661e936" +version = "0.0.18" +source = "git+https://github.com/stellar/rs-stellar-strkey?rev=73bf43778a4acad5e7b3589f54a5ec3607c4b7b1#73bf43778a4acad5e7b3589f54a5ec3607c4b7b1" dependencies = [ "clap", "crate-git-revision 0.0.9", diff --git a/Cargo.toml b/Cargo.toml index d684f7ab4..788abe7cf 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -75,7 +75,7 @@ version = "26.0.0" # Dependencies from elsewhere shared by crates: [workspace.dependencies] -stellar-strkey = "0.0.17" +stellar-strkey = "0.0.18" sep5 = "0.1.0" base64 = "0.21.2" thiserror = "1.0.46" @@ -137,3 +137,9 @@ lto = true [profile.release-with-panic-unwind] inherits = "release" panic = "unwind" + +# Temporary: stellar-strkey 0.0.18 is not yet published to crates.io. Point at +# the release/v0.0.18 branch so this PR can be validated against the actual +# 0.0.18 code ahead of the release. Remove once 0.0.18 is published. +[patch.crates-io] +stellar-strkey = { git = "https://github.com/stellar/rs-stellar-strkey", rev = "73bf43778a4acad5e7b3589f54a5ec3607c4b7b1" } diff --git a/deny.toml b/deny.toml index dd05ae3b5..998f4b2ca 100644 --- a/deny.toml +++ b/deny.toml @@ -231,7 +231,10 @@ allow-registry = ["https://github.com/rust-lang/crates.io-index"] # List of URLs for allowed Git repositories allow-git = [ # Only used by the unpublished doc-gen crate, temporarily until PR is merged: https://github.com/ConnorGray/clap-markdown/pull/48 - "https://github.com/ConnorGray/clap-markdown?rev=42956b342cef3325d9060fc43995d595e7c8aa66" + "https://github.com/ConnorGray/clap-markdown?rev=42956b342cef3325d9060fc43995d595e7c8aa66", + # Temporary: stellar-strkey 0.0.18 is not yet published to crates.io; pinned to + # the release/v0.0.18 branch until the release. Remove once 0.0.18 is published. + "https://github.com/stellar/rs-stellar-strkey?rev=73bf43778a4acad5e7b3589f54a5ec3607c4b7b1" ] [sources.allow-org] From 8575cc65afba863ec16923dfdab05bb91e787d23 Mon Sep 17 00:00:00 2001 From: Leigh <351529+leighmcculloch@users.noreply.github.com> Date: Thu, 18 Jun 2026 03:22:06 +0000 Subject: [PATCH 6/7] depend on published stellar-strkey 0.0.18 0.0.18 is now published to crates.io, so drop the temporary [patch.crates-io] that pointed stellar-strkey at the release/v0.0.18 git branch (and the matching stellar-cli deny.toml allow-git entry). The dependency now resolves from crates.io. --- Cargo.lock | 13 +++++++------ Cargo.toml | 6 ------ deny.toml | 5 +---- 3 files changed, 8 insertions(+), 16 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 69f20a3a4..40ab5a234 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1989,7 +1989,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "778e2ac28f6c47af28e4907f13ffd1e1ddbd400980a9abd7c8df189bf578a5ad" dependencies = [ "libc", - "windows-sys 0.60.2", + "windows-sys 0.52.0", ] [[package]] @@ -4347,7 +4347,7 @@ dependencies = [ "once_cell", "socket2 0.6.0", "tracing", - "windows-sys 0.60.2", + "windows-sys 0.52.0", ] [[package]] @@ -4721,7 +4721,7 @@ dependencies = [ "errno", "libc", "linux-raw-sys 0.9.4", - "windows-sys 0.60.2", + "windows-sys 0.52.0", ] [[package]] @@ -5029,7 +5029,7 @@ checksum = "35a5a225b0cc092f0c818c7e51faf9d63d07da8c3157d6250096ca4b8708cfe3" dependencies = [ "ed25519-dalek", "ows-signer", - "stellar-strkey 0.0.18", + "stellar-strkey 0.0.16", "thiserror 2.0.18", "tiny-bip39", ] @@ -5899,7 +5899,8 @@ dependencies = [ [[package]] name = "stellar-strkey" version = "0.0.18" -source = "git+https://github.com/stellar/rs-stellar-strkey?rev=73bf43778a4acad5e7b3589f54a5ec3607c4b7b1#73bf43778a4acad5e7b3589f54a5ec3607c4b7b1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f34ff61c0ca6f1c2b4169e8d1633417bd9225f58b6175e4e317204565d16277" dependencies = [ "clap", "crate-git-revision 0.0.9", @@ -6124,7 +6125,7 @@ dependencies = [ "getrandom 0.3.3", "once_cell", "rustix 1.0.8", - "windows-sys 0.60.2", + "windows-sys 0.52.0", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 788abe7cf..107cdb6b6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -137,9 +137,3 @@ lto = true [profile.release-with-panic-unwind] inherits = "release" panic = "unwind" - -# Temporary: stellar-strkey 0.0.18 is not yet published to crates.io. Point at -# the release/v0.0.18 branch so this PR can be validated against the actual -# 0.0.18 code ahead of the release. Remove once 0.0.18 is published. -[patch.crates-io] -stellar-strkey = { git = "https://github.com/stellar/rs-stellar-strkey", rev = "73bf43778a4acad5e7b3589f54a5ec3607c4b7b1" } diff --git a/deny.toml b/deny.toml index 998f4b2ca..dd05ae3b5 100644 --- a/deny.toml +++ b/deny.toml @@ -231,10 +231,7 @@ allow-registry = ["https://github.com/rust-lang/crates.io-index"] # List of URLs for allowed Git repositories allow-git = [ # Only used by the unpublished doc-gen crate, temporarily until PR is merged: https://github.com/ConnorGray/clap-markdown/pull/48 - "https://github.com/ConnorGray/clap-markdown?rev=42956b342cef3325d9060fc43995d595e7c8aa66", - # Temporary: stellar-strkey 0.0.18 is not yet published to crates.io; pinned to - # the release/v0.0.18 branch until the release. Remove once 0.0.18 is published. - "https://github.com/stellar/rs-stellar-strkey?rev=73bf43778a4acad5e7b3589f54a5ec3607c4b7b1" + "https://github.com/ConnorGray/clap-markdown?rev=42956b342cef3325d9060fc43995d595e7c8aa66" ] [sources.allow-org] From 1226ca006d3b5498a2efd2818fcec00f8951210b Mon Sep 17 00:00:00 2001 From: Leigh <351529+leighmcculloch@users.noreply.github.com> Date: Thu, 18 Jun 2026 04:22:29 +0000 Subject: [PATCH 7/7] regenerate strkey help docs for stdin input stellar-strkey 0.0.18's embedded encode/decode commands read their input from stdin instead of a positional argument, so the generated FULL_HELP_DOCS.md entries for `stellar strkey decode/encode` were stale. Regenerated the strkey section to match (stdin input, new --quiet option). --- FULL_HELP_DOCS.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/FULL_HELP_DOCS.md b/FULL_HELP_DOCS.md index fb58fc4f8..3cb670b30 100644 --- a/FULL_HELP_DOCS.md +++ b/FULL_HELP_DOCS.md @@ -4396,7 +4396,7 @@ Print version information Decode and encode strkey -**Usage:** `stellar strkey ` +**Usage:** `stellar strkey [OPTIONS] ` ###### **Subcommands:** @@ -4405,25 +4405,25 @@ Decode and encode strkey - `zero` — Generate the zero strkey - `version` — Print version information +###### **Options:** + +- `-q`, `--quiet` — Suppress stderr log and warning output + ## `stellar strkey decode` Decode strkey -**Usage:** `stellar strkey decode ` +Reads the strkey from stdin. -###### **Arguments:** - -- `` — Strkey to decode +**Usage:** `stellar strkey decode` ## `stellar strkey encode` Encode strkey -**Usage:** `stellar strkey encode ` - -###### **Arguments:** +Reads the JSON from stdin. -- `` — JSON for Strkey to encode +**Usage:** `stellar strkey encode` ## `stellar strkey zero`