okTurtles / dnschain

A blockchain-based DNS + HTTP server that fixes HTTPS security, and more!
https://okturtles.com
Other
1.74k stars 169 forks source link

JSON API specs #45

Closed dschuermann closed 9 years ago

dschuermann commented 10 years ago

I'd like to know the JSON specification if there is any. A JSON API to search for users based on their full name would also be nice.

taoeffect commented 10 years ago

Noted. This is coming.

taoeffect commented 10 years ago

Most likely, however, search will be based on emails, not full names, is that OK?

dschuermann commented 10 years ago

Depends on the use case ;) Ideally, the search would be based on an index of all fields

taoeffect commented 10 years ago

The reasoning is that emails (and user ids) can be verified uniquely in the blockchain. Fields like someone's name, however, aren't guaranteed to be unique, so they would return multiple search results. Thoughts?

dschuermann commented 10 years ago

Ah I see, just thinking loud about possible scenarios: Scenario 1 is clear: Let's say we meet and you tell me your user id on Namecoin, I can then securely retrieve your PGP fingerprint, everything else works like magic. Theoretically I can directly certify the PGP key because the <key, identity>-binding is secured by the blockchain. Are there other scenarios where I want to send you an encrypted email without knowing your Namecoin user id before? Maybe I will search for your name on namecoin and later meet you in real life to verify that I downloaded it from the "right" greg? Not sure about this scenario, maybe it makes no sense for Namecoin.

taoeffect commented 10 years ago

Maybe I will search for your name on namecoin and later meet you in real life to verify that I downloaded it from the "right" greg? Not sure about this scenario, maybe it makes no sense for Namecoin.

  1. I think emails will become more useful than even user ids (unless the user id is as simple as "greg", as I was lucky to get).
  2. Sure, the scenario you describe might happen, but it would be completely reasonable to not spend any time developing such a "Search by names then later verify" view in your software. Email clients don't have it (for example), and no one complains.
dschuermann commented 10 years ago
  1. But emails aren't unique inside the blockchain aren't they?
  2. Emails clients don't have it because you publish your personal email address on a website for lookup (which could be MitMed ;) making email address discovery problematic in itself). But lets keep scenario 2 out of scope for now and focus on a simple JSOn API...
taoeffect commented 10 years ago

But emails aren't unique inside the blockchain aren't they?

Emails for domains registered in the blockchain can be guaranteed to be unique. For most domains, you are correct that they are not (at the moment). Hopefully I'll have some time to blog about this in more detail soon.

taoeffect commented 9 years ago

This is related to #46.

taoeffect commented 9 years ago

This is being fleshed out in the openname-resolver specification.

taoeffect commented 9 years ago

@dschuermann We've completely rewritten those specs, please have a look again:

https://github.com/openname/openname-specifications/blob/master/resolvers.md

Here's an example:

https://api.example.com/v1/namecoin/key/id%2Fbob
https://api.example.com/v1/bitcoin/addr/MywyjpyBbFTsHkevcoYnSaifShG2Et8R3S
https://api.example.com/v1/namecoin/key/id%2Fclinton/transfer?to_addr=ea3df...
http://api.example.com/v1/resolver/fingerprint

URL structure:

/{version}/{chain|resolver}/{resource}/{property}/{operation}{resp_format}?{args}

Prelim support coming in 0.5.

Thoughts?

dschuermann commented 9 years ago

Hey @taoeffect we are currently overloaded with other efforts, but I linked it to our issue. Thanks for working on this!

taoeffect commented 9 years ago

No problem! Closing this for now then, feel free to re-open or create another issue if you need it!