Abstract Datagram Network Layer
The Abstract Datagram Network Layer (ADNL) is the core networking protocol of the TON network. It is a peer-to-peer, unreliable datagram protocol that operates over both UDP and TCP.
Higher-level protocols such as Reliable Large Datagram Protocol (RLDP) and the distributed hash table (DHT) are built on top of ADNL.
ADNL address
Each participant in the network has a 256-bit ADNL address. ADNL allows sending and receiving datagrams using only these addresses, hiding the underlying IP addresses and ports.
An ADNL address is derived as:
address = SHA-256(type_id || public_key)The hash input is the complete boxed TL serialization of the public key, and the type_id is a uint32 constructor ID serialized in little-endian order. For example, the Ed25519 public-key constructor has numeric ID 0x4813b4c6, so its wire bytes are c6 b4 13 48 followed by the 32-byte public key. The corresponding private key must be known to receive and decrypt messages sent to a given address.
Key format conversion
ADNL generates, stores, and transmits Ed25519 keys over the network. For the X25519 key agreement, TON internally converts the Ed25519 public key to a Montgomery public coordinate and derives an X25519 scalar from the Ed25519 private seed. Do not generate an unrelated X25519 key pair and relabel it as Ed25519.
Peer identity
Each peer must have at least one identity. A peer may have multiple identities, but this is not required. Each identity consists of a key pair used for Diffie-Hellman key exchange between peers.
Neighbor tables
A TON ADNL node maintains a neighbor table with information about known nodes, including their abstract addresses, public keys, IP addresses, and UDP ports. The node updates this table over time as it discovers new peers from query responses and removes outdated entries.
Address lists can advertise IPv4 UDP, IPv6 UDP, ADNL tunnel, reverse-connectivity, and IPv4 QUIC endpoints. Each list also carries version, reinit_date, priority, and expire_at fields. The version fields let peers omit address lists that the receiver has already observed.
P2P protocol (ADNL over UDP)
ADNL over UDP is used by TON nodes to communicate with each other. Communication begins simultaneously with the first data exchange: the initiator sends a create-channel message and the peer confirms creation. Encryption keys for the channel are derived through Elliptic-curve Diffie-Hellman (ECDH) from the peers' channel keys.
UDP packets sent outside a channel are encrypted to the destination identity and signed by the source identity. After channel establishment, peers use directional symmetric keys and omit the per-packet signature.
Sequence numbers suppress duplicate and old packets, while acknowledgments report the highest accepted sequence number. ADNL does not retransmit missing datagrams. Protocols that require reliable or larger transfers use a higher-level protocol such as RLDP.
See ADNL UDP for channel establishment, packet structure, and message types.
Client-server protocol (ADNL over TCP)
ADNL over TCP is used by clients to communicate with liteservers. The client generates random AES-CTR session parameters and encrypts them to the server identity with a fresh ephemeral key. After the exchange, both sides use two AES-CTR cipher states to encrypt framed messages with SHA-256 integrity checks. The liteserver then authenticates the client's independently generated Ed25519 identity over the encrypted connection.
See ADNL TCP for the full handshake flow, packet structure, liteserver query examples, and security considerations.