Embed ED25519 public key in signature blob#257
Merged
Conversation
Make ED25519 signatures self-contained by embedding the 32-byte public key directly in the signature blob (96 bytes = 32 pubkey + 64 sig). This eliminates ed_pubkey_extension and the ordering dependency between transaction extensions and signatures. Core changes: - signature_shim: 64→96 bytes, is_recoverable=true, recover() verifies embedded key and returns it - sign_sha256/sign_raw: embed pubkey at [0..31], sig at [32..95] - Remove ed_pubkey_extension, replace with transaction_extension_placeholder - Reject transaction extensions in transaction_context::init_for_input_trx - Simplify get_signature_keys: all non-BLS types use uniform recover() path - Add sig_type::ed to recover_key allowed list in WASM crypto layer - Unify private_key::generate(key_type) interface, removing template overloads
jglanz
approved these changes
Mar 16, 2026
The signature_shim was expanded to [pubkey 32B][sig 64B] but the Solana interop test still tried to parse a raw 64-byte fixture signature via from_base58_string. Construct the blob manually instead.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ed_pubkey_extensionand reject all transaction extensions at consensus layer (init_for_input_trx)get_signature_keys— all non-BLS signature types now use uniformrecover()pathsig_type::edto WASMrecover_keyallowed listprivate_key::generate(key_type)interface, replacing template overloadsContext
ED25519 signatures are non-recoverable — you can't derive the public key from
(signature, digest). Previously the system stored the public key as a separateed_pubkey_extensionintransaction.transaction_extensions[], then matched extensions to signatures by index order. This was error-prone (ordering dependency, forgotten extensions) and added client complexity.With the public key embedded at
[0..31]and the signature at[32..95],recover()extracts the key, verifies the signature against it, and returns it — identical to the K1/R1/WebAuthn flow.Companion CDT PR: Wire-Network/wire-cdt#38