Module strict_encoding::net[][src]

Expand description

Network addresses uniform encoding (LNPBP-42).

Implementation of network address uniform encoding standard (LMPBP-42), which allows representation of any kind of network address as a fixed-size byte string occupying 37 bytes. This standard is used for the strict encoding of networking addresses.

Currently supported networking address protocols (see AddrFormat):

  • IPv4 and IPv6
  • Tor, both ONION v2 and v3 addresses
  • Lightning peer network addresses (Secp256k1 public keys) This list may be extended with future LNPBP-42 revisions

Currently supported transport protocols (see Transport):

  • TCP
  • UDP
  • MTCP (multi-path TCP)
  • QUIC (more efficient UDP version) This list may be extended with future LNPBP-42 revisions

Structs

UniformAddr

Structured uniform address representation, consisting of host address, (conforming a given address format) optional port and optional transport protocol

Enums

AddrFormat

Format of the host address

DecodeError

Uniform ecoding error types

Transport

Supported transport protocols

Constants

ADDR_LEN

Standard length of the host-specific part of the encoding, in bytes

UNIFORM_LEN

Standard length for the whole uniformly-encoded address data, including host and protocol parts.

Traits

Uniform

Uniform encoding trait, which should be implemented by different address structures which allow representation as UniformAddr and encoding to RawUniformAddr.

Type Definitions

RawAddr

Type representing host-specific address part

RawUniformAddr

Type representing whole uniformly-encoded address, with all host and protocol-specific parts put together