Skip to content

Storing/Exporting local keypair #4376

Closed Answered by thomaseizinger
2-3-5-41 asked this question in Q&A
Discussion options

You must be logged in to vote

however, from_protobuf_encoding() on my system seems to "corrupt" the EdwardsPoint.Z, assuming the Z field isn't supposed to look like this FieldElement51([1, 0, 0, 0, 0]) after getting a keypair from a protobuf encoding.

This sounds like a bug to me. Can you reproduce this with a unit test and open a PR?

I want to know if there is a recommended way to export/store a keypair in libp2p.

It is recommended to use the {to,from}_protobuf_encoding functions because those "tag" the secret key bytes with their type and allow us correctly load them again.

Replies: 1 comment 6 replies

Comment options

You must be logged in to vote
6 replies
@thomaseizinger
Comment options

@2-3-5-41
Comment options

@2-3-5-41
Comment options

@thomaseizinger
Comment options

@2-3-5-41
Comment options

Answer selected by 2-3-5-41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants