Skip to content

feat(tx-manifest): encode compressed public key parameters - #52

Open
KyrylR wants to merge 1 commit into
masterfrom
feature/manifest-compressed-pubkeys
Open

KyrylR wants to merge 1 commit into
masterfrom
feature/manifest-compressed-pubkeys

Conversation

@KyrylR

@KyrylR KyrylR commented Oct 13, 2026

Copy link
Copy Markdown
Collaborator
  • This PR suggests a bug fix and I've added the necessary tests.
  • This PR introduces a new feature and I've discussed the update in an Issue or with the team.
  • This PR is just a minor change like a typo fix.

This adds the pubkey33 manifest parameter type which was necessary for audit key during DAMP implementation.
Humid already supported a 32-byte x-only public key.
A 33-byte compressed key also carries a prefix identifying the point’s parity, so it requires a different encoding.

The encoder converts compressed key text into the tuple expected by the Simplicity compiler:

  • 02 becomes (0, 0x).
  • 03 becomes (1, 0x).

It preserves the X coordinate’s byte order, accepts an optional hexadecimal prefix, and normalizes case. It rejects x-only input, unsupported prefixes, malformed hexadecimal text and incorrect lengths. It validates the encoding’s shape.
It does not validate curve membership.

@KyrylR
KyrylR requested a review from Arvolear October 13, 2026 09:27
@KyrylR KyrylR self-assigned this Oct 13, 2026

This branch has not been deployed

No deployments
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.

1 participant