Back to Site
Loading...
Searching...
No Matches
peer_id.h File Reference

Self-certifying peer identity. More...

#include "core/bytes.h"
#include <array>
#include <cstdint>
#include <optional>
#include <string>
#include <string_view>
Include dependency graph for peer_id.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  librats::PeerId
 
struct  librats::PeerId::Hash
 Hash functor for use as an unordered_map/set key. More...
 

Namespaces

namespace  librats
 

Detailed Description

Self-certifying peer identity.

A PeerId is the SHA-256 of a peer's static (Noise) public key. Because the Noise XX handshake proves possession of that key, a completed handshake also proves the remote's PeerId — identity is cryptographically bound to the key and cannot be forged (libp2p uses the same self-certifying scheme).

This is a value type: cheap to copy, hashable, and ordered, so it slots straight into unordered_map / set as a key.

Definition in file peer_id.h.