Module hdk::chain

source ·
Expand description

Tools to interrogate source chains.

Interacting with a source chain is very different to the DHT.

  • Source chains have a linear history guaranteed by action hashes
  • Source chains have a single owner/author signing every chain record
  • Source chains can be iterated over from most recent back to genesis by following the action hashes as references
  • Source chains contain interspersed system and application entries
  • Source chains contain both private (local only) and public (broadcast to DHT) records

There is a small DSL provided by query that allows for inspecting the current agent’s local source chain. Typically it will be faster, more direct and efficient to query local data than dial out to the network. It is also possible to query local private entries.

Agent activity for any other agent on the network can be fetched. The agent activity is only the actions of the remote agent’s source chain. Agent activity allows efficient building of the history of an agent. Agent activity is retrieved from a dedicated neighbourhood near the agent. The agent’s neighbourhood also maintains a passive security net that guards against attempted chain forks and/or rollbacks. The same query DSL for local chain queries is used to filter remote agent activity actions.


Query the actions of a remote agent’s chain.
The chain this filter produces on the given agents chain must be fetched before the validation can be completed. This allows for deterministic validation of chain activity by making a hash bounded range of an agents chain into a dependency for something that is being validated.
Walks the source chain in ascending order (oldest to latest) filtering by action and/or entry type