jbenet/go-ipfs — pull request #296 by whyrusleeping (2014-11-12 02:03:39+00:00)
Title: Ipns Consistency

This PR changes the DHT so that it stores records instead of simple values. This allows us to add a layer of security onto the DHT, and also allows us to validate values that are stored in it.

Currently, only two value types are allows to be stored in the DHT:

- Public Keys
- Public keys are verified by checking their hash against the key.
- [relevant code](https://github.com/jbenet/go-ipfs/blob/consistency/routing/dht/records.go#L99)
- Ipns Records
- Ipns records are verified by unmarshalling them, checking their validity type, and then performing the proper validity checks from there
- [relevant code](https://github.com/jbenet/go-ipfs/blob/consistency/namesys/publisher.go#L110)

Other types of Ipns Validity functions should be discussed, as only one is implemented. More complex checks may require a change in how the validity functions are called (maybe add new parameters, etc).