Signature format changes ahead of PQ signers: unique key identifiers and scoped signatures #2057
Replies: 2 comments
|
note, the bitmap may not be necessary if we use the actual key as "hint" (when 32 bytes). we miss on some of the extra properties stated in the linked issue, but that was written before Soroban where pre-signed transactions were the only way to do anything |
|
Thanks @MonsieurNicolas. The two problems you described, matching cost (deduplication) and scoped authorization, are both important and real. They are orthogonal and can be addressed separately. For the first issue, I would recommend using the full public key, or the H(PK) for PQ, and dropping the hint. This makes the protocol simpler: no SetOptions uniqueness or other operation-related changes. For the second problem, you suggest that it is optional, but given the recent increase in attacks (e.g. on exchanges) based on unclearly scoped authorization, I think this is going to become more important. Adopting the context bitmap as you suggested solves this issue. Combining both solutions adds up to 48 extra bytes per signature (44 bytes more than the current hint). I think this is a reasonably small cost, especially considering post-quantum signatures are likely in the KBs range. |
Uh oh!
There was an error while loading. Please reload this page.
As we add post-quantum keys as account signers, I’d like to fix how signatures are matched to signers at the same time.
Problems with today’s model
DecoratedSignaturecarries a 4-byte hint. Core tries each signature against every signer whose hint matches, for every account that needs authorization. Hints are cheap to grind, so a party controlling one account in a transaction (e.g. a sponsored account) can force extra verifications. This is tolerable with Ed25519 but not with PQ keys and signatures that are kilobytes.Goal
Each signature is
Proposal
PQ already requires a new signature format, so introduce one for all schemes
{ scheme, key identifier, scope bitmap, signature }:H(tag ‖ networkID ‖ bitmap ‖ txHash ), so a scoped signature can never be reused as a legacy unscoped one.Legacy
DecoratedSignaturestays valid for compatibility and pre-signed transactions -- but there may be ground to make them invalid at a later date.Of course there may be better ideas there, I wanted to start the discussion with something concrete.
All reactions