Skip to content

secp256k1: add explicit compressed/uncompressed pubkey serialisation#39

Merged
MichaelMure merged 1 commit into
masterfrom
secp256k1-secpub
Apr 2, 2026
Merged

secp256k1: add explicit compressed/uncompressed pubkey serialisation#39
MichaelMure merged 1 commit into
masterfrom
secp256k1-secpub

Conversation

@MichaelMure

@MichaelMure MichaelMure commented Apr 2, 2026

Copy link
Copy Markdown
Collaborator

Note

Low Risk
Low risk: adds explicit serialization helpers and a small unit test without changing existing serialization behavior (ToBytes remains compressed).

Overview
Adds explicit PublicKey.CompressedBytes() and PublicKey.UncompressedBytes() helpers (SEC1 33-byte and 65-byte encodings) and documents that ToBytes() is the compressed form.

Extends tests with TestPublicKeyFromBytesEncodings to ensure PublicKeyFromBytes can round-trip both compressed and uncompressed encodings.

Written by Cursor Bugbot for commit bd0d353. This will update automatically on new commits. Configure here.

smoyer64
smoyer64 previously approved these changes Apr 2, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is the deserialize going to auto-detect the format now (or experimentally probe for valid formats?)

@MichaelMure MichaelMure merged commit cb8e31b into master Apr 2, 2026
7 checks passed
@MichaelMure MichaelMure deleted the secp256k1-secpub branch April 2, 2026 11:36
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.

2 participants