[][src]Crate ssb_validate

Verify Secure Scuttlebutt (SSB) hash chains (in parallel)

Secure Scuttlebutt "feeds" are a sequence of messages published by one author. To be a valid message,

  • each message must include the hash of the preceding message
  • the sequence number must be one larger than sequence of the preceding message
  • the author must not change compared to the preceding message
  • If it's the first message in a feed, the sequence must be 1 and the previous must be null.
  • If the message includes the key, it must be that hash of the value of the message..

You can check messages one by one or batch process a collection of them (uses rayon internally)

Benchmarks

Benchmarking on a 2016 2 core i5 shows that batch processing is ~1.6 times faster than processing one at a time.

Benchmarking on Android on a One Plus 5T (8 core arm64) shows that batch processing is ~3.3 times faster.

Enums

Error

Functions

par_validate_message_hash_chain_of_feed

Batch validates a collection of messages, all by the same author, ordered by ascending sequence number, with no missing messages.

par_validate_message_value_hash_chain_of_feed

Batch validates a collection of message values, all by the same author, ordered by ascending sequence number, with no missing messages.

validate_message_hash_chain

Check that a message is a valid message relative to the previous message.

validate_message_value_hash_chain

Check that a message is a valid message relative to the previous message.