Skip to content

add test vectors#121

Open
lescuer97 wants to merge 1 commit intocashubtc:masterfrom
lescuer97:deterministic_p2pk
Open

add test vectors#121
lescuer97 wants to merge 1 commit intocashubtc:masterfrom
lescuer97:deterministic_p2pk

Conversation

@lescuer97
Copy link

Adds test vectors for the deterministic test vector for the nut.

nut pr: cashubtc/nuts#331

replaces: #68

@changeset-bot
Copy link

changeset-bot bot commented Mar 20, 2026

⚠️ No Changeset found

Latest commit: 9a5d893

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9a5d893922

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +107 to +108
const publicKey = secp256k1.getPublicKey(secretKey, true);
return bytesToHex(publicKey);

Choose a reason for hiding this comment

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

P1 Badge Preserve the legacy public-key ID for restored P2PK keys

publicKeyHex is the repository key that generateNewKeyPair() stores and that signProof()/getKeyPair() later look up by exact string. Changing it from the old '02' + schnorr.getPublicKey(secretKey) form to secp256k1.getPublicKey(secretKey, true) changes the identifier for every key whose secp256k1 point has odd Y (the new tests show several 03... cases). That means a wallet restored from seed on this release will re-derive and persist a different publicKeyHex than previous releases, so previously shared or minted P2PK proofs locked to the legacy value can no longer be matched after a DB wipe/restore, breaking recovery of existing funds unless there is a migration or backward-compatible aliasing layer.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

1 participant