Skip to content

add entries for BIP-340: public/private key and varsig#398

Merged
vmx merged 1 commit intomultiformats:masterfrom
MichaelMure:bip340
Apr 16, 2026
Merged

add entries for BIP-340: public/private key and varsig#398
vmx merged 1 commit intomultiformats:masterfrom
MichaelMure:bip340

Conversation

@MichaelMure
Copy link
Copy Markdown
Contributor

While bip340 operates on secp256k1, it makes sense to have separate values:

  • public keys have a different format: 32-byte x-only (bip340) vs 33-byte prefix+x (secp256k1)
  • private keys have the same format but different usage expectation
  • algorithm are different: schnorr (bip340) vs ECDSA (secp256k1)
  • signatures have a different format: 64-byte [R.x, s] (bip340) vs 64-byte [r, s] (secp256k1)

That is, they can't reasonable mix or interoperate.

I tried to pick values that makes sense, let me know if I should change them.

While bip340 operates on secp256k1, it makes sense to have separate values:
- public keys have a different format: 32-byte x-only (bip340) vs 33-byte prefix+x (secp256k1)
- private keys have the same format but different usage expectation
- algorithm are different: schnorr (bip340) vs ECDSA (secp256k1)
- signatures have a different format: 64-byte [R.x, s] (bip340) vs 64-byte [r, s] (secp256k1)

That is, they can't reasonable mix or interoperate.
Copy link
Copy Markdown
Member

@vmx vmx left a comment

Choose a reason for hiding this comment

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

I haven't had a close look. But it looks reasonable. If no one else finds the time for a review, I think it's good to go.

@vmx vmx merged commit e68ee06 into multiformats:master Apr 16, 2026
1 check passed
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.

3 participants