Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update docs from RSA to Ed25519 #2606

Merged
merged 1 commit into from
Nov 11, 2023

Conversation

librick
Copy link
Contributor

@librick librick commented Oct 15, 2023

The docs for libp2p's func New say:

If no peer identity is provided, it generates a random RSA 2048
key-pair and derives a new identity from it

Maybe I'm misinterpreting the docs, but I've observed that the default is actually Ed25519:

node, err := libp2p.New()
if err != nil {
    panic(err)
}
fmt.Printf("Peer ID key type: %s\n", node.Peerstore().PrivKey(node.ID()).Type())

Which prints "Peer ID key type: Ed25519".

This is further supported by the Peer Id spec:

Implementations MUST support Ed25519. Implementations SHOULD support RSA…

This commit updates the function docs to express that the default is Ed25519, not RSA.

The docs for libp2p's `func New` say:
>If no peer identity is provided, it generates a random RSA 2048
key-pair and derives a new identity from it

Maybe I'm misinterpreting the docs, but I've observed
that the default is actually Ed25519:
```go
node, err := libp2p.New()
if err != nil {
    panic(err)
}
fmt.Printf("Peer ID key type: %s\n", node.Peerstore().PrivKey(node.ID()).Type())
```
Which prints "Peer ID key type: Ed25519".

This is further supported by the [Peer Id spec](https://github.com/libp2p/specs/blob/d2106f43e878ae4c3a1c6465a7c329835290fe22/peer-ids/peer-ids.md?plain=1#L119):
>Implementations MUST support Ed25519. Implementations SHOULD support RSA…

This commit updates the function docs to express that the default is Ed25519,
not RSA.
@sukunrt sukunrt merged commit 2f274fc into libp2p:master Nov 11, 2023
6 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants