Skip to content

Conversation

@elizabethengelman
Copy link
Collaborator

@elizabethengelman elizabethengelman commented Sep 30, 2025

What

Closes #2039

Why

Previously we were trying to get a signer key's private key directly to sign an invoke tx and when signing auth entries, but this doesn't work for secure store or ledger device signers since they don't expose their private key directly.

This PR updates the invoke tx signing, and signing auth entries to use a signer to sign, rather than a signing key directly so we don't need explicit access to the private key.

local source key, local auth key

stellar contract invoke --source local-key-1 --id hello-world --network local  \
-- auth  --addr  local-key-2 --world hi
  • worked before this change ✅
  • works after this change ✅

local source key, secure auth key

stellar contract invoke --source local-key-1 --id hello-world --network local  \
-- auth  --addr secure-key-1 --world hi
  • worked before this change ❌
    • ❌ error: Missing signing key for account GB765REIZB4KQEN5TYFEPN3FQQMGIZHVXE5SKDD3REULDSTJWTR5E7GL
  • works after this change ✅

secure source key, local auth key

stellar contract invoke --source secure-key-1 --id hello-world --network local  \
-- auth  --addr local-key-1 --world hi
  • worked before this change
    • ❌ error: Secure Store does not reveal secret key
  • works after this change ✅

secure source key, secure auth key

stellar contract invoke --source secure-key-1 --id hello-world --network local  \
-- auth  --addr secure-key-2 --world hi
  • worked before this change
    • ❌ error: Secure Store does not reveal secret key
  • works after this change ✅

Known limitations

This PR does not address ledger devices yet, that will be a follow up PR to avoid this one getting too large.

@github-project-automation github-project-automation bot moved this to Backlog (Not Ready) in DevX Sep 30, 2025
@elizabethengelman elizabethengelman self-assigned this Sep 30, 2025
@elizabethengelman elizabethengelman force-pushed the fix/soroban-auth-signing-updated branch from 8b92954 to a5308f6 Compare October 1, 2025 17:40
@elizabethengelman elizabethengelman force-pushed the fix/soroban-auth-signing-updated branch from cb8bd29 to 27be163 Compare October 1, 2025 21:22
@elizabethengelman elizabethengelman force-pushed the fix/soroban-auth-signing-updated branch from 86be245 to eb5ba54 Compare October 1, 2025 21:48
@elizabethengelman elizabethengelman marked this pull request as ready for review October 1, 2025 22:11
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

This PR updates Soroban authorization signing to use abstract Signer implementations (local, secure store, etc.) instead of accessing private keys directly, enabling secure store signers for both source and auth signing.

  • Switches signing of invoke transactions and auth entries to use Signer, not raw private keys.
  • Makes argument parsing/build helpers async and returns Signer instances for address arguments.
  • Adds Signer utilities for public key retrieval and payload signing, with secure store support.

Reviewed Changes

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

Show a summary per file
File Description
cmd/soroban-cli/src/signer/mod.rs Introduces async signer-based auth signing, adds get_public_key/sign_payload to Signer, and secure store integrations.
cmd/soroban-cli/src/config/mod.rs Provides a source_signer() helper and updates auth signing to use Signer and async flow.
cmd/soroban-cli/src/commands/contract/invoke.rs Awaits async arg parsing helpers.
cmd/soroban-cli/src/commands/contract/deploy/wasm.rs Awaits async constructor parameter builder.
cmd/soroban-cli/src/commands/contract/arg_parsing.rs Converts builders to async, returns Vec for auth-capable addresses, and resolves signers via secure store/local.

@elizabethengelman
Copy link
Collaborator Author

the currently failing bindings typescript test should be fixed once #2268 is merged in

@elizabethengelman elizabethengelman enabled auto-merge (squash) November 3, 2025 20:15
@elizabethengelman elizabethengelman changed the title Fix/soroban auth signing updated Fix/soroban auth signing Nov 4, 2025
@sagpatil sagpatil requested review from fnando and mootz12 November 12, 2025 20:46
Copy link
Contributor

@mootz12 mootz12 left a comment

Choose a reason for hiding this comment

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

I'm not all that familiar with keychain for storing keys, but I assume this is expected? Bombadil is my secure store key on mac.

stellar-cli % devcli keys secret bombadil                                                                             

❌ error: Secure Store does not reveal secret key

@github-project-automation github-project-automation bot moved this from Backlog (Not Ready) to Needs Review in DevX Nov 13, 2025
@elizabethengelman
Copy link
Collaborator Author

❌ error: Secure Store does not reveal secret key

@mootz12 Yep, that is correct! When we first implemented this, I think we made the decision to not expose the private key or seed phrase for Secure Store keys.

For signing txs, we're able to send the tx to the keyring crate (which manages the secure store integration) to sign it, and then returned the signed tx. So we don't necessarily need access to the private key directly.

Copy link
Contributor

@mootz12 mootz12 left a comment

Choose a reason for hiding this comment

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

LG2M with the expectation #2291 is a fast follow

@elizabethengelman elizabethengelman merged commit 0cd62ad into main Nov 18, 2025
29 of 30 checks passed
@elizabethengelman elizabethengelman deleted the fix/soroban-auth-signing-updated branch November 18, 2025 22:15
@github-project-automation github-project-automation bot moved this from Needs Review to Done in DevX Nov 18, 2025
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.

Signing Auth entries doesn't work for newer signers

3 participants