Skip to main content

Module types

Module types 

Source
Expand description

§Core 32-byte newtypes and cryptographic primitive wrappers

The “nouns” of the hashiverse protocol. Every one of these is a transparent newtype over a fixed-size byte array or an underlying crypto library type, so that function signatures throughout the crate can encode their intent in the type system rather than relying on correctly-named [u8; 32] parameters.

§Addressing

  • Id — 32-byte opaque identifier used pervasively (peer IDs, client IDs, post IDs, bucket location IDs, Kademlia keys). Ordered by natural byte comparison so it plays well with XOR-distance routing.
  • Hash — 32-byte Blake3 digest. Structurally equivalent to Id but semantically distinct — “a hash of something” vs “a handle to something”.

§Cryptography

§Proof-of-work

  • Pow — a leading-zero-bit count, effectively a difficulty level.
  • Salt — the random bytes searched over during PoW.

Every type exposes from_hex_str / to_hex_str, from_slice, and from_buf constructors so they can be produced from URLs, wire bytes, or bytes::Buf streams with consistent error handling.

Structs§

BucketKey
Hash
A 32-byte cryptographic hash, the standard hash output throughout the protocol.
Id
A 32-byte opaque identifier used pervasively throughout the protocol.
PQCommitmentBytes
Pow
A proof-of-work difficulty level, expressed as the number of leading zero bits required on the PoW hash output.
Salt
An 8-byte nonce used to vary the input of a proof-of-work search.
Signature
A 64-byte Ed25519 signature.
SignatureKey
A private Ed25519 signing key held by a single client identity.
SignatureKeyBytes
VerificationKey
VerificationKeyBytes

Constants§

HASH_BYTES
ID_BYTES
PQ_COMMITMENT_BYTES
SALT_BYTES
SIGNATURE_BYTES
SIGNATURE_KEY_BYTES
VERIFICATION_KEY_BYTES