Internet-Draft GNUnet HELLO v2 November 2026
Expires 30 May 2027 [Page]
Workgroup:
Independent Stream
Internet-Draft:
draft-gnunet-hello-00
Published:
Intended Status:
Informational
Expires:
Author:
GNUnet e.V.

The GNUnet HELLO Format, Version 2

Abstract

This document specifies version 2 of the GNUnet HELLO: the signed statement by which a peer announces its identity, the addresses at which it can be reached and the public key encapsulation keys other peers use to establish confidential channels with it.

Compared to the previous format, a HELLO is encoded in deterministic CBOR, the signature covers every element of the HELLO, the peer identity key is used only for signing, and dedicated X25519 and hybrid post-quantum/traditional (X-Wing) key encapsulation keys are published as typed records. This document defines the normative wire format, its encoding rules and signature, the encodings in use, and the security considerations for implementers.

This specification was developed outside the IETF and does not have IETF consensus. It is published here to inform readers about the function of GNUnet HELLOs, guide future implementations, and ensure interoperability among implementations.

Status of This Memo

This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79.

Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet-Drafts is at https://datatracker.ietf.org/drafts/current/.

Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress."

This Internet-Draft will expire on 30 May 2027.

▲

Table of Contents

1. Introduction

A HELLO is the signed statement "peer P can be reached at addresses A1...An, until time T". It is what a hostlist server serves, what the R5N DHT [LSD0004] stores under the SHA-512 hash of the peer identity, what peers gossip to their neighbours and what users exchange out of band as a URL or QR code.

This document specifies version 2 of the HELLO (in the following simply "HELLO"). It replaces the HELLO block, the HelloMessage and the HELLO URL defined in [LSD0004]. It is deliberately not wire-compatible with the previous version (see Section 14). Version 2 addresses two defects of the previous design:

  1. In the deployed implementation, the hash of the address list that is signed is computed over the empty string, so the signature binds only the expiration time. Anyone who has seen one unexpired HELLO of a peer can substitute an arbitrary address list. In this version, the signature covers the expiration and every record.
  2. The only key published was the peer's Ed25519 identity key. Every confidential channel was therefore bootstrapped by mapping that key to X25519 and using it for key exchange, so one secret scalar served both as a signing key and as a Diffie-Hellman key for every protocol, could not rotate without changing the peer identity, and had no post-quantum counterpart. In this version the identity key is used for signatures only, and key encapsulation keys are published as separate, typed records.

A HELLO is encoded in deterministic CBOR [RFC8949] instead of packed binary structures. GNUnet's peer-to-peer control messages move to CBOR, and doing so in the same clean break means the HELLO, the most widely distributed GNUnet object, breaks only once.

This specification was developed outside the IETF and does not have IETF consensus. It is published here to guide implementers of GNUnet and to ensure interoperability among implementations.

1.1. Requirements Notation

The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here.

2. Terminology

HELLO:
The CBOR item defined in Section 4. In the DHT it is the content of a HELLO block.
Peer Identity (PID):
The 32-byte Ed25519 [RFC8032] public key of a peer. It identifies the peer, verifies its HELLO signatures and, hashed with SHA-512, is the peer's key in the DHT. In this version it is never used for key exchange.
Record:
An entry of the records map of a HELLO: a record type number and a value (Section 4.2).
Address:
A string of the form <prefix>://<rest> that names a communicator (the prefix) and a communicator-specific location (the rest). See also Section 2 of [LSD0004].
Communicator:
A GNUnet component that implements one underlay transport protocol, such as TCP, UDP or QUIC.
PILS:
The Peer Identity Lifecycle Service of the GNUnet implementation. It holds the peer's long-term secret and derives the peer identity and all key material from it (Section 8).
CBOR, encoding, item:
As in [RFC8949]. "The encoding of X" is the byte string that represents the CBOR item X under the rules of Section 4.3.
CDDL:
The Concise Data Definition Language [RFC8610]. The CDDL in this document is normative.
KEM:
Key Encapsulation Mechanism, as in [RFC9180].
PQ/T hybrid:
A combination of a post-quantum and a traditional algorithm that remains secure as long as either component is.
SHA-512(D):
The SHA-512 [RFC6234] hash over D (64 bytes).
HKDF-Extract(salt, IKM), HKDF-Expand(PRK, info, L):
The functions of [RFC5869], instantiated with HMAC-SHA256. Info strings are ASCII and are used without a terminating NUL.
Base32GNS:
The base32 encoding defined in [RFC9498]. Encoders produce upper-case output; decoding is case-insensitive.
A || B:
Concatenation of byte strings A and B.
NBO:
Network byte order (big endian).
Absolute time:
An unsigned integer counting microseconds since midnight (0 hour), January 1, 1970 UTC.

3. Overview

A HELLO is a single CBOR array of four elements: the peer identity, the signature, the expiration time, and a map of records. Each entry of that map is one record: its key is the record type number and its value is the record value. The record types defined by this document are:

The signature covers the expiration time and the encoded records map. The encoding is deterministic, and receivers reject every other encoding, so a HELLO has exactly one valid byte representation and serialises, hashes and signs identically every time it is produced. The record type number also determines what a receiver that does not know the type does: it rejects the HELLO if the type is in the critical range, and ignores the record otherwise. The record registry together with that rule is the format's only extension mechanism.

Several things are deliberately absent:

No version field.
The DHT block type and the message types identify the format; the record registry provides extensibility. A version number would be a second, weaker extension mechanism.
No per-record flags.
Whether a record type is critical is a property of the type, fixed at registration and encoded in its number (Section 4.2). A receiver can therefore apply it to types it does not know, including in the URL form.
No sequence number and no "not before" time.
For a HELLO produced as specified in Section 8, the records are a function of the peer identity, so there is nothing for a counter to order (Section 12.3). The expiration time alone bounds validity.
No per-record expiration.
A HELLO expires as a unit.
No pruning.
Records are never replaced by digests. A peer cannot encapsulate to a key it does not have, so a HELLO with a pruned key record would force a traditional-only first flight: a silent post-quantum downgrade that depends on how the HELLO was learned.

4. The HELLO

4.1. Structure

A HELLO is the following CBOR item:

hello = [
  pid:        bstr .size 32,    ; Ed25519 public key
  signature:  bstr .size 64,    ; Ed25519 signature, Section 6
  expiration: uint,             ; absolute time, microseconds
  records:    records,
]

records = {
  ? 1: [+ address],             ; ADDRESS
    2: bstr .size 32,           ; KEM_X25519
  ? 3: bstr .size 1216,         ; KEM_XWING
  * record-type => any,         ; record types not defined here
}

address       = tstr
record-type   = critical-type / optional-type
critical-type = 1..65535
optional-type = 65536..4294967295
Figure 1: The HELLO in CDDL.
pid:
The 32-byte Ed25519 public key of the peer.
signature:
The 64-byte Ed25519 signature defined in Section 6.
expiration:
The absolute time at which the HELLO expires. Peers SHOULD set it to the time of signing plus two days and SHOULD re-sign and republish their HELLO before it expires. Unlike in [LSD0004], the value is not required to be a multiple of one million.
records:
The records of the HELLO (Section 4.2).

Figure 2 shows a HELLO with three addresses and both key records in CBOR diagnostic notation (Section 8 of [RFC8949]), with the byte strings abbreviated. Figure 3 shows its encoding.

[
  h'1F3A...',                   / pid, 32 bytes /
  h'9C04...',                   / signature, 64 bytes /
  1795000000000000,             / expiration /
  {
    1: ["tcp://1.2.3.4:1234",
        "tcp://1.2.3.5:1234",
        "tcp://1.2.3.6:1234"],
    2: h'5B7E...',              / KEM_X25519, 32 bytes /
    3: h'A50D...'               / KEM_XWING, 1216 bytes /
  }
]
Figure 2: Example HELLO in Diagnostic Notation.
84                                # array(4)
   58 20 <32 bytes>               #   pid
   58 40 <64 bytes>               #   signature
   1b 0006608b015f3000            #   expiration
   a3                             #   map(3): records, H_RECORDS
                                  #   starts here
      01                          #     1: ADDRESS
      83                          #     array(3)
         72 7463703a2f2f312e322e332e343a31323334
                                  #       "tcp://1.2.3.4:1234"
         72 7463703a2f2f312e322e332e353a31323334
                                  #       "tcp://1.2.3.5:1234"
         72 7463703a2f2f312e322e332e363a31323334
                                  #       "tcp://1.2.3.6:1234"
      02 58 20 <32 bytes>         #     2: KEM_X25519
      03 59 04c0 <1216 bytes>     #     3: KEM_XWING
Figure 3: Encoding of the Example HELLO.

4.2. Records

The records map has an unsigned integer key for each record type present in the HELLO. The value is that type's record value, as defined by the type. A type occurs at most once; a type that can have several values, such as ADDRESS, defines an array value.

Record type numbers come from the GANA "GNUnet HELLO Record Types" registry (Section 13). The number determines how a receiver treats a type it does not know:

Critical types (1 to 65535):
A receiver that does not know the type MUST reject the HELLO.
Optional types (65536 to 4294967295):
A receiver that does not know the type MUST ignore the record for processing.

Number 0 is reserved and MUST NOT occur. A record of an unknown type stays covered by the signature like every other record. Implementations SHOULD store and forward a HELLO as the bytes they received. An implementation that re-encodes a HELLO MUST preserve every record, including unknown ones, so that the result is byte-identical.

4.3. Encoding Rules

A HELLO, and every CBOR item that this document defines or that appears in a HELLO, MUST be encoded as follows. A receiver MUST reject a HELLO that violates any of these rules.

  1. Deterministic encoding. The core deterministic encoding requirements of Section 4.2.1 of [RFC8949] apply: integers, lengths and counts use the shortest form, all items have definite length, map keys are sorted in the bytewise lexicographic order of their encodings, and no map has duplicate keys.
  2. Restricted data model. Only unsigned and negative integers, byte strings, text strings, arrays, maps, false, true and null are allowed. Tags, floating-point values, undefined and other simple values are not.
  3. Map keys are unsigned integers.
  4. Text strings are valid UTF-8 and do not contain U+0000.
  5. Nesting depth is at most 8, counting the HELLO array as depth 1.
  6. Nothing follows the item. A HELLO is the whole content of its container (message body, DHT block, decoded URL parameter); trailing bytes are an error.

These rules leave exactly one valid encoding for every HELLO. An implementation whose CBOR library accepts more can enforce them by checking the data model and nesting depth, re-encoding the decoded item deterministically, and comparing the result with the input byte for byte. Decoders MUST NOT allocate memory based on a declared length or count before checking it against the remaining input.

5. Record Types

There is one record type per kind of key or datum, and no record carries a nested algorithm identifier. Which KEM construction or combiner is used with a key is fixed by the protocol that encapsulates to it and is never negotiated through the HELLO (Section 10).

Table 1: Record Types Defined by this Document.
Number Name Value Presence
1 ADDRESS [+ tstr] optional
2 KEM_X25519 bstr .size 32 mandatory
3 KEM_XWING bstr .size 1216 optional

A receiver MUST reject a HELLO in which the value of a type listed here does not satisfy the definition below.

5.1. ADDRESS

The value is a non-empty array of addresses. Each address is a text string of the form <prefix>://<rest>:

  • prefix MUST be at least one character long and consist only of ASCII letters and "+". It names the communicator.
  • rest is interpreted only by the communicator named by prefix. Section 11 describes how communicators carry their own parameters in it.

The addresses MUST be in strictly ascending order of their encodings, compared bytewise lexicographically, which is the order deterministic CBOR uses for map keys. For text strings this means shorter addresses first, then bytewise order of the UTF-8 content. Strict order excludes duplicates.

A peer without addresses omits the record; an empty array is invalid. A peer may have no addresses, for example if it knows it cannot be reached from outside.

5.2. KEM_X25519

The value is a 32-byte raw X25519 public key, encoded as in [RFC7748]. It is the peer's traditional key encapsulation key, used by every protocol that needs a traditional (or the traditional half of an obfuscated hybrid) key exchange with the peer (Section 10).

Every HELLO MUST contain this record: without it, the peer cannot be connected to.

This key is independent of the X25519 component of KEM_XWING; an implementation MUST NOT use one X25519 key pair for both (Section 12.5).

5.3. KEM_XWING

The value is a 1216-byte raw X-Wing encapsulation key as defined in [I-D.connolly-cfrg-xwing-kem]: the 1184-byte ML-KEM-768 encapsulation key followed by the 32-byte X25519 public key (ML-KEM-768 first). X-Wing ciphertexts are 1120 bytes and its shared secrets are 32 bytes.

A HELLO MAY omit this record. A peer that omits it can still be reached, but every session established with it is protected by traditional cryptography only and is exposed to an adversary that records traffic now and breaks X25519 later. Implementations of protocols that would use this key SHOULD log when they fall back to a traditional-only session because the record is absent.

X-Wing is itself a PQ/T hybrid, so a peer cannot publish a post-quantum-only key by accident. A single record is used rather than a pair of independent X25519 and ML-KEM records so that consuming protocols call one primitive and inherit its security analysis, instead of specifying their own combiner.

5.4. Future Record Types

The value of a future record type may be any CBOR item that the encoding rules allow. Structured values SHOULD be arrays, or maps with unsigned integer keys where they must be extensible. A registration chooses the critical or the optional range (Section 4.2). Record types without a concrete specification are not reserved in advance.

The following is recorded for orientation only; this document does not allocate it.

KEM_MLKEM768:
A 1184-byte raw ML-KEM-768 encapsulation key [FIPS203], needed only if the obfuscating communicators adopt the OEINC hybrid obfuscated KEM combiner [GRSV25], whose inner component must be a bare ML-KEM key. Whether OEINC can instead reuse the ML-KEM half of KEM_XWING is to be decided when that combiner is specified.

Other ML-KEM parameter sets and post-quantum signature verification keys (Section 12.10) are each a new record type, not a change to the format.

6. Signature

The signature element contains an Ed25519 signature [RFC8032] (pure Ed25519, not Ed25519ph or Ed25519ctx) by the private key of pid over the 80-byte structure shown in Figure 4. This structure is not CBOR. It is never transmitted: signer and verifier build it from the HELLO. All fields are in NBO.

0     8     16    24    32    40    48    56
+-----+-----+-----+-----+-----+-----+-----+-----+
|         SIZE          |        PURPOSE        |
+-----+-----+-----+-----+-----+-----+-----+-----+
|                  EXPIRATION                   |
+-----+-----+-----+-----+-----+-----+-----+-----+
|                   H_RECORDS                   |
|                   (64 bytes)                  |
/                                               /
|                                               |
+-----+-----+-----+-----+-----+-----+-----+-----+
Figure 4: The Data Signed in a HELLO.
SIZE:
A 32-bit value; it MUST be 80.
PURPOSE:
A 32-bit signature purpose; it MUST be the value allocated for HELLO_V2 in the GANA "GNUnet Signature Purposes" registry (TBD, see Section 13).
EXPIRATION:
The expiration of the HELLO as a 64-bit unsigned integer.
H_RECORDS:
SHA-512 over the encoding of the records map as it appears in the HELLO, from its initial byte to its last (Figure 3). Because of the encoding rules, this is the deterministic encoding of the records map.

The purpose number of the previous version (7) MUST NOT be used, so that signatures of the two versions are separated by their purpose rather than by the accident that their hashed inputs differ.

Because the signature covers every record, a relay cannot add, remove, modify or reorder any record, including records it does not understand. In particular, it cannot strip a KEM_XWING record to force a traditional-only session.

7. Validating a HELLO

A receiver of a HELLO, in whatever encoding (Section 9), MUST perform the following steps and reject the HELLO if any of them fails:

  1. The HELLO is one CBOR item that satisfies the encoding rules (Section 4.3), with nothing after it.
  2. It matches the hello rule of Figure 1. In particular, it has a KEM_X25519 record, and no record type is 0 or greater than 4294967295.
  3. Every record of a type defined in Section 5 satisfies its definition; for ADDRESS, every address is well-formed and the addresses are in strictly ascending order.
  4. No record has an unknown type in the critical range (Section 4.2).
  5. The expiration lies in the future.
  6. The signature is a valid Ed25519 signature by pid over the structure in Figure 4, computed from the received expiration and records map.

The order of the steps is not significant, except that a receiver SHOULD perform the cheap syntactic checks before the signature verification.

If a receiver holds two valid HELLOs for the same peer identity, it SHOULD keep the one with the later expiration. For HELLOs created as specified in Section 8, two HELLOs of the same peer identity differ in their expiration time only.

8. Key Derivation

This section specifies how the GNUnet implementation (PILS) derives the peer identity and the published key encapsulation keys. Verifiers never perform these steps, and other implementations MAY generate their keys differently. They are specified because the properties in Section 12.3 depend on them and so that independent implementations can reproduce test vectors.

8.1. The Address Hash

The address hash is computed over the addresses only:

H_ADDRS = SHA-512 (A)

where A is the encoding of the array of the peer's addresses in the order of Section 5.1, that is, the encoded value of the ADDRESS record. If the peer has no addresses, A is the encoding of the empty array, the single byte 0x80.

H_ADDRS is not H_RECORDS: the key records are derived from H_ADDRS and therefore cannot be inputs to it. Implementations SHOULD give the two computations distinct names.

8.2. Peer Identity and KEM Keys

Let IKM be the peer's long-term secret seed, held only by PILS. The keys of the peer for a given address set are derived as:

PRK        = HKDF-Extract (salt = H_ADDRS, IKM)
sk_pid     = HKDF-Expand (PRK, "gnunet-pils-ephemeral-peer-key", 32)
sk_x25519  = HKDF-Expand (PRK, "gnunet-pils-kem-x25519-v1", 32)
seed_xwing = HKDF-Expand (PRK, "gnunet-pils-kem-xwing-v1", 32)

pid        = Ed25519 public key for private key sk_pid
KEM_X25519 = X25519 (sk_x25519, 9)
(ek, dk)   = X-Wing.GenerateKeyPairDerand (seed_xwing)
KEM_XWING  = ek
Figure 5: Derivation of the Peer Keys.

sk_pid is an Ed25519 private key as in Section 5.1.5 of [RFC8032]. sk_x25519 is an X25519 private key as in Section 5 of [RFC7748] (the X25519 function clamps it). GenerateKeyPairDerand is defined in [I-D.connolly-cfrg-xwing-kem]; the X-Wing decapsulation key dk is the 32-byte seed itself, so PILS stores 32 bytes rather than an expanded ML-KEM decapsulation key.

The labels and the HKDF construction are those of the previous version. Every derivation is a single HKDF expansion with no retry loop. Published static keys need no Elligator or Kemeleon encodability, so no rejection-sampling counter is needed (Section 12.8).

8.3. Rotation and Grace Period

A change of the address set changes H_ADDRS and therefore the peer identity and all KEM keys at once. KEM keys can therefore never link a peer across identities.

To let in-flight handshakes complete, PILS SHOULD retain the previous H_ADDRS (64 bytes, from which the previous keys can be re-derived) for one HELLO validity period (two days), and MUST NOT decapsulate with keys older than the previous generation.

8.4. Determinism Requirement

Given the same IKM and the same address set, an implementation following this section MUST produce a byte-identical records map. No record type whose value is non-deterministic (a timestamp, a nonce, a randomised encoding) may be added to a HELLO without revisiting Section 12.3. Implementations SHOULD have a test that derives a HELLO twice from the same inputs and checks that the records maps are equal.

9. Encodings

A HELLO is carried in three ways. The first two carry the HELLO item unchanged. The URL form carries the same content in a form that people can read, and converts to and from the HELLO item without involving the peer.

9.1. HELLO Item

The encoded HELLO (Section 4) is the form stored in the DHT and in local peer stores, and it is the form hostlist servers SHOULD serve (Section 12.11).

In the R5N DHT [LSD0004], a HELLO is stored as a block of type DHT_HELLO_V2 (Section 13) whose content is the encoded HELLO. The block operations are as defined for HELLO blocks in Section 8.2 of [LSD0004], with the following changes:

DeriveBlockKey:
SHA-512 of the pid, unchanged.
ValidateBlockStoreRequest:
The validation of Section 7.
SetupResultFilter and FilterResult:
H_RECORDS takes the place of H_ADDRS.

9.2. Messages

Two GNUnet message types carry a HELLO. In both, the message body is exactly the encoded HELLO, with no other field and no padding. The message header is defined by GNUnet's message framing and is not repeated here.

HELLO_URI_V2:
A complete HELLO of any peer, for example in gossip or when a HELLO is handed to a local service.
DHT_P2P_HELLO_V2:

A DHT peer advertises its own HELLO to its direct neighbours with this message, which replaces the HelloMessage of Section 7.2 of [LSD0004]. A receiver MUST discard the message if pid is not the identity of the neighbour that sent it. Otherwise it validates the HELLO as specified in Section 7, and processing follows Section 7.2.2 of [LSD0004].

Unlike in [LSD0004], the message carries the peer identity. This costs 34 bytes per neighbour and removes a separate encoding from which the receiver had to rebuild the HELLO.

9.3. HELLO URL

The URL form is meant for humans: for copy and paste, and for QR codes. Its syntax in ABNF [RFC5234] is:

hello-URL  = "gnunet://hello/" pid "/" sig "/" exp
             [ "?" param *( "&" param ) ]
pid        = 52b32char             ; Base32GNS(pid)
sig        = 103b32char            ; Base32GNS(signature)
exp        = 1*20DIGIT             ; expiration, decimal microseconds
param      = addr-param / rec-param
addr-param = addr-name "=" addr-value
addr-name  = 1*( ALPHA / "+" )     ; the address prefix
addr-value = *( unreserved / pct-encoded )
rec-param  = "_" rec-type "=" 1*b32char
rec-type   = %x31-39 *9DIGIT       ; record type number, not 1
b32char    = ALPHA / DIGIT
Figure 6: HELLO URL Syntax.

unreserved and pct-encoded are defined in [RFC3986]. pid and signature are encoded as their raw bytes, without a CBOR head.

Addresses:
Each address <prefix>://<rest> of the ADDRESS record is one parameter <prefix>=<rest'>, where rest' is the UTF-8 encoding of rest with every byte that is not in the unreserved set percent-encoded using upper-case hexadecimal digits. For example, tcp://1.2.3.4:1234 becomes tcp=1.2.3.4%3A1234. The ADDRESS record MUST NOT be given in the form below.
All other records:
A record of type N is one parameter _<N>=<Base32GNS(V)>, where N is the type number in decimal without leading zeros and V is the encoding of the record value. For example, the KEM_X25519 record is _2= followed by the Base32GNS encoding of the 34 bytes 0x58 0x20 || key. An address prefix cannot start with "_", so the two kinds of parameter cannot collide.

The URL carries the type number and the complete value of every record. A parser therefore rebuilds the HELLO without knowing the record types, including types it does not know, and then applies the rules of Section 4.2 to them.

A generator MUST emit the addresses in the order of Section 5.1, followed by the other records in ascending order of their type numbers. A parser MUST:

  1. decode each _<N> value as one CBOR item that satisfies the encoding rules, with nothing after it;
  2. reject the URL if an address or a type number occurs more than once;
  3. build the records map, with the addresses sorted as in Section 5.1 as the value of key 1, and each decoded value under its type number;
  4. build and encode the HELLO item, and validate it as specified in Section 7.

The scheme and path prefix "gnunet://hello/" and the Base32GNS fields are case-insensitive; generators emit them as shown and in upper case respectively. Address prefixes and address values are case-sensitive. A URL without a "?" part is syntactically valid but fails validation, because every HELLO carries a KEM_X25519 record. A HELLO URL of the previous version, which carries only address parameters, is rejected for the same reason.

The expiration is given in microseconds, as in the deployed implementation. Appendix C of [LSD0004] specifies seconds; this document follows the implementation.

The example of Figure 2 as a URL (Base32GNS values abbreviated):

gnunet://hello/<52 chars>/<103 chars>/1795000000000000
  ?tcp=1.2.3.4%3A1234&tcp=1.2.3.5%3A1234&tcp=1.2.3.6%3A1234
  &_2=<55 chars>
  &_3=<1951 chars>
Figure 7: Example HELLO URL.

10. Use of HELLO Keys by Other Protocols

This section states requirements on the protocols that use the keys published in a HELLO. The protocols themselves are specified elsewhere.

Table 2: Consumers of HELLO Key Material.
Consumer Record used Construction Obfuscated
CORE key exchange (CAKE, [LSD0012]) KEM_XWING X-Wing no
CADET tunnel key exchange KEM_XWING, KEM_X25519 X-Wing; DHKEM until migrated no
Transport distance-vector box KEM_XWING, KEM_X25519 X-Wing; DHKEM until migrated no
tcp, udp, libp2p communicators, first flight KEM_X25519 Elligator DHKEM [LSD0011]; later OEINC yes
udp communicator, in-channel rekey KEM_XWING X-Wing (ephemeral key) no
quic, http3 communicators ADDRESS (rpk parameter) TLS 1.3 raw public key no
DHT, transport, revocation signatures pid Ed25519 signatures only n/a

Consuming protocols MUST follow these rules:

  1. The peer identity key is not a key exchange key. It MUST NOT be converted to X25519 or used in any key exchange. A protocol that used to encapsulate to a bare peer identity MUST obtain the peer's HELLO first.
  2. In-band keys are authenticated by a HELLO. The binding between a peer identity and its KEM keys exists only through the HELLO signature. A protocol that receives a peer's KEM public key in band (as CAKE does with the initiator key pkI) MUST check it against a valid HELLO of the claimed peer identity, for example by carrying the HELLO in the encrypted handshake or by looking it up.
  3. No raw Diffie-Hellman. Every use of the KEM_X25519 private key MUST go through a KEM that hashes the ciphertext and a protocol label into its output, such as DHKEM [RFC9180] or the Elligator KEM [LSD0011]. Encapsulators MUST abort if the X25519 output is all zeros (Section 6.1 of [RFC7748]).
  4. Domain separation. Each protocol MUST bind its own label, the public keys involved and the ciphertexts into its key derivation, so that a shared secret obtained in one protocol is useless in another.
  5. No home-grown PQ/T combiner where X-Wing suffices. A protocol whose ciphertexts need not look random and that adds post-quantum key agreement MUST use KEM_XWING with X-Wing as specified, and MUST NOT combine KEM_X25519 with the ML-KEM half of KEM_XWING. The X25519 half of KEM_XWING MUST NOT be used outside X-Wing.
  6. PQ/T, never post-quantum only. A protocol that adds post-quantum key agreement MUST do so as a hybrid of X25519 and ML-KEM. This includes CORE/CAKE.
  7. Ephemeral contribution. The published keys provide no forward secrecy (Section 12.6). Protocols that protect application payload, in particular CAKE and CADET, MUST mix ephemeral key material into their key schedule.

10.1. Private Key Custody

In the GNUnet implementation, no process other than PILS holds the peer's long-term secret or any private key derived from it. PILS exposes operations, not keys:

  • decapsulation under KEM_X25519 or KEM_XWING, labelled with the role of the caller (for example "core", "cadet" or "communicator-udp"), returning a role-bound secret instead of the raw KEM shared secret ss:

    ss_role = HKDF-Expand (HKDF-Extract ("", ss),
                           "gnunet-pils-role-v1:" || role, 32)
    
  • signatures with the identity key, restricted per role to an allow-list of signature purposes and, where possible, over structures that PILS builds itself (as for HELLOs).

Since the decapsulating side only learns ss_role, the encapsulating side MUST apply the same derivation with the same role label. The role derivation is therefore part of the key schedule of every consuming protocol and must be specified there. PILS offers no raw Diffie-Hellman operation and does not sign caller-supplied data under arbitrary purposes.

11. Communicator Parameters in Addresses

The rest of an address belongs to the communicator and is covered by the HELLO signature. Communicators that need per-address parameters SHOULD carry them there, for example as URI query parameters, rather than in new record types. This section describes the intended use by the TLS-based communicators; the communicator specifications are normative for their own parameters.

https://peer.example/?rpk=<Base32GNS(Ed25519 key)>&ech=<base64url(ECH)>
quic://192.0.2.1:4433/?rpk=<Base32GNS(Ed25519 key)>
rpk:
An Ed25519 public key that the server presents as a TLS 1.3 [RFC8446] raw public key [RFC7250]. The HELLO signature authenticates the binding of the peer identity to this key. A client offers and expects the raw_public_key server certificate type and MUST check that the presented key equals rpk. This key MUST NOT be the peer identity key.
ech:
An Encrypted Client Hello configuration [I-D.ietf-tls-esni] for the address. Publishing it in a HELLO signed by the peer is an alternative to the DNS records ECH normally uses.

Derive rpk from the bare address, not from the peer identity. Otherwise a new identity yields a new key, which changes the address, which changes H_ADDRS and therefore the identity again, and the peer never settles. The GNUnet implementation derives:

PRK_rpk = HKDF-Extract (salt = SHA-512 ("https://host:port"), IKM)
rpk_sk  = HKDF-Expand (PRK_rpk, "gnunet-tls-rpk-v1", 32)

where the salt is the address before the parameters are added. PILS holds rpk_sk and signs on the communicator's behalf once per TLS handshake. A TLS stack that cannot delegate signing that way MAY hold rpk_sk itself; that exposes one TLS key for one address, not the peer identity.

12. Security and Privacy Considerations

12.1. Signature Coverage

The signature covers the expiration and every record. This closes the address substitution attack against the deployed previous version, in which any holder of a valid HELLO could redirect connections to arbitrary addresses in DHT validation, hostlists, gossip and manual import.

12.2. Encoding Strictness

In the DHT, a HELLO that one implementation accepts and another rejects is cached and forwarded by some peers and dropped by others. Such parser differentials are the usual way multi-implementation peer-to-peer networks split. CBOR permits several encodings of one value, and most CBOR libraries accept all of them by default. The encoding rules of Section 4.3 leave exactly one valid encoding and require receivers to reject every other. Implementations SHOULD test their decoder against an independent CBOR implementation with differential fuzzing.

Uniqueness of the encoding is also what makes H_RECORDS and the DHT result filter well defined. Otherwise two encodings of the same records would be two different HELLOs, and a peer could evade duplicate suppression by re-encoding.

Decoding work and memory are bounded by the size of the container, the nesting depth limit and the rule against allocating on declared lengths (Section 4.3).

12.3. Freshness and Rollback

Under the derivation of Section 8, the peer identity is a function of IKM and the address set, and the KEM keys are a function of the same inputs. For a fixed peer identity there is thus exactly one valid records map, and two HELLOs of that identity differ only in their expiration. Rolling back to an older address set or an older KEM key cannot be expressed without changing the peer identity, so the format needs no sequence number, and verifiers keep no state.

This argument holds only while the derivation is deterministic (Section 8.4). If KEM keys are ever drawn at random and rotated within one identity (see Section 15), an attacker can pin a peer to an older, unexpired HELLO by withholding the newer one. Within the grace period the handshake then succeeds with previous-generation keys; after it, the handshake fails. A sequence number would not prevent this, since a verifier with a single HELLO has nothing to compare it against. Freshness comes from the DHT lookup.

12.4. Separation of Signing and Key Exchange

In the previous version, the identity key was at once an Ed25519 signing key and, through the birational map, an X25519 key, and the implementation offered a signing operation and a raw Diffie-Hellman operation on it. A signing oracle and a Diffie-Hellman oracle on the same scalar is the hazard noted in [LSD0012]. Publishing independent KEM keys removes the shared scalar. It also removes the Ed25519-to-X25519 conversion of an attacker-supplied peer identity from the connection path.

12.5. One KEM Key for All Protocols

The same KEM_X25519 key is used by several communicators, the transport distance-vector box and CADET. Separation between them rests on each protocol's key derivation context (Section 10, rules 3 and 4) and on the role derivation in PILS (Section 10.1). If one of these constructions is broken so that it leaks the static scalar, rather than a session secret, every other protocol fails with it. This is the price of publishing one key per algorithm instead of one key per protocol.

Per-protocol keys derived by public-key blinding do not avoid this. The blinding factor must be computable from public data so that senders can derive the blinded public key, and any holder of a blinded private key can then recover the master private key by multiplying with the inverse of that factor. Blinding provides public-key unlinkability, which GNS uses it for, but not private key isolation. Independent per-protocol keys would provide isolation, at about 35 bytes per protocol for X25519 and about 1.2 KB per protocol for ML-KEM-768.

KEM_X25519 is deliberately not the X25519 component of KEM_XWING. The security analysis of X-Wing assumes its key is used only by X-Wing, and keeping the keys apart costs 35 bytes.

12.6. No Forward Secrecy at the Long-Term Layer

The published KEM keys are derived from IKM and the public H_ADDRS and are never stored, so they are never deleted. Whoever obtains IKM once can recompute every KEM private key the peer has ever used, for every address set, and decrypt every recorded exchange that relied on those keys alone. Rotating the peer identity does not change that.

The forward secrecy of the system is therefore exactly what the handshake layers contribute through ephemeral key material. This is why Section 10 requires an ephemeral contribution from CAKE and CADET. CAKE's early data is derived from the responder's static key alone and is therefore not forward secret. Link-layer handshakes that encapsulate only to the static key (as the obfuscating communicators currently do) protect their metadata only until IKM is compromised.

12.7. Concentration of Key Material

PILS holds IKM. Compromising it yields the identity and all KEM keys, past and future, for every address set. This is a deliberate trade: one small, audited service with no network-facing parser holds the secret, instead of every communicator process that parses hostile input. An exploited communicator can request decapsulations while it runs, but it cannot exfiltrate a key that remains useful offline.

GNUnet's local IPC does not authenticate clients, so a compromised local process can claim any role. Role labels prevent cross-protocol confusion for honest clients and against remote attackers, not against a compromised local process. Deployments that need role separation against local compromise need operating system mechanisms, such as one socket per role with distinct permissions. Protection of IKM against an attacker who can read the memory of PILS is a non-goal of this design; hardware key storage behind PILS would be the place to add it.

Moving decapsulation into PILS puts an IPC round trip on the inbound key exchange path of the UDP communicator, which an attacker can trigger with unauthenticated datagrams. Such communicators SHOULD apply a cheap precondition, such as a stateless cookie or per-source rate limit, before asking PILS to decapsulate. Otherwise datagram floods can saturate PILS and stop it from signing.

12.8. Obfuscation

A HELLO is public, and the keys in it are published raw. They MUST NOT be encoded with an obfuscating encoding. Kemeleon [I-D.irtf-cfrg-kemeleon] in particular uses secret randomness when encoding, so two encodings of the same key differ. Such a key could not appear in a deterministically encoded, signed object at all, and the determinism of Section 8.4 would be lost. Hybrid obfuscated combiners [GRSV25] provide ciphertext obfuscation, not public key obfuscation, in any case.

Obfuscation is the business of the protocols that put ciphertexts on the wire unprotected, that is, of the first flight of the obfuscating communicators. Elligator there applies to the sender's ephemeral key only. A published static X25519 key needs no encodability property. A HELLO is never sent on that unprotected layer, so its CBOR structure is not visible to an observer of the communicators' first flight.

12.9. Linkability

A peer that returns to an address set it used before obtains the same peer identity and the same KEM keys again. This follows from deriving the identity from the address set and is not introduced by the KEM records. Conversely, the KEM keys change exactly when the identity changes, so they never link two identities of a peer.

The addresses and communicator parameters in a HELLO are public. Communicators SHOULD NOT place data in an address that is more linkable than the address itself.

12.10. Post-Quantum Considerations

A HELLO with a KEM_XWING record allows confidentiality that resists an adversary who records traffic now and has a quantum computer later. The HELLO signature remains Ed25519, which such an adversary can forge. Unlike broken confidentiality, a forgery is useful only once the capability exists and is not retroactive, so the migration of signatures can follow that of key agreement.

Post-quantum signatures cannot be added by a new record type alone, because the peer identity is the Ed25519 public key and a post-quantum verification key does not fit 32 bytes. The likely path is to define the peer identity as a hash of the verification key or keys, carried in a record. Nothing in this version SHOULD add new dependence on the peer identity being a verification key.

12.11. Size

A HELLO with three IPv4 TCP addresses and KEM_X25519 is 205 bytes. With KEM_XWING it is 1425 bytes (Appendix A). This is well below the GNUnet message size limit and the DHT block size limit. Receivers MUST bound the size of HELLOs they accept and store.

The URL form expands binary data by 8/5. Hostlist servers SHOULD serve encoded HELLOs rather than URLs.

13. GANA Considerations

13.1. GNUnet HELLO Record Types

GANA is requested to create a "GNUnet HELLO Record Types" registry. Its entries have the fields Number, Name, Value (the CDDL of the record value), Comment, Contact and References. Numbers range from 1 to 4294967295. Numbers 1 to 65535 are for critical types and 65536 to 4294967295 for optional types (Section 4.2); a registration chooses the range that matches the treatment it requires. Number 0 is reserved. The registration policy is "First Come First Served". The initial entries are:

Number: 1
Name: ADDRESS
Value: [+ tstr]
Comment: The addresses of the peer, in canonical order.
References: [This document]

Number: 2
Name: KEM_X25519
Value: bstr .size 32
Comment: X25519 key encapsulation key. Mandatory.
References: [This document]

Number: 3
Name: KEM_XWING
Value: bstr .size 1216
Comment: X-Wing encapsulation key. Optional.
References: [This document]

13.2. Other Registries

GANA is requested to make the following allocations:

GNUnet DHT Block Types:
DHT_HELLO_V2, "A version 2 HELLO for a peer", referencing this document. Number 28 is suggested.
GNUnet Signature Purposes:
HELLO_V2, "Signature by which a peer affirms its version 2 HELLO", referencing this document. The number is TBD. It MUST NOT be 7 (Section 6).
GNUnet message types:
HELLO_URI_V2 and DHT_P2P_HELLO_V2 (Section 9.2). The numbers are TBD.

14. Migration and Implementation Status

This version is a clean break. There is no compatibility window and no dual publication. Fixing the signature coverage invalidates every existing HELLO signature anyway. At the switch, every peer re-derives its HELLO, previously cached HELLOs become unparseable, and the network re-bootstraps from hostlists.

No implementation of this version exists yet. The planned order of work in the GNUnet implementation is:

  1. Separate the two behaviours currently gated by one undefined compile-time switch: hashing the addresses for the signature (always) and skipping re-derivation for an unchanged address set.
  2. Make PILS the only holder of key material (Section 10.1): remove the raw Diffie-Hellman operation, move CADET to a labelled KEM, remove the APIs that hand out the private identity key, and restrict signature purposes per role.
  3. Implement the format of this document, including the KEM_X25519 record, and move the communicators, the transport distance-vector box, CORE and CADET to that key. This needs a strict CBOR codec in the GNUnet utility library. A HELLO uses only integers, byte and text strings, arrays and maps, so the HELLO decoder can be the first part of that codec. Because this step closes the address substitution of the previous version, it should not wait for the rest of the peer-to-peer control plane to move to CBOR.
  4. Carry raw public keys and ECH configurations in the addresses of the TLS-based communicators (Section 11), and enable the X25519MLKEM768 hybrid group in their TLS libraries.
  5. Publish KEM_XWING and use it in CADET and CORE/CAKE. This requires libsodium 1.0.22 or later, whose generic crypto_kem_* functions implement X-Wing with seed-based key generation. A build without it remains possible and publishes no KEM_XWING record.
  6. Add forward secrecy at the communicator layer: an ephemeral-ephemeral X25519 exchange, then an in-channel X-Wing rekey.
  7. Obfuscated hybrid first flights for the tcp, udp and libp2p communicators (OEINC with Kemeleon). This may need the KEM_MLKEM768 record of Section 5.4.

Steps 1 to 4 need no new cryptographic primitive.

15. Open Issues

16. Normative References

[RFC2119]
Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, DOI 10.17487/RFC2119, , <https://www.rfc-editor.org/info/rfc2119>.
[RFC3986]
Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform Resource Identifier (URI): Generic Syntax", STD 66, RFC 3986, DOI 10.17487/RFC3986, , <https://www.rfc-editor.org/info/rfc3986>.
[RFC5234]
Crocker, D., Ed. and P. Overell, "Augmented BNF for Syntax Specifications: ABNF", STD 68, RFC 5234, DOI 10.17487/RFC5234, , <https://www.rfc-editor.org/info/rfc5234>.
[RFC5869]
Krawczyk, H. and P. Eronen, "HMAC-based Extract-and-Expand Key Derivation Function (HKDF)", RFC 5869, DOI 10.17487/RFC5869, , <https://www.rfc-editor.org/info/rfc5869>.
[RFC6234]
Eastlake 3rd, D. and T. Hansen, "US Secure Hash Algorithms (SHA and SHA-based HMAC and HKDF)", RFC 6234, DOI 10.17487/RFC6234, , <https://www.rfc-editor.org/info/rfc6234>.
[RFC7748]
Langley, A., Hamburg, M., and S. Turner, "Elliptic Curves for Security", RFC 7748, DOI 10.17487/RFC7748, , <https://www.rfc-editor.org/info/rfc7748>.
[RFC8032]
Josefsson, S. and I. Liusvaara, "Edwards-Curve Digital Signature Algorithm (EdDSA)", RFC 8032, DOI 10.17487/RFC8032, , <https://www.rfc-editor.org/info/rfc8032>.
[RFC8174]
Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, , <https://www.rfc-editor.org/info/rfc8174>.
[RFC8610]
Birkholz, H., Vigano, C., and C. Bormann, "Concise Data Definition Language (CDDL): A Notational Convention to Express Concise Binary Object Representation (CBOR) and JSON Data Structures", RFC 8610, DOI 10.17487/RFC8610, , <https://www.rfc-editor.org/info/rfc8610>.
[RFC8949]
Bormann, C. and P. Hoffman, "Concise Binary Object Representation (CBOR)", STD 94, RFC 8949, DOI 10.17487/RFC8949, , <https://www.rfc-editor.org/info/rfc8949>.
[RFC9498]
Schanzenbach, M., Grothoff, C., and B. Fix, "The GNU Name System", RFC 9498, DOI 10.17487/RFC9498, , <https://www.rfc-editor.org/info/rfc9498>.
[I-D.connolly-cfrg-xwing-kem]
Connolly, D., Schwabe, P., and B. Westerbaan, "X-Wing: general-purpose hybrid post-quantum KEM", Work in Progress, Internet-Draft, draft-connolly-cfrg-xwing-kem-11, , <https://datatracker.ietf.org/doc/html/draft-connolly-cfrg-xwing-kem-11>.
[FIPS203]
National Institute of Standards and Technology, "Module-Lattice-Based Key-Encapsulation Mechanism Standard", FIPS 203, DOI 10.6028/NIST.FIPS.203, , <https://doi.org/10.6028/NIST.FIPS.203>.
[LSD0004]
Schanzenbach, M., Grothoff, C., and B. Fix, "The R5N Distributed Hash Table", Work in Progress, Internet-Draft, draft-schanzen-r5n-07, , <https://lsd.gnunet.org/lsd0004>.

17. Informative References

[RFC7250]
Wouters, P., Ed., Tschofenig, H., Ed., Gilmore, J., Weiler, S., and T. Kivinen, "Using Raw Public Keys in Transport Layer Security (TLS) and Datagram Transport Layer Security (DTLS)", RFC 7250, DOI 10.17487/RFC7250, , <https://www.rfc-editor.org/info/rfc7250>.
[RFC8446]
Rescorla, E., "The Transport Layer Security (TLS) Protocol Version 1.3", RFC 8446, DOI 10.17487/RFC8446, , <https://www.rfc-editor.org/info/rfc8446>.
[RFC9180]
Barnes, R., Bhargavan, K., Lipp, B., and C. Wood, "Hybrid Public Key Encryption", RFC 9180, DOI 10.17487/RFC9180, , <https://www.rfc-editor.org/info/rfc9180>.
[I-D.ietf-tls-esni]
Rescorla, E., Oku, K., Sullivan, N., and C. A. Wood, "TLS Encrypted Client Hello", Work in Progress, Internet-Draft, draft-ietf-tls-esni-25, , <https://datatracker.ietf.org/doc/html/draft-ietf-tls-esni-25>.
[I-D.irtf-cfrg-kemeleon]
Günther, F., Stebila, D., and S. Veitch, "Kemeleon Encodings", Work in Progress, Internet-Draft, draft-irtf-cfrg-kemeleon-02, , <https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-kemeleon-02>.
[LSD0011]
Schanzenbach, M. and P. Fardzadeh, "The HPKE Elligator KEM", , <https://lsd.gnunet.org/lsd0011>.
[LSD0012]
Schanzenbach, M. and ch3, "CORE Authenticated Key Exchange (CAKE)", Work in Progress, Internet-Draft, draft-schanzen-cake-00, , <https://lsd.gnunet.org/lsd0012>.
[GRSV25]
Günther, F., Rosenberg, M., Stebila, D., and S. Veitch, "Hybrid Obfuscated Key Exchange and KEMs", IACR ePrint 2025/408, , <https://eprint.iacr.org/2025/408>.

Appendix A. Size Budget

For a peer with three IPv4 TCP addresses of the form tcp://1.2.3.4:1234 (18 bytes each), as in Figure 3:

Table 3: HELLO Sizes in Bytes.
Element Previous version Version 2
pid, signature, expiration 104 1 + 34 + 66 + 9 = 110
Records map head - 1
3 addresses 3 x 19 = 57 1 + 1 + 3 x 19 = 59
KEM_X25519 - 1 + 2 + 32 = 35
Total, traditional only 161 205
KEM_XWING - 1 + 3 + 1216 = 1220
Total, PQ/T - 1425

The corresponding URL (Figure 7) has 2259 characters: 188 for scheme, peer identity, signature and a 16-digit expiration; 5 separators; 54 for the three address parameters; 58 for _2; and 1954 for _3 (Base32GNS of the 1219-byte encoded value is 1951 characters). This fits a version 40 QR code with low error correction in byte mode (2953 bytes). A post-quantum signature would not fit.

Appendix B. Changes from the Previous Version

Table 4: Differences to the HELLO of LSD0004.
Aspect Previous version Version 2
Encoding packed binary deterministic CBOR
Payload NUL-terminated address strings records map keyed by type number
Signed hash H_ADDRS (in practice SHA-512 of the empty string) H_RECORDS over the encoded records map
Signature purpose 7 (HELLO) HELLO_V2 (new)
Key exchange key peer identity, mapped to X25519 KEM_X25519 and KEM_XWING records
Post-quantum none X-Wing (optional)
Extensibility none record types; criticality by type number
Address order strcmp by encoding: shorter first, then bytewise
Message bodies reserved field and address count before the payload exactly the encoded HELLO
DHT HelloMessage without peer identity complete HELLO
DHT block type 13 (DHT_HELLO) DHT_HELLO_V2 (new)
URL addresses only; no address-less URLs "_<type>" parameters for other records; "?" optional

Appendix C. Test Vectors

TBD. Test vectors will be added once the GANA numbers are allocated and the implementation exists. They will cover the derivation of Section 8 from a fixed IKM and address set, the resulting HELLO in diagnostic notation and hex, H_ADDRS, H_RECORDS, the signature and the URL.

Author's Address

GNUnet e.V.
Germany