As has already been noted, every document is indexed by a key. But Freenet has more than one type of key—each with certain advantages and disadvantages.
Since individual nodes on Freenet are inherently untrusted, nodes must not be allowed to return false documents. Otherwise, those false documents will be cached and the false data will spread like a cancer. The main job of the key types is to prevent this cancer. Each node in a chain checks that the document is valid before forwarding it back toward the requester. If it finds that the document is invalid, it stops accepting traffic from the bad node and restarts the request.
Every key can be treated as an array of bytes, no matter which type it is. This is important because the closeness function, and thus the routing, treats them as equivalent. These functions are thus independent of key type.
Freenet defines a general Uniform Resource Indicator (URI) in the form:
where binary data is encoded using a slightly changed Base64 scheme.
Each key type has its own interpretation of the
data part of the URI, which is explained with
the key type.
Documents can contain metadata that redirects clients to another key. In this way, keys can be chained to provide the advantages of more than one key type. The rest of this section describes the various types of keys.
A CHK is formed from a hash of the data. A hash function takes any input and produces a fixed-length output, where finding ...