Skip to content

Cover signing with raw secret seed#975

Open
chrisx9z wants to merge 1 commit into
stellar:masterfrom
chrisx9z:fix/raw-secret-key-docs
Open

Cover signing with raw secret seed#975
chrisx9z wants to merge 1 commit into
stellar:masterfrom
chrisx9z:fix/raw-secret-key-docs

Conversation

@chrisx9z

@chrisx9z chrisx9z commented Jun 7, 2026

Copy link
Copy Markdown

Summary

  • add regression coverage for signing with Keypair.rawSecretKey()
  • verify the resulting signature with the matching raw public key
  • clarify that rawSecretKey() returns the raw 32-byte secret seed

Fixes #281.

Verification

  • node --check src/keypair.js
  • node --check test/unit/signing_test.js
  • corepack yarn mocha test/unit/signing_test.js --require @babel/register --require ./test/test-helper.js
  • corepack yarn eslint -c ./config/.eslintrc.js src/keypair.js src/signing.js
  • git diff --check

Copilot AI review requested due to automatic review settings June 7, 2026 13:25

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds coverage for signing using a Keypair’s raw secret material and updates Keypair docs to clarify what rawSecretKey() returns.

Changes:

  • Added a unit test that signs using keypair.rawSecretKey() and verifies the signature with rawPublicKey().
  • Updated Keypair#rawSecretKey JSDoc to describe the returned bytes as a 32-byte seed.

Reviewed changes

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

File Description
test/unit/signing_test.js Adds a test for signing with a Keypair’s raw secret bytes and verifying the result.
src/keypair.js Updates docstring for rawSecretKey() return value/meaning.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/keypair.js
Comment on lines +194 to 197
* Returns the raw 32-byte secret seed.
* @returns {Buffer}
*/
rawSecretKey() {
Comment thread test/unit/signing_test.js
Comment on lines +34 to +37
it('can sign with a Keypair raw secret seed', function () {
let data = Buffer.from('hello world', 'utf8');
let keypair = StellarBase.Keypair.fromRawEd25519Seed(seed);
let actualSig = StellarBase.sign(data, keypair.rawSecretKey());
Comment: Adds a regression test for signing with Keypair.rawSecretKey and documents that it returns the raw seed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bad secret key size

2 participants