Skip to content

Sign auth entries when the signer is passed by public key - #2658

Open
fnando wants to merge 4 commits into
mainfrom
resolve-signer-by-public-key
Open

Sign auth entries when the signer is passed by public key#2658
fnando wants to merge 4 commits into
mainfrom
resolve-signer-by-public-key

Conversation

@fnando

@fnando fnando commented Jul 27, 2026

Copy link
Copy Markdown
Member

What

Passing an account by its public key (G…) where that account must sign — e.g. an Address argument that calls require_auth() — now resolves to the local identity that holds the matching key, exactly like passing the identity alias does. Previously this failed with Missing signing key for account G…, even though the key was present in the keystore.

Fixes #2459.

Why

Every signing path only resolved in one direction: an identity name or secret to an address/secret. When a raw public key was supplied, resolve_signerget_secret_key recognized it as a public key and concluded no secret was available, so the auth entry went unsigned. Passing the same account by its alias worked, so the two were inconsistent for what is the same account. This adds the reverse lookup so a public key and its alias behave identically when signing.

Implementation: a new Locator::secret_by_public_key scans stored identities and returns the secret whose public key matches (reusing each identity's ledger/secure-store-aware public-key derivation). UnresolvedMuxedAccount::resolve_secret uses it for literal G…/M… addresses, falling back to the existing CannotSign error only when no identity matches. Covered by unit tests and an integration regression test that reproduces the original failure.

Known limitations

N/A

Copilot AI review requested due to automatic review settings July 27, 2026 17:12
@github-project-automation github-project-automation Bot moved this to Backlog (Not Ready) in DevX Jul 27, 2026
@fnando fnando moved this from Backlog (Not Ready) to Needs Review in DevX Jul 27, 2026
@fnando fnando self-assigned this Jul 27, 2026

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.

Pull request overview

Adds reverse identity lookup so public-key contract arguments can locate their stored signing secrets.

Changes:

  • Adds public-key-to-secret identity lookup.
  • Resolves public-key arguments into auth signers.
  • Adds unit and integration regression tests.

Reviewed changes

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

File Description
config/locator.rs Adds reverse identity lookup and tests.
config/address.rs Resolves literal account addresses to secrets.
contract/arg_parsing.rs Creates signers from resolved addresses.
integration/auth.rs Tests signing via a public key.

Comment thread cmd/soroban-cli/src/commands/contract/arg_parsing.rs Outdated
Comment thread cmd/soroban-cli/src/config/address.rs Outdated
@fnando
fnando force-pushed the resolve-signer-by-public-key branch from a1d20fd to 822c4a2 Compare July 27, 2026 17:39
@fnando
fnando enabled auto-merge (squash) July 27, 2026 17:52
@fnando
fnando force-pushed the resolve-signer-by-public-key branch from c8d351e to 0ad0cb2 Compare July 27, 2026 20:39
@fnando
fnando force-pushed the resolve-signer-by-public-key branch from 0ad0cb2 to e602827 Compare July 28, 2026 13:45
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.

stellar contract invoke can't find a signer by its public keys

2 participants