Replies: 1 comment 2 replies
-
While That said, I am not opposed to supporting external crypto primitives as key pairs. Obviously, rust-libp2p can not implement all curves out there directly, thus an abstraction like a Note other projects like Substrate decouple network keys from chain keys, going with the libp2p spec'ed keys on the network. |
Beta Was this translation helpful? Give feedback.
-
I'm not too deep into the lib. But one thing that I've seen (and that I would love to be different) is the fact that the library imposes the crypto primitives that you can use (in the actual repo status RSA, Ed25519 and Sepck251 IIRC).
It would be really nice to move the
KeyPair
struct towards being a trait (most of the impls are indeed implementing kinda off the same methods).That would basically enable more projects and users to use libp2p2 as their core networking library. Since if they work with different curves or primitives, it's messy to force the stack to have different sets of keys (which come from different curves) ones for the networking stack and others for the protocol stack.
In our case at Dusk for example, we use Jubjub curve, which is a twisted edwards curve as ed25519. But there's no actual way (at least that it's not super hacky) to be able to use the JubJub curve Keypairs within the libp2p protocol too.
One of the main problems I've spot (just by a superficial look to the lib, I'm for sure missing a lot of things) is the fact that we're using protobuf and hardcoding the primitive used for the KeyPair as ID inside of one of the proto fields.
But I do think this can be workarrounded no?
Have there been any thoughts about that in the past? Is this something that would be desired to have in the lib? I would appreciate some feedback and in case it's something wanted, I'm happy to help to design/implement the solution!
Beta Was this translation helpful? Give feedback.
All reactions