Module authority

Module authority 

Source
Expand description

Directory authority parsing for Tor network status documents.

This module provides parsing for directory authority entries found in v3 network status documents (votes and consensus). Directory authorities are special relays that are hardcoded into Tor and are responsible for voting on the state of the network and producing the consensus document.

§Overview

Directory authorities perform several critical functions in the Tor network:

  • Voting: Each authority periodically publishes a vote describing which relays it believes are in the network and their properties (flags, bandwidth, etc.)
  • Consensus Generation: Authorities exchange votes and produce a consensus document that represents the agreed-upon state of the network
  • Shared Randomness: Authorities participate in a distributed random number generation protocol used for hidden service directory assignment

§Document Types

Authority entries appear differently in votes versus consensus documents:

  • In Votes: Include the authority’s key certificate for signature verification
  • In Consensus: Include a vote-digest referencing the authority’s vote

§Example

use stem_rs::descriptor::authority::DirectoryAuthority;

let content = r#"dir-source moria1 D586D18309DED4CD6D57C18FDB97EFA96D330566 128.31.0.39 128.31.0.39 9131 9101
contact 1024D/28988BF5 arma mit edu
vote-digest 49015F787433103580E3B66A1707A00E60F2D15B
"#;

let authority = DirectoryAuthority::parse(content, false).unwrap();
assert_eq!(authority.nickname, "moria1");
assert_eq!(authority.or_port, 9101);

§See Also

Structs§

DirectoryAuthority
A directory authority entry from a network status document.
SharedRandomnessCommitment
A commitment to a shared random value from a directory authority.