This repository was archived by the owner on Nov 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Use Ed25519 for libp2p-level signing #1494
Copy link
Copy link
Closed
Labels
J0-enhancementAn additional feature request.An additional feature request.
Milestone
Description
When creating a chainspec including boot nodes, libp2p public keys are included, e.g.
"bootNodes": [
"/ip4/11.22.33.44/tcp/30333/p2p/QmSZcgM3nxwKMgDuy1FgoDVYbT7nSucwa7s8qnF9o7J8E6"
],
This public key is derived from a keypair set via --node-key, which can be auto-generated by substrate. Now if you create the initial bootNodes, the --node-keys must be known at build-spec time. This can be archived by an admin using
cat /dev/urandom | head -c 32 | xxd -p -c 256 > ~/.node_key
substrate --chain=staging --node-key "$(< ~/.node_key)" build-spec ...
As discussed in Rewrite the libp2p networking #742, secp256k1 is used for libp2p-level signing. The problem is: not every 32 byte key is a valid secp256k1 key (value must be < 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141). If we switch to Ed25519, we know that every 32 bytes key is a valid private key. Thus no special secp256k1 tooling is required to generate --node-keys.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
J0-enhancementAn additional feature request.An additional feature request.