validate_multi_author_message_hash_chain

Function validate_multi_author_message_hash_chain 

Source
pub fn validate_multi_author_message_hash_chain<T: AsRef<[u8]>>(
    message_bytes: T,
) -> Result<()>
Expand description

Validate an out-of-order message without checking the author.

It expects the messages to be the JSON encoded message of shape: {key: "", value: {...}}

This checks that:

  • the actual hash matches the hash claimed in key
  • the message contains the correct fields
  • the message value fields are in the correct order
  • there are no unexpected top-level fields in the message
  • the hash signature is defined as sha256
  • the message content string is canonical base64

This does not check:

  • the signature (see ssb-verify-signatures which lets you to batch verification of signatures)
  • the previous message
    • no check of the sequence to ensure it increments by 1 compared to previous
    • no check that the actual hash of the previous message matches the hash claimed in previous
    • no check that the author has not changed