feat: add SEP-53 message signing and verification#2346
feat: add SEP-53 message signing and verification#2346mootz12 merged 10 commits intostellar:mainfrom
Conversation
Add support for signing and verifying arbitrary messages per SEP-53. New commands: - `stellar message sign` - Sign a message using SEP-53 specification - `stellar message verify` - Verify a SEP-53 signed message Features: - Sign messages with local keys, seed phrases, or secure store - Support for both UTF-8 text and binary (base64) input - Signature output in base64 format - Identity lookup for signing keys Implementation follows the SEP-53 specification: 1. Prepend "Stellar Signed Message:\n" prefix to message 2. SHA-256 hash the prefixed payload 3. ed25519 sign the hash Closes stellar#2345 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Remove unused `arg` import from clap - Use `if let` instead of `match` for single pattern destructuring - Add `#[allow(clippy::unused_async)]` for async fn without await (kept async for consistency with other commands) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
I think as-implemented makes the most sense with how the CLI is currently setup. Most other tools from a quick scan are consistent with the The only other reasonable alternative I can think of would be to make But this might be excess refactoring / breaking changes. |
|
To be honest, |
…r/stellar-cli into pr-2346
There was a problem hiding this comment.
Pull request overview
This PR implements SEP-53 arbitrary message signing and verification for the Stellar CLI, allowing users to sign and verify messages using Stellar keys to prove address ownership or authenticate without on-chain transactions.
Changes:
- Added new
message signandmessage verifycommands following the SEP-53 specification - Modified
Signer::get_public_key()to returnstellar_strkey::ed25519::PublicKeywrapper type instead of raw[u8; 32]for better type safety - Added comprehensive unit and integration tests using SEP-53 test vectors
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
cmd/soroban-cli/src/signer/mod.rs |
Updated get_public_key() return type and call sites to use stellar_strkey::ed25519::PublicKey wrapper |
cmd/soroban-cli/src/print.rs |
Added documentation comments to print functions |
cmd/soroban-cli/src/commands/mod.rs |
Registered new message subcommand and error type |
cmd/soroban-cli/src/commands/message/mod.rs |
Defined message command structure with SEP-53 prefix constant |
cmd/soroban-cli/src/commands/message/sign.rs |
Implemented SEP-53 message signing with stdin support and base64 encoding |
cmd/soroban-cli/src/commands/message/verify.rs |
Implemented SEP-53 signature verification with identity resolution |
cmd/crates/soroban-test/tests/it/message.rs |
Integration tests covering sign/verify with keys, stdin, and aliases |
cmd/crates/soroban-test/tests/it/main.rs |
Registered message integration tests |
Summary
Closes #2345
Add support for signing and verifying arbitrary messages per SEP-53.
New Commands
stellar message sign- Sign a message using SEP-53 specificationstellar message verify- Verify a SEP-53 signed messageFeatures
Implementation
Follows the SEP-53 specification:
"Stellar Signed Message:\n"prefix to messageLimitations
Test Plan
🤖 Generated with Claude Code