rlpx¶
Namespaces¶
| Name |
|---|
| rlpx::auth |
| rlpx::crypto |
| rlpx::framing |
| rlpx::protocol |
| rlpx::socket |
| rlpx::detail |
Classes¶
| Name | |
|---|---|
| struct | rlpx::SessionConnectParams |
| struct | rlpx::SessionAcceptParams |
| struct | rlpx::PeerInfo |
| class | rlpx::RlpxSession RLPx session managing encrypted P2P communication. |
| struct | rlpx::AesBlock RLPx wire structs — sizes are derived via sizeof() rather than magic numbers. |
| struct | rlpx::MacDigestWire 16-byte frame-level MAC digest (first 16 bytes of the running Keccak state). |
| struct | rlpx::FrameHeaderWire 16-byte RLPx frame header: 3-byte length |
Types¶
| Name | |
|---|---|
| enum class | SessionError |
| enum class | AuthError |
| enum class | FramingError |
| enum class | CryptoError |
| enum class uint8_t | SessionState |
| enum class uint8_t | DisconnectReason |
| using asio::ip::tcp | tcp |
| template <typename T > using outcome::result< T, SessionError, outcome::policy::all_narrow > |
Result |
| template <typename T > using outcome::result< T, AuthError, outcome::policy::all_narrow > |
AuthResult |
| template <typename T > using outcome::result< T, FramingError, outcome::policy::all_narrow > |
FramingResult |
| template <typename T > using outcome::result< T, CryptoError, outcome::policy::all_narrow > |
CryptoResult |
| using outcome::result< void, SessionError, outcome::policy::all_narrow > | VoidResult |
| using outcome::result< void, AuthError, outcome::policy::all_narrow > | AuthVoidResult |
| using outcome::result< void, FramingError, outcome::policy::all_narrow > | FramingVoidResult |
| using outcome::result< void, CryptoError, outcome::policy::all_narrow > | CryptoVoidResult |
| using std::function< void(const protocol::Message &)> | MessageHandler |
| using std::function< void(const protocol::HelloMessage &)> | HelloHandler |
| using std::function< void(const protocol::DisconnectMessage &)> | DisconnectHandler |
| using std::function< void(const protocol::PingMessage &)> | PingHandler |
| using std::function< void(const protocol::PongMessage &)> | PongHandler |
| using std::array< uint8_t, kPublicKeySize > | PublicKey |
| using std::array< uint8_t, kPrivateKeySize > | PrivateKey |
| using std::array< uint8_t, kNonceSize > | Nonce |
| using std::array< uint8_t, kSharedSecretSize > | SharedSecret |
| using std::array< uint8_t, kAesKeySize > | AesKey |
| using std::array< uint8_t, kMacKeySize > | MacKey |
| using std::array< uint8_t, kMacSize > | MacDigest |
| using std::array< uint8_t, kFrameHeaderSize > | FrameHeader |
| using std::vector< uint8_t > | ByteBuffer |
| using gsl::span< const uint8_t > | ByteView |
| using gsl::span< uint8_t > | MutableByteView |
Functions¶
| Name | |
|---|---|
| const char * | to_string(SessionError error) |
| const char * | to_string(AuthError error) |
| const char * | to_string(FramingError error) |
| const char * | to_string(CryptoError error) |
Attributes¶
Types Documentation¶
enum SessionError¶
| Enumerator | Value | Description |
|---|---|---|
| kNetworkFailure | ||
| kAuthenticationFailed | ||
| kHandshakeFailed | ||
| kInvalidState | ||
| kPeerDisconnected | ||
| kTimeout | ||
| kCompressionError | ||
| kEncryptionError | ||
| kDecryptionError | ||
| kInvalidMessage | ||
| kInvalidFrameSize | ||
| kBufferOverflow | ||
| kConnectionFailed | ||
| kNotConnected | ||
| kDisconnected |
enum AuthError¶
| Enumerator | Value | Description |
|---|---|---|
| kEciesEncryptFailed | ||
| kEciesDecryptFailed | ||
| kInvalidAuthMessage | ||
| kInvalidAckMessage | ||
| kSharedSecretFailed | ||
| kSignatureInvalid | ||
| kKeyDerivationFailed | ||
| kInvalidPublicKey | ||
| kInvalidNonce |
enum FramingError¶
| Enumerator | Value | Description |
|---|---|---|
| kEncryptionFailed | ||
| kDecryptionFailed | ||
| kMacMismatch | ||
| kInvalidFrameSize | ||
| kBufferTooSmall | ||
| kInvalidHeader | ||
| kCompressionFailed | ||
| kDecompressionFailed |
enum CryptoError¶
| Enumerator | Value | Description |
|---|---|---|
| kAesEncryptFailed | ||
| kAesDecryptFailed | ||
| kHmacFailed | ||
| kKdfFailed | ||
| kEcdhFailed | ||
| kInvalidKeySize | ||
| kInvalidIvSize | ||
| kInvalidPublicKey | ||
| kInvalidPrivateKey | ||
| kOpenSslError | ||
| kSecp256k1Error |
enum SessionState¶
| Enumerator | Value | Description |
|---|---|---|
| kUninitialized | 0 | |
| kConnecting | ||
| kAuthenticating | ||
| kHandshaking | ||
| kActive | ||
| kDisconnecting | ||
| kClosed | ||
| kError |
enum DisconnectReason¶
| Enumerator | Value | Description |
|---|---|---|
| kRequested | 0x00 | |
| kTcpError | 0x01 | |
| kProtocolError | 0x02 | |
| kUselessPeer | 0x03 | |
| kTooManyPeers | 0x04 | |
| kAlreadyConnected | 0x05 | |
| kIncompatibleVersion | 0x06 | |
| kInvalidIdentity | 0x07 | |
| kClientQuitting | 0x08 | |
| kUnexpectedIdentity | 0x09 | |
| kSelfConnection | 0x0A | |
| kTimeout | 0x0B | |
| kSubprotocolError | 0x10 |
using tcp¶
using Result¶
template <typename T >
using rlpx::Result = outcome::result<T, SessionError, outcome::policy::all_narrow>;
using AuthResult¶
template <typename T >
using rlpx::AuthResult = outcome::result<T, AuthError, outcome::policy::all_narrow>;
using FramingResult¶
template <typename T >
using rlpx::FramingResult = outcome::result<T, FramingError, outcome::policy::all_narrow>;
using CryptoResult¶
template <typename T >
using rlpx::CryptoResult = outcome::result<T, CryptoError, outcome::policy::all_narrow>;
using VoidResult¶
using AuthVoidResult¶
using FramingVoidResult¶
using CryptoVoidResult¶
using MessageHandler¶
using HelloHandler¶
using DisconnectHandler¶
using PingHandler¶
using PongHandler¶
using PublicKey¶
using PrivateKey¶
using Nonce¶
using SharedSecret¶
using AesKey¶
using MacKey¶
using MacDigest¶
using FrameHeader¶
using ByteBuffer¶
using ByteView¶
using MutableByteView¶
Functions Documentation¶
function to_string¶
function to_string¶
function to_string¶
function to_string¶
Attributes Documentation¶
variable kPublicKeySize¶
variable kPrivateKeySize¶
variable kNonceSize¶
variable kSharedSecretSize¶
variable kAesKeySize¶
variable kMacKeySize¶
variable kUncompressedPubKeyPrefixSize¶
Uncompressed secp256k1 public key: 0x04 prefix byte + 64 bytes = 65 bytes total.
The single 0x04 prefix byte
variable kUncompressedPubKeySize¶
variable kUncompressedPubKeyPrefix¶
variable kHmacSha256Size¶
HMAC-SHA256 full digest output size.
variable kAesBlockSize¶
variable kMacSize¶
variable kFrameHeaderSize¶
variable kEciesMacSize¶
ECIES / EIP-8 wire constants.
variable kEciesOverheadSize¶
variable kEip8LengthPrefixSize¶
variable kEip8AuthPaddingSize¶
variable kMaxEip8HandshakePacketSize¶
variable kFrameLengthSize¶
Number of bytes used to encode the frame length inside the frame header.
variable kFrameHeaderDataOffset¶
variable kFrameHeaderWithMacSize¶
variable kFramePaddingAlignment¶
variable kFrameLengthMsbOffset¶
variable kFrameLengthMiddleOffset¶
variable kFrameLengthLsbOffset¶
variable kFrameLengthMsbShift¶
variable kFrameLengthMiddleShift¶
variable kFrameLengthLsbShift¶
variable kFrameHeaderStaticRlpBytes¶
variable kEcdsaCompactSigSize¶
RLPx auth message wire constants Recoverable ECDSA compact signature: 64 bytes data + 1 byte recovery id.
variable kEcdsaRecoveryIdSize¶
variable kEcdsaSigSize¶
variable kAuthVersionSize¶
Version byte appended to auth/ack messages (RLPx v4 EIP-8).
variable kAuthVersion¶
variable kMaxFrameSizeMiB¶
Maximum RLPx frame payload: 16 MiB.
variable kMaxFrameSize¶
variable kHelloMessageId¶
variable kDisconnectMessageId¶
variable kPingMessageId¶
variable kPongMessageId¶
variable kProtocolVersion¶
variable kTcpConnectionTimeout¶
variable kSendLoopPollInterval¶
Updated on 2026-04-13 at 23:22:46 -0700