pub struct Peer {
pub id: Id,
pub verification_key_bytes: VerificationKeyBytes,
pub pq_commitment_bytes: PQCommitmentBytes,
pub pow_initial: PeerPow,
pub pow_current_day: PeerPow,
pub pow_current_month: PeerPow,
pub version: String,
pub address: String,
pub timestamp: TimeMillis,
pub signature: Signature,
}Expand description
A single node’s self-signed identity record, gossiped through the Kademlia DHT.
Peer is the unit of peer discovery. Each server publishes one: its Id, its Ed25519
verification key, its post-quantum commitment, its current network address, its build
version, and three PeerPow tokens — one fixed “initial” PoW that was produced at
startup and never changes (so it acts as a long-term identity credential), plus rolling
“best seen this day” and “best seen this month” PoWs that keep the record fresh and let
other peers weight trust by recent work. The whole thing is covered by a signature
so tampering is detectable.
Other peers store, forward, and compare Peer records to decide who to talk to, which
is why the PoW fields have time decay built in (pow_decayed_day, pow_decayed_month)
— stale records age out naturally.
Fields§
§id: Id§verification_key_bytes: VerificationKeyBytes§pq_commitment_bytes: PQCommitmentBytes§pow_initial: PeerPow§pow_current_day: PeerPow§pow_current_month: PeerPow§version: String§address: String§timestamp: TimeMillis§signature: SignatureImplementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Peer
impl<'de> Deserialize<'de> for Peer
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl StructuralPartialEq for Peer
Auto Trait Implementations§
impl Freeze for Peer
impl RefUnwindSafe for Peer
impl Send for Peer
impl Sync for Peer
impl Unpin for Peer
impl UnsafeUnpin for Peer
impl UnwindSafe for Peer
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.