Introduction

Hi, I'm cardene, a software engineer and technical writer focused on blockchain and AI.

I've also authored Japanese technical books on specification-driven development with LLMs and decentralized application (DApp) development.

I also build and publish a variety of tools, libraries, and open-source projects.

Background

ACP-20 proposes using Ed25519 keys to simplify how Avalanche identifies nodes and secures communication between them. It would let nodes use public keys directly as identifiers instead of deriving them from TLS certificates.

This article translates, summarizes, and expands on the proposal below.

I also cover other EIPs, BIPs, SLIPs, CAIPs, ENSIPs, RFCs, and ACPs.

Overview

ACP-20 proposes supporting Ed25519 in TLS certificates for Avalanche peer-to-peer communication, allowing Avalanche Network Clients (ANCs) to use Ed25519 public keys directly as Node IDs, and adding Ed25519 signature support to the Proposer VM. Ed25519 is an efficient signature scheme standardized in RFC 8032. It uses compact public keys, private keys, and signatures.

Under the AvalancheGo behavior described in the proposal, nodes support RSA and ECDSA. If no TLS certificate exists, the node generates a 4096-bit RSA private key and certificate and saves both to disk. It then hashes the certificate to derive a 20-byte Node ID. Snowman++ also includes the TLS certificate itself alongside the signature in the block header, creating another dependency on the certificate.

With Ed25519, the node can use its 32-byte public key as its Node ID and manage only the private key as persistent material. Supporting Ed25519 in the Proposer VM would also make signature handling more compact and consistent.

ACP-20 proposes adding Ed25519 support to peer communication and block signing so operators can simplify certificate management and reduce the amount of data the protocol carries.

Motivation

Current limitations

  • Dependence on RSA and ECDSA AvalancheGo only accepts RSA or ECDSA. If the TLS certificate is missing at startup, it must generate a 4096-bit RSA private key, create a certificate, and save both to disk.

  • Node ID derivation The Node ID is a 20-byte hash of the TLS certificate, so deriving it requires that certificate.

  • Snowman++ overhead With Snowman++, the block header includes the full TLS certificate and the signature. This increases the data size and adds a dependency on the certificate.

Improvements with Ed25519

Ed25519 has the following sizes in the representation discussed here.

Item Size
Public key 32 bytes
Private key 64 bytes
Signature 64 bytes

Using the public key as the Node ID increases its size from 20 to 32 bytes, a difference of 12 bytes. This modest increase makes the identifier simpler to derive because the node can use the public key directly.

With the private key available, the node can create a TLS certificate in memory at startup and use it for peer communication. Operators only have to manage and back up the Ed25519 private key rather than both an RSA key and its certificate.

Adding Ed25519 support to the Proposer VM gives nodes a compact and consistent signature scheme for proposing and verifying blocks. This improves efficiency and consistency across the network.

Existing and proposed approaches

Aspect Existing approach (RSA/ECDSA) Proposed approach (Ed25519)
Node ID derivation TLS certificate hash (20 bytes) Public key itself (32 bytes)
Backup material RSA private key and TLS certificate Ed25519 private key only
Block header Includes certificate and signature Supports a compact signature scheme
Operational burden Manage both key and certificate Manage only the private key

How the flows differ

The diagrams below retain their Japanese labels.

Existing flow
sequenceDiagram
  autonumber
  participant Node as ノード
  participant Disk as ディスク
  participant Net as ネットワーク

  Node->>Disk: TLS証明書の有無を確認
  alt 証明書なし
    Node->>Disk: 4096 bitのRSA秘密鍵を生成・保存
    Node->>Disk: RSAでTLS証明書を生成・保存
  end
  Node->>Node: 証明書をハッシュしてNode IDを生成(20B)
  Node-->>Net: TLSハンドシェイクで証明書を提示
  Note over Node: Snowman++ブロックヘッダーに証明書と署名を含める
Proposed flow
sequenceDiagram
  autonumber
  participant Node as ノード
  participant Mem as メモリ
  participant Net as ネットワーク

  Node->>Node: Ed25519秘密鍵を用意
  Node->>Mem: 起動時にTLS証明書をメモリ上で生成
  Node->>Node: Node ID = 公開鍵そのもの(32B)
  Node-->>Net: TLSハンドシェイクで証明書を提示
  Note over Node: Proposer VMはEd25519署名をサポート

Specification

Required changes

Extending the Node ID

Avalanche's P-Chain historically assumes every Node ID is 20 bytes long. An Ed25519 public key requires 32 bytes, so the P-Chain needs to be able to register and process 32-byte Node IDs. Existing transactions assume a 20-byte field, so implementations also need to keep decoding the older format correctly.

Changing the default key

Nodes previously generated an RSA key at startup. The proposal makes Ed25519 the default for the generated key file, staker.key. Operators can then keep only the Ed25519 private key without separately managing the certificate or an RSA key.

Generating the TLS certificate

At startup, the node uses the Ed25519 private key to construct a TLS certificate in memory. The certificate is used directly for peer-to-peer handshakes without being written to disk.

Ed25519 support in the Proposer VM

The Proposer VM signs blocks when it proposes them. Supporting Ed25519 lets nodes using those keys propose blocks and verify their signatures correctly.

Removing the embedded certificate from blocks

Proposer VM blocks previously carried the TLS certificate itself, which increased block size and made certificate management more complex. When a node with an Ed25519 Node ID proposes a block, the block no longer needs the embedded certificate.

Ed25519 support in PeerList messages

The proposal also adds Ed25519 support to the PeerList messages nodes exchange. The network layer can then recognize and share peers with Ed25519 Node IDs.

Effect on the peer-to-peer layer

The changes are limited because Avalanche uses TLS handshakes for peer-to-peer communication. Adding Ed25519 as a supported algorithm preserves the basic communication flow and handshake mechanism.

Extending the transaction format

The proposal also considers introducing a transaction format designed for Ed25519 Node IDs. A follow-up ACP would specify that format so implementations can distinguish the older and newer formats.

Future work

ACP-20 adds Ed25519 alongside the existing options. It recommends eventually phasing out TLS certificates based on other algorithms. Removing the dependency on RSA and ECDSA would simplify the implementation and improve network security. The proposal leaves the migration plan to future work.

Flow diagrams

The following diagrams compare the existing process with the proposed Ed25519 process.

Existing approach

sequenceDiagram
  autonumber
  participant Node as ノード
  participant Disk as ディスク
  participant Net as ネットワーク

  Node->>Disk: RSA秘密鍵を生成・保存
  Node->>Disk: RSAでTLS証明書を生成・保存
  Node->>Node: 証明書のハッシュ = Node ID(20B)
  Node-->>Net: TLSハンドシェイクで証明書を提示
  Note over Node: ブロックヘッダーに証明書と署名を含める

Proposed approach

sequenceDiagram
  autonumber
  participant Node as ノード
  participant Mem as メモリ
  participant Net as ネットワーク

  Node->>Node: Ed25519秘密鍵を生成(staker.key)
  Node->>Mem: 起動時にTLS証明書をメモリ上で生成
  Node->>Node: 公開鍵(32B) = Node ID
  Node-->>Net: TLSハンドシェイクで証明書を提示
  Note over Node: ブロックヘッダーでは証明書を省略可能

Compatibility

ACP-20 is designed to preserve compatibility with existing nodes and historical data. Implementations continue interpreting 20-byte Node IDs as TLS certificate hashes and also accept 32-byte Node IDs representing Ed25519 public keys.

P-Chain serialization requires particular attention. The earlier encoding always reads and writes 20 bytes without storing a length. Introducing the new 32-byte format therefore requires implementations to keep reading historical transactions with a 20-byte field. Practical approaches include either or both of the following.

  • Use a network upgrade flag or transaction type to specify which contexts read 20 bytes and which read 32 bytes.
  • Select the fixed length from the field or version context. Avoid ambiguous autodetection, which can lead to incorrect decoding.

Here is a short pseudocode example.

go
// 例: コンテキストに応じてNodeIDの長さを固定で読む
func readNodeID(r io.Reader, ctx Context) (NodeID, error) {
    switch {
    case ctx.BeforeEd25519Activation: // 互換区間
        var id20 [20]byte
        if _, err := io.ReadFull(r, id20[:]); err != nil { return NodeID{}, err }
        return NodeID{Type: LegacyHash20, Bytes: id20[:]}, nil
    case ctx.RequiresEd25519: // 新形式のみ
        var id32 [32]byte
        if _, err := io.ReadFull(r, id32[:]); err != nil { return NodeID{}, err }
        return NodeID{Type: Ed25519PubKey32, Bytes: id32[:]}, nil
    default: // 明示的に決まるまで拒否 or フォールバック
        return NodeID{}, errors.New("ambiguous NodeID length")
    }
}

This approach lets the network enable 32-byte Node IDs incrementally while preserving existing 20-byte identifiers.

Reference implementation

Generating a TLS certificate from an Ed25519 private key is a standard operation. The Go standard library example at crypto/tls/generate_cert.go provides a reference. AvalancheGo already includes code to extract and verify public keys from TLS certificates.

This minimal example generates an Ed25519 key in Go, creates a self-signed TLS certificate with it, and puts the certificate into a tls.Config.

go
package main

import (
	"crypto/ed25519"
	"crypto/rand"
	"crypto/tls"
	"crypto/x509"
	"crypto/x509/pkix"
	"math/big"
	"time"
)

func ed25519SelfSignedCert() (tls.Certificate, ed25519.PublicKey, error) {
	// 1. Ed25519鍵ペアを生成
	pub, priv, err := ed25519.GenerateKey(rand.Reader)
	if err != nil { return tls.Certificate{}, nil, err }

	// 2. x509テンプレート(自己署名用)
	serialNumberLimit := new(big.Int).Lsh(big.NewInt(1), 128)
	serial, _ := rand.Int(rand.Reader, serialNumberLimit)
	tpl := &x509.Certificate{
		SerialNumber: serial,
		Subject:      pkix.Name{CommonName: "avalanche-node"},
		NotBefore:    time.Now().Add(-5 * time.Minute),
		NotAfter:     time.Now().Add(365 * 24 * time.Hour),
		KeyUsage:     x509.KeyUsageDigitalSignature | x509.KeyUsageKeyEncipherment,
		ExtKeyUsage:  []x509.ExtKeyUsage{x509.ExtKeyUsageServerAuth, x509.ExtKeyUsageClientAuth},
		BasicConstraintsValid: true,
	}

	// 3. 自己署名で証明書DERを作成
	der, err := x509.CreateCertificate(rand.Reader, tpl, tpl, pub, priv)
	if err != nil { return tls.Certificate{}, nil, err }

	// 4. tls.Certificateに詰める(Ed25519はそのまま使える)
	cert := tls.Certificate{
		Certificate: [][]byte{der},
		PrivateKey:  priv,
	}

	return cert, pub, nil
}

func main() {
	cert, pub, err := ed25519SelfSignedCert()
	if err != nil { panic(err) }

	// Node IDにEd25519公開鍵(32バイト)を使う想定
	_ = pub

	// p2p用のTLS設定例
	_ = &tls.Config{
		Certificates: []tls.Certificate{cert},
		MinVersion:   tls.VersionTLS12,
		// Ed25519対応はGoの標準TLS実装で自動ハンドリングされます
	}
}

Extracting the public key from an existing certificate, for example by parsing it with x509.ParseCertificate and reading cert.PublicKey, is a standard operation. AvalancheGo has similar verification logic. With Ed25519, this path expects an Ed25519 public key of 32 bytes.

Security considerations

Verification criteria

RFC 8032 standardizes Ed25519, but implementations can differ in what inputs they accept. In particular, implementations can differ in these ways.

  • They may accept or reject non-canonical encodings of public keys or signatures.
  • They may choose different verification equations permitted by the RFC. As a result, one implementation can accept a signature that another rejects.

This difference is critical in a blockchain, where all nodes must agree on signature validity. Zcash introduced ZIP 215 to specify the verification criteria precisely. ACP-20 implementers must use the ZIP 215 verification rules.

Go implementations can use the recommended ed25519consensus library. It minimally forks Go's standard crypto/ed25519 package to provide ZIP 215 verification.

Here is a minimal verification example.

go
import (
	"github.com/hdevalence/ed25519consensus"
)

// pub: 32バイトのEd25519公開鍵
// msg: 署名対象メッセージ
// sig: 64バイトのEd25519署名
func verifySIG(pub, msg, sig []byte) bool {
	return ed25519consensus.Verify(pub, msg, sig) // ZIP-215準拠
}

Using the same rules avoids disagreements over signature validity and reduces the risk that inconsistent verification breaks consensus.

Design questions

Can Ed25519 keys be used with other communication protocols?

Yes. Ed25519 can be used beyond TLS, including with protocols and frameworks such as QUIC, a general-purpose transport, and Noise, a framework for secure handshakes and encrypted sessions. ACP-20 replaces the TLS certificate hash used as the Node ID with an Ed25519 public key. This reduces dependence on TLS and makes it easier to test or adopt communication protocols suited to a high-throughput blockchain like Avalanche.

Can Ed25519 keys be used with a verifiable random function (VRF)?

Yes. RFC 9381 specifies an elliptic curve VRF (ECVRF) and includes Ed25519 test vectors. An elliptic curve that meets the protocol's security requirements in the random oracle model can be used to generate verifiable randomness. One possible design is for validators to use Ed25519 keys to generate per-block VRF values, including on subnets.

Conclusion

ACP-20 proposes moving Avalanche node identification and communication toward compact Ed25519 keys. Using the public key as the Node ID reduces dependence on TLS certificates, while Ed25519 support in the Proposer VM extends the same approach to block signing.

Questions are welcome by direct message.

Twitter @cardene777

You can also find my writing on these sites.

https://chaldene.net/