ava-labs / avalanchego

Go implementation of an Avalanche node.
https://avax.network
BSD 3-Clause "New" or "Revised" License
2.13k stars 671 forks source link

Implement ACP-20 #3242

Open StephenButtolph opened 3 months ago

StephenButtolph commented 3 months ago

Currently NodeIDs are generated based on ripemd160(sha256(TLS_CERT_DER)): https://github.com/ava-labs/avalanchego/blob/ccf785c7c87c0126aed0354d11d91173c283031b/ids/node_id.go#L79-L83

Only RSA and ECDSA keys are currently allowed to be used. This restriction means that we can use the public key in the TLS certificate to switch on the NodeID format: https://github.com/ava-labs/avalanchego/blob/ccf785c7c87c0126aed0354d11d91173c283031b/staking/parse.go#L124-L167

In the Etna upgrade, Ed25519 keys should be supported: https://github.com/avalanche-foundation/ACPs/tree/main/ACPs/20-ed25519-p2p

The NodeID representation of these Ed25519 keys should be the 32-byte public key representation.

The Ed25519 keys will be used for ACP-77 subnet validators: https://github.com/avalanche-foundation/ACPs/tree/main/ACPs/77-reinventing-subnets#step-2-issue-a-registersubnetvalidatortx-on-the-p-chain

We must retain support for prior P-chain transactions which encode the fixed 20-byte ids.NodeID type:

The following PRs are related to this issue:

github-actions[bot] commented 1 month ago

This issue has become stale because it has been open 60 days with no activity. Adding the lifecycle/frozen label will cause this issue to ignore lifecycle events.