Add SEP-53 message signing/verification to Keypair - #1513
Merged
Conversation
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
There was a problem hiding this comment.
Pull request overview
Adds SEP-53-compliant arbitrary message signing and verification to Keypair, along with test vectors and API reference documentation updates.
Changes:
- Introduces
Keypair.signMessage(message)andKeypair.verifyMessage(message, signature)plus a private_hashMessagehelper using the SEP-53 fixed prefix and single-round SHA-256. - Adds unit tests covering SEP-53 published test vectors, round-trip behavior, and failure cases.
- Updates the Keys reference docs to include the new APIs and adjusts source references.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
src/base/keypair.ts |
Adds SEP-53 message prefix constant, message-hash helper, and signMessage/verifyMessage APIs. |
test/unit/base/keypair.test.ts |
Adds SEP-53 test vectors and behavioral tests for signing and verification. |
docs/reference/core-keys.md |
Documents the new APIs and updates source links/line references. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
Keypair.signMessage(message)andKeypair.verifyMessage(message, signature)for signing and verifying arbitrary messages per SEP-53.message(a UTF-8 string orBuffer) is prefixed with the fixed"Stellar Signed Message:\n"marker, hashed once with SHA-256, and that hash is signed/verified with the keypair's ed25519 key.hash()(single-round SHA-256) andKeypair.sign/verify— via a small private_hashMessagehelper.signMessageinheritssign()'s "no secret key" throw;verifyMessageinheritsverify()'s resilientfalseon bad input. No new failure modes.