Announcement Validation

DSNP Announcements are validated differently depending on the type of Announcement. Batched Announcements are off chain and MUST be validated at read time. Non-batched Announcements (e.g. Graph Change) are on chain, are validated at write time, and do not need to be re-validated at read time.

On-chain Announcements

Creation of an Announcement as an on-chain Frequency Message requires that the delegation be validated before adding the message to the chain. Thus, any Graph Change Announcements read from a trusted node, can be trusted to have been made by the DSNP identity or a delegate of the identity at the time the Frequency Message was sent.

On-Chain Announcement Types

  • Graph Change

Batch Publication Announcements

DSNP Announcements that are in a Batch Publication MUST be validated at read time.

Batched Announcement Types

  • Tombstone
  • Broadcast
  • Reply
  • Reaction
  • Profile

Batch Publication Frequency Message Validation

The Frequency Message for a Batch Publication has several important fields for validation:

provider_msa_idMSA Id of the provider sending the message
cidThe Content IDentifier v1 for IPFS content
payload_lengthExpected length of the content from IPFS
block_numberBlock number that the message was recorded on the chain.

File Validation

  1. Retrieve the file from the IPFS network using the cid.
  2. Verify the file hash by comparing it to the hash included in the cid. (Required for non-trusted IPFS nodes.)
  3. Verify that the byte length of the retrieved file matches the payload_length.

Publication Announcements Validation

  1. Collect the unique set of fromId values.
  2. Use the Custom RPC msa_checkDelegations with the fromId values as the delegator_msa_ids and the provider_msa_id at the block_number.
  3. The fromId values that msa_checkDelegations verifies as having a delegation at block_number are valid Announcements.

Announcement Duplicates

Duplicate Announcements MUST be rejected or ignored.