Sender signatures and transition to symmetric cryptography #5327
alexpyattaev
started this conversation in
Ideas
Replies: 3 comments 2 replies
-
Interesting idea. A few thoughts as I read through:
My overall take is this should provide a small improvement to shred pipeline bandwidth and block capacity at the cost of some extra complexity |
Beta Was this translation helpful? Give feedback.
2 replies
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Problem
Thanks to @ripatel-fd for helping brainstorm this concept.
Currently, the packets sent over plain UDP (shreds, alpenglow votes, repair etc) look something like this:
IP | UDP | SIG | PAYLOAD
However, in some cases we do not need to be using aymmetric crypto. For example, shreds, when signed by a retransmitter, look something like this instead:
IP | UDP | SIG | PAYLOAD | RTX_SIG
RTX_SIG today is 64 byte public key signature, which is both slow to check and bulky. It is only checked by the receiver of the resigned shred, and then discarded/replaced, so a symmetric key signature could be used instead.
Similar problem exists in the case of votes in both TowerBFT and Alpenglow where we need to quickly discard obviously forged packets.
Proposal
The proposal is to attach a sender signature to the packets that is produced using a symmetric key derived via ECDH from information published over gossip. Gossip provides a highly reliable authenticated channel to broadcast the updated ephemeral keys to other cluster members. From there, we follow the Noise_KK handshake to come up with a symmetric key (sk) on each of the nodes. This key is then used to compute the MAC using ChaCha20-Poly1305. See also diagram below:
We can generally avoid complex key rotation mechanisms in this case, since Solana packets have unique indices (shreds have shred ID, votes have block ID, repair has nonces) and are never repeated.
Only staked nodes require such a mechanism enabled, but due to its low cost all nodes may use it to make the cluster more resilient to attacks.
The sender signature is computed over the bytes of the entire packets as follows:
SENDER_SIG = Poly1305(SK, "UDP pseudoheader | UDP | SIG | PAYLOAD" )
For shreds:
The sender signature is to be truncated to 4 bytes and appended to the shred. We will want to reuse some of the legacy shred flags (chained probably?) to indicate that a given shred has a signature.
For Votes:
The sender signature is to be truncated to 4 bytes and appended to the Vote packet. A magic byte 0x01 should precede the signature to indicate its presence.
For Alpenglow votes:
All vote packets should include sender signatures in their format
This scheme provides 2 critical features:
Beta Was this translation helpful? Give feedback.
All reactions