[NMDF] Namecoin API Server [0.5BTC] [frozen]

phelix
Posts: 1634
Joined: Thu Aug 18, 2011 6:59 am

[NMDF] Namecoin API Server [0.5BTC] [frozen]

Post by phelix »

This would allow for lightweight applications: Firefox browser plugin with TLS, file signatures, name browsing

* Should use Nmcontrol (integrated or query) or maybe a custom Python script
* Server should run on nginx, tornado, supervisord
See some old config files of mine here: http://blockchained.com/stuff/tornado_config.7z (includes Namecoin TLS support)
* Should implement some kind of query time / size limit and DDOS protection in Nmcontrol
* Should have an ICANN domain name or subdomain (not on namecoin.org)
* Has to run for at least one year
* All files need to be open source on github with a free license
* Should come with an example query file in python
* a .bit domain with TLS support would be nice (should be very simple with the config files above)
* should be reasonably performant (cached name list)

* For much later: offer some security by adding the original block + a couple of following blockheaders

API (json):
* name_show (just like namecoind or nmcontrol)
* name_show at previous height, return failure if older than e.g. 100k blocks (nice to have)

Feel free to add suggestions or ask for clarification.

Edit:
You will receive 0.3BTC now and 0.2BTC after one year.
Query names could be hashed and results encrypted with the name or something to protect the server operator from liabilities.

edited 2014-01-19
nx.bit - some namecoin stats
nf.bit - shortcut to this forum

khal
Site Admin
Posts: 708
Joined: Mon May 09, 2011 5:09 pm
os: linux

Re: [NMDF] Namecoin API Server [0.5BTC]

Post by khal »

Can you add a description how it would work,
what services the API need to provide,
should it be integrated into nmcontrol or do queries on it (and why),
etc ?
* Has to run for at least one year
Should a public server with the API be provided ?
For what usage ? testing the API and having a first server before other people create their own ?
NamecoinID: id/khal
GPG : 9CC5B92E965D69A9
NMC: N1KHAL5C1CRzy58NdJwp1tbLze3XrkFxx9
BTC: 1KHAL8bUjnkMRMg9yd2dNrYnJgZGH8Nj6T

Register Namecoin domains with BTC
My bitcoin Identity - Send messages to bitcoin users
Charity Ad - Make a good deed without paying a cent

indolering
Posts: 801
Joined: Sun Aug 18, 2013 8:26 pm
os: mac

Re: [NMDF] Namecoin API Server [0.5BTC]

Post by indolering »

Whoa, I've already got one of these working I just need to fix the server it was on. Save your .5 BTC :)
DNS is much more than a key->value datastore.

indolering
Posts: 801
Joined: Sun Aug 18, 2013 8:26 pm
os: mac

Re: [NMDF] Namecoin API Server [0.5BTC]

Post by indolering »

Ahh, after reading your post a bit more carefully I don't have that exact setup. I have setup a JSON-RPC interface using PHP as well as a Node.js.

However, both of these are just stop-gaps until I could get PouchDB running. Why PouchDB? Because PouchDB can use LevelDB as the backend, which as soon as Namecoin is "rebased" on Bitcoin .8+ will be what Namecoin uses as well. Then it can directly read from the blockchain without any JSON-RPC overhead. Of course, the REAL reason I am using PouchDB is because I want to use CouchDB as the front-end server. So why CouchDB?

1) It's got map/reduce batching built in.
2) Clients can sync databases and subscribe to updates w/ polling.
3) The REST interface leverages every cache available, from the NGINX front-end proxy to the ISP's reverse proxy to your in-browser cache.

You say you want some sort of query time or size limit as well as DDOS protection ... well, once you have made something a static document the only DDOS protection left should be done at the network edge, not by the origin server. I was planning on a 15 minute TTL, at least in the beginning. If clients are throwing bogus requests, it won't hit the Namecoind instance, it will just hit CouchDB.

If you are planning on having this as a public service then I assuming that the overwhelming use-case is simple record retrieval, so I'm not sure what could be gained from using nmcontrol.

Of course, I don't know the first thing about LevelDB nor have I played with the raw blockchain data before. But even if I have to use the JSON-RPC interface I'll still use CouchDB for the REST API and scaling it provides.
DNS is much more than a key->value datastore.

phelix
Posts: 1634
Joined: Thu Aug 18, 2011 6:59 am

Re: [NMDF] Namecoin API Server [0.5BTC]

Post by phelix »

khal wrote:Can you add a description how it would work,
what services the API need to provide,
should it be integrated into nmcontrol or do queries on it (and why),
etc ?
To be honest I have no idea :mrgreen:
khal wrote:
* Has to run for at least one year
Should a public server with the API be provided ?
For what usage ? testing the API and having a first server before other people create their own ?
Yes, a public API is the whole point of it so people can start developing lightweight services.

@indolering
I am open to other solutions though I would prefer it to be in Python as a lot of Namecoin stuff is in Python and I myself use it. As for nmcontrol... I think it is the easiest solution, allows extra features and part oft the work can maybe reused for running locally.
nx.bit - some namecoin stats
nf.bit - shortcut to this forum

indolering
Posts: 801
Joined: Sun Aug 18, 2013 8:26 pm
os: mac

Re: [NMDF] Namecoin API Server [0.5BTC]

Post by indolering »

phelix wrote:
khal wrote:Can you add a description how it would work,
what services the API need to provide,
should it be integrated into nmcontrol or do queries on it (and why),
etc ?
To be honest I have no idea :mrgreen:
If you want to write a bounty to provide an API. then you really do need to define this. It's trivial to create a REST API for any random program because it is just a RPC (if you think about it, URLs are really just a wacky interface for Linux).
phelix wrote: I am open to other solutions though I would prefer it to be in Python as a lot of Namecoin stuff is in Python and I myself use it. As for nmcontrol... I think it is the easiest solution, allows extra features and part oft the work can maybe reused for running locally.
Since everything is just a RPC, nmcontrol is no better/worse than a straight interface and the work you are asking for is pretty useless for running local utilities. For the initial work, I just cloned a Bitcoin Node.js RPC client and added a few lines for Namecoin specific commands.

Seriously though, I am 1-3 weeks from completing this anyway and the Node/CouchDB implementation is much more useful for web developers. What's great about PouchDB is that it is primarily an in-browser/client-side storage library, so the code will be immediately reusable for the very clients you are looking to support.
DNS is much more than a key->value datastore.

phelix
Posts: 1634
Joined: Thu Aug 18, 2011 6:59 am

Re: [NMDF] Namecoin API Server [0.5BTC]

Post by phelix »

The API would be really simple for a start.... just like namecoind nmcontrol name_show

Do we need something else?


Bounty stands as described.
nx.bit - some namecoin stats
nf.bit - shortcut to this forum

indolering
Posts: 801
Joined: Sun Aug 18, 2013 8:26 pm
os: mac

Re: [NMDF] Namecoin API Server [0.5BTC]

Post by indolering »

phelix wrote:The API would be really simple for a start.... just like namecoind nmcontrol name_show

Do we need something else?


Bounty stands as described.
Can I call dibs to work on it? If it's about speed, I could simply install namecoin on a server and have name_show working in 30 minutes, but you wouldn't get much for your money. I would also like to donate the bounty to fund the new server and whatnot.
DNS is much more than a key->value datastore.

phelix
Posts: 1634
Joined: Thu Aug 18, 2011 6:59 am

Re: [NMDF] Namecoin API Server [0.5BTC]

Post by phelix »

indolering wrote:
phelix wrote:The API would be really simple for a start.... just like namecoind nmcontrol name_show

Do we need something else?


Bounty stands as described.
Can I call dibs to work on it? If it's about speed, I could simply install namecoin on a server and have name_show working in 30 minutes, but you wouldn't get much for your money. I would also like to donate the bounty to fund the new server and whatnot.
Sure thing. Sounds great, looking forward to this. Hope it will be integrated with the Firefox plugin someday so that we will have lightweight Namecoin Tor with TLS. :mrgreen:
nx.bit - some namecoin stats
nf.bit - shortcut to this forum

indolering
Posts: 801
Joined: Sun Aug 18, 2013 8:26 pm
os: mac

Re: [NMDF] Namecoin API Server [0.5BTC]

Post by indolering »

phelix wrote: Sure thing. Sounds great, looking forward to this. Hope it will be integrated with the Firefox plugin someday so that we will have lightweight Namecoin Tor with TLS. :mrgreen:
It's funny that you posted this, I just got the blockchain dumped into CouchDB and I'm hoping to have the client-side front end working tomorrow.

I should try to work with Sugarpuff on this, I haven't had much time to grok what he is doing. I can't use his as it's JUST and API, not a full syncing database and no client caching. But his security is much better as mine just relies on TLS.
DNS is much more than a key->value datastore.

Locked