Concept: Chain
Purpose: To provide an auditable and validatable log of all posted items, using hashes and timestamps to ensure integrity and prevent tampering.
State: A chain is a linked list of items, where each item contains the following fields:
Hash of the item
Timestamp
Hash of the current line with the previous line (checksum)
Actions:
Add item to chain: Adds an item hash and timestamp to the chain.
Get item from chain: Retrieves an item’s timestamp from the chain by its hash.
Get all items from chain: Retrieves all items from the chain as sequence-hash-timestamp tuples.
Operational Principle:
A chain is a linked list of items, where each item contains a hash of the previous item in the list, as well as a timestamp and a checksum of the current line with the previous line.
To add an item to the chain, the hash of the previous item in the list is calculated and stored in the new item. The timestamp and checksum are also calculated and stored in the new item. The new item is then added to the end of the list.
To retrieve an item from the chain, the hash of the item is used to find the item in the list.
To retrieve all items from the chain, the list is traversed from beginning to end.
Example:
A new item is posted to the system. The hash of the item, the timestamp, and the checksum are calculated and stored in the item. The item is then added to the end of the chain.
To verify the authenticity of an item, the hash of the item is calculated and compared to the hash of the item in the chain. The timestamp and checksum are also verified. If the hash, timestamp, and checksum all match, then the item is authentic.
Benefits of the chain concept:
Chains provide an auditable and validatable log of all posted items.
Chains can be used to detect and prevent tampering with posted items.
Chains can be used to implement a variety of features, such as version control and content provenance.