dansup / hub

An open graph inspired API and website for Hyperboria.
MIT License
18 stars 5 forks source link

IPv6 vs Public Key Primary Key #25

Closed dansup closed 9 years ago

dansup commented 9 years ago

Hub previously used the cjdns ipv6 as the primary identifier (urls, routes) and the table primary key. While this worked, in theory it is possible for two unique public keys to produce the same ipv6 (very unlikely odds), I decided to address this issue now rather than it arise in the future as a bug.

A small change is the upcoming release affects the node migration, model and controller.

Use Node::whereAddr($ip)->firstOrFail() or get() instead of Node::findOrFail($ip).

dansup commented 9 years ago

Routes will remain the same, public key will redirect to the ipv6 page. However there will be a list of possible nodes on an ipv6 request with multiple nodes.

Eventually ips should redirect to the public key.

dansup commented 9 years ago

There is the problem of a user adding a node that doesnt already exist, where we need the public key to add it.

Two ideas:

  1. Allow user to set public key then hash and verify it matches the request ip.
  2. Add it to a queue or temp table to be inserted when the discovery cron (dumpTable) adds it db, then merge fields.
dansup commented 9 years ago

Public key's are the new primary key, and each ipv6 is the public alias. If multiple public keys point to the same addr, a disambiguation page will link to the proper node.