Each node maintains an ordered list of the resources it publishes, as well as all resources published by any trusted node. This ordered list is called the journal. It is unique per node, and is the thing that is kept synchronized between nodes.
An example journal is available here.
Journal Entries
The first line of the node journal is always the key fingerprint of the node, and each following line of the node journal is constructed by concatenating:
- the journal line identifier, then
- a single
@
character, then - the key fingerprint of the node publishing the resource, then
- a single forward slash character (
/
), then - the resource identifier of the resource being published.
View example journal entries here.
Journal Line Identifier
Except for the very first entry of the journal, the journal line identifier is the hash of the previous line's characters, excluding any newline characters, whose octets are unpadded base64url encoded.
When to Write
The node writes to its own journal under the following circumstances:
- When the node creates a new resource, it appends a new entry to its journal for that resource.
- Whenever the node receives a resource published by a connection, it appends a new entry to its own journal for that resource.
The ordering of the journal is by knowledge of the resource, not by clock time of resource publication.
For example, if a node receives notice of a published resource several days after the publication, the resource identifier for that resource is still added to the end of the journal.
A node should not write to the journal until it has received the resource, and verified its signature.
First Three Entries
The first line of the journal must be the key fingerprint of the node.
The second line of the journal must be calculated using the resource identifier of theidentity resource of the user authorizing the node.
The third line of the journal must be calculated the resource identifier of the trust resource authorizing the node on behalf of some user.
Example Journal
For a user with a key fingerprint of:
GlvAreTo0lCSyum7Wzh8pzhxYOOu-gMIgO2N95AAwAGP6-nR8xCvWvIW0t9rF_ZZfpCY_fDV38JDFKaOU91A8Q
And a node with a key fingerprint of:
0lCSyum7GlvAreToWzh8pzhxgO2N95AAYOOu-gMIwAGP6-nR0t9rF_ZZ8xCvWvIWfpCY_fDVU91A8Q38JDFKaO
And the resource identifier of the trust resource authorizing the node is:
QqsKcr29oKYsY8a4-asK5NT7dQXQ1_BG1b4MbvdXDPLM786YMlrFJdxQy8M2kjzCqzm3tvzQeQptEr_u-fkX_g
If the node then publishes two resources from that user, and those resource identifiers were:
reTo0GlvAlCSyzh8pum7WzhxYgMIgOOu-O2N9AGP65AAw-nR8vIW0xCvWt9rFpCY__ZZffDVJOU91DFKaA8Q38
vAlCSyzreTo0Glh8pum7WgOOu-O2zhxYgMIN9AGP65vIW0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