Skip to content

Add Stellar keypair generation utility #103

Description

@therealjhay

Description: The codebase generates IDs using crypto.randomUUID() but never generates Stellar keypairs. For testing and merchant onboarding, keypair generation is needed.

Requirements:

  • Create generateStellarKeypair(): { publicKey: string; secretKey: string }
  • Use @stellar/stellar-sdk Keypair utilities
  • Never log the secret key
  • Add a warning JSDoc about secret key security
  • Add unit tests verifying the generated keys are valid

Suggested execution steps:

  1. Import Keypair from @stellar/stellar-sdk
  2. Generate keypair with Keypair.random()
  3. Return { publicKey: keypair.publicKey(), secretKey: keypair.secret() }
  4. Add JSDoc warning: "The secret key must be stored securely and never logged"
  5. Add tests: verify public key passes StrKey.isValidEd25519PublicKey, secret passes StrKey.isValidEd25519SecretSeed

Example commit message:

feat(stellar-utils): add Stellar keypair generation utility

generateStellarKeypair creates random Ed25519 keypairs for testing and
merchant onboarding, with security warnings in documentation.

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions