Skip to content

Support muxed contract (W) addresses in the CLI. - #2873

Open
fnando wants to merge 1 commit into
mainfrom
muxed-contract-w-address
Open

fnando wants to merge 1 commit into
mainfrom
muxed-contract-w-address

Conversation

@fnando

@fnando fnando commented Oct 30, 2026 •

Copy link
Copy Markdown
Member

What

Completes CLI handling for Protocol 30 (CAP-84) muxed contract W… addresses. In the auth signer, contract and muxed-contract addresses now return the dedicated ContractAddressAreNotSupported error, and muxed accounts return MissingSignerForAddress instead of hitting a todo!() panic. The signing-prompt formatter renders W… strkeys instead of raw debug XDR, and the MuxedAddress argument help plus the unsupported-address error now mention the W… form. Adds tests for the W… strkey round-trip, the signer rejection paths, and the formatter.

$ ./test-muxed-contract.sh
+ export STELLAR_CONFIG_HOME=/tmp/30219
+ STELLAR_CONFIG_HOME=/tmp/30219
+ /Users/fnando/Projects/stellar/stellar-cli/target/debug/stellar keys generate alice --network local --fund
✅ Key saved with alias alice in "/tmp/30219/identity/alice.toml"
✅ Account alice funded on "Standalone Network ; February 2017"
++ /Users/fnando/Projects/stellar/stellar-cli/target/debug/stellar keys address alice
+ alice=GCKHAVPX5QIIE4EUHUZFHCRSTCI7HGM3S2PR2JAT57N5Y7RF3OTRMOT3
+ /Users/fnando/Projects/stellar/stellar-cli/target/debug/stellar contract deploy --wasm /Users/fnando/Projects/stellar/stellar-cli/target/wasm32v1-none/test-wasms/test_token.wasm --source alice --network local --alias test_token
ℹ️ Uploading contract WASM…
ℹ️ Skipping install because wasm already installed
ℹ️ Deploying contract using wasm hash 5ba82b62c64c843fe6d4482f1936a71a1d4c899f889e05927f0f545813a7b124
ℹ️ Simulating transaction…
ℹ️ Signing transaction: 948a46e94ced6d728202bd8e837a18e2d8b5035d0ebaf88cba4c4d15f7ed3318
🌎 Sending transaction…
✅ Transaction submitted successfully!
✅ Deployed!
CCJQEGBJC3MQWAI5K2CSJ43PZ6A75LMB2LNZYLEQISVEDKRJOAYRSFL5
++ /Users/fnando/Projects/stellar/stellar-cli/target/debug/stellar contract alias show native --quiet
+ tid=CDLZFC3SYJYDZT7K67VZ75HPJVIEUVNIXF47ZG2FB2RMQQVU2HHGCYSC
+ /Users/fnando/Projects/stellar/stellar-cli/target/debug/stellar contract invoke --id test_token --source alice --network local -- initialize --admin GCKHAVPX5QIIE4EUHUZFHCRSTCI7HGM3S2PR2JAT57N5Y7RF3OTRMOT3 --decimal 7 --name Tok --symbol TOK
ℹ️ Simulating transaction…
ℹ️ Signing transaction: c8fa0b931c05e69c952f77388a7b1fdb6db5e0cbc2a3928f45899998ff5d2265
🌎 Sending transaction…
✅ Transaction submitted successfully!

+ /Users/fnando/Projects/stellar/stellar-cli/target/debug/stellar contract invoke --id test_token --source alice --network local -- mint --to GCKHAVPX5QIIE4EUHUZFHCRSTCI7HGM3S2PR2JAT57N5Y7RF3OTRMOT3 --amount 1000
ℹ️ Simulating transaction…
ℹ️ Signing transaction: 1083bb10d9743e0b30fc560e8b52cce3d1f0b275f869821249bd99407cf56d26
🌎 Sending transaction…
✅ Transaction submitted successfully!
📅 CCJQEGBJC3MQWAI5K2CSJ43PZ6A75LMB2LNZYLEQISVEDKRJOAYRSFL5 - Success - Event: Mint (mint), to: "GCKHAVPX5QIIE4EUHUZFHCRSTCI7HGM3S2PR2JAT57N5Y7RF3OTRMOT3", to_muxed_id: null, amount: "1000"

++ /Users/fnando/Projects/stellar/stellar-cli/target/debug/stellar strkey decode CDLZFC3SYJYDZT7K67VZ75HPJVIEUVNIXF47ZG2FB2RMQQVU2HHGCYSC
++ jq -r .contract
+ hex=d7928b72c2703ccfeaf7eb9ff4ef4d504a55a8b979fc9b450ea2c842b4d1ce61
++ printf '{"muxed_contract":{"contract_id":"%s","id":99}}' d7928b72c2703ccfeaf7eb9ff4ef4d504a55a8b979fc9b450ea2c842b4d1ce61
++ /Users/fnando/Projects/stellar/stellar-cli/target/debug/stellar strkey encode
+ w=WDLZFC3SYJYDZT7K67VZ75HPJVIEUVNIXF47ZG2FB2RMQQVU2HHGCAAAAAAAAAAAMPSWG
+ /Users/fnando/Projects/stellar/stellar-cli/target/debug/stellar contract invoke --id test_token --source alice --network local -- transfer --from GCKHAVPX5QIIE4EUHUZFHCRSTCI7HGM3S2PR2JAT57N5Y7RF3OTRMOT3 --to WDLZFC3SYJYDZT7K67VZ75HPJVIEUVNIXF47ZG2FB2RMQQVU2HHGCAAAAAAAAAAAMPSWG --amount 10
ℹ️ Simulating transaction…
ℹ️ Signing transaction: e55e9701f47b187cd8d7bccec5db4d9659819a4d24a8e8399aef5fcac557dc95
🌎 Sending transaction…
✅ Transaction submitted successfully!
📅 CCJQEGBJC3MQWAI5K2CSJ43PZ6A75LMB2LNZYLEQISVEDKRJOAYRSFL5 - Success - Event: Transfer (transfer), from: "GCKHAVPX5QIIE4EUHUZFHCRSTCI7HGM3S2PR2JAT57N5Y7RF3OTRMOT3", to: "CDLZFC3SYJYDZT7K67VZ75HPJVIEUVNIXF47ZG2FB2RMQQVU2HHGCYSC", to_muxed_id: 99, amount: "10"

++ /Users/fnando/Projects/stellar/stellar-cli/target/debug/stellar strkey decode GCKHAVPX5QIIE4EUHUZFHCRSTCI7HGM3S2PR2JAT57N5Y7RF3OTRMOT3
++ jq -r .public_key_ed25519
+ pk=947055f7ec108270943d32538a329891f3999b969f1d2413efdbdc7e25dba716
++ printf '{"muxed_account_ed25519":{"ed25519":"%s","id":7}}' 947055f7ec108270943d32538a329891f3999b969f1d2413efdbdc7e25dba716
++ /Users/fnando/Projects/stellar/stellar-cli/target/debug/stellar strkey encode
+ m=MCKHAVPX5QIIE4EUHUZFHCRSTCI7HGM3S2PR2JAT57N5Y7RF3OTRMAAAAAAAAAAAA5AH4
+ /Users/fnando/Projects/stellar/stellar-cli/target/debug/stellar contract invoke --id test_token --source alice --network local -- transfer --from GCKHAVPX5QIIE4EUHUZFHCRSTCI7HGM3S2PR2JAT57N5Y7RF3OTRMOT3 --to MCKHAVPX5QIIE4EUHUZFHCRSTCI7HGM3S2PR2JAT57N5Y7RF3OTRMAAAAAAAAAAAA5AH4 --amount 5
ℹ️ Simulating transaction…
ℹ️ Signing transaction: 86841517e40e595d1a4f4e5817287240eb85e31da59a1a99f7b77aa9df9178c4
🌎 Sending transaction…
✅ Transaction submitted successfully!
📅 CCJQEGBJC3MQWAI5K2CSJ43PZ6A75LMB2LNZYLEQISVEDKRJOAYRSFL5 - Success - Event: Transfer (transfer), from: "GCKHAVPX5QIIE4EUHUZFHCRSTCI7HGM3S2PR2JAT57N5Y7RF3OTRMOT3", to: "GCKHAVPX5QIIE4EUHUZFHCRSTCI7HGM3S2PR2JAT57N5Y7RF3OTRMOT3", to_muxed_id: 7, amount: "5"

+ rm -rf /tmp/30219

Why

Protocol 30 introduces muxed contract (W…) addresses. The CLI already parsed and encoded them, but the surrounding surfaces were incomplete: signing an auth entry whose credential was a muxed account panicked, muxed contracts produced a generic missing-signer error, the signing prompt printed raw XDR for W…, and the help/error text never mentioned W…. This makes the behavior correct and consistent, and removes a panic.

Known limitations

Signing with a muxed address is still unsupported — both M… (muxed account) and W… (muxed contract) are rejected, now gracefully rather than panicking. Only the MuxedAddress descriptor advertises W…, mirroring how M… is handled (the plain Address descriptor lists neither).

@github-project-automation github-project-automation Bot moved this to Backlog (Not Ready) in DevX Oct 30, 2026
@fnando fnando moved this from Backlog (Not Ready) to Needs Review in DevX Oct 30, 2026
@fnando
fnando force-pushed the muxed-contract-w-address branch from a025b72 to fc2bebc Compare October 30, 2026 23:22
@fnando
fnando requested a lite review from Copilot October 31, 2026 00:09
@fnando fnando self-assigned this Oct 31, 2026
@fnando
fnando requested review from a team and leighmcculloch October 31, 2026 00:09

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

An active nit remains because related MuxedAddress error descriptions still omit the newly supported W... format, leaving user-facing guidance inconsistent.

1 open issue
What changed in this PR

This pull request completes CLI handling for Protocol 30 muxed contract (W…) addresses by improving authorization errors, signing-prompt formatting, argument guidance, and address serialization tests.

Changes:

  • Rejects muxed account and contract authorization entries with explicit errors instead of panicking or returning generic errors.
  • Renders muxed contract addresses as W… strkeys in signing prompts.
  • Updates muxed-address documentation and adds W… parsing and round-trip coverage.
File Description
cmd/​soroban-cli/​src/​signer/​mod.rs Adds explicit rejection paths and tests for muxed account and contract authorization addresses.
cmd/​soroban-cli/​src/​log/​auth.rs Formats authorization addresses as strkeys and tests muxed contract rendering.
cmd/​soroban-cli/​src/​commands/​contract/​arg_parsing.rs Updates unsupported-address guidance for muxed contract formats.
cmd/​crates/​soroban-spec-tools/​src/​lib.rs Documents muxed contract support and tests W… parsing and serialization.

Review effort: Lite

actual: usize,
},
#[error("Unsupported address type '{address}'\n\nSupported formats:\n- Account addresses: G... (starts with G)\n- Contract addresses: C... (starts with C)\n- Muxed accounts: M... (starts with M)\n- Identity names: alice, bob, etc.\n\nReceived: '{address}'")]
#[error("Unsupported address type '{address}'\n\nSupported formats:\n- Account addresses: G... (starts with G)\n- Contract addresses: C... (starts with C)\n- Muxed accounts: M... (starts with M)\n- Muxed contracts: W... (starts with W)\n- Identity names: alice, bob, etc.\n\nReceived: '{address}'")]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Needs Review

Development

Successfully merging this pull request may close these issues.

2 participants