Bitcoin Forum
November 18, 2024, 01:35:16 PM *
News: Check out the artwork 1Dq created to commemorate this forum's 15th anniversary
 
   Home   Help Search Login Register More  
Pages: [1] 2 3 »  All
  Print  
Author Topic: Namecoin into i2p integration [WORKS!]  (Read 11326 times)
pent (OP)
Hero Member
*****
Offline Offline

Activity: 490
Merit: 500



View Profile
January 23, 2012, 08:49:31 PM
Last edit: January 29, 2012, 02:28:48 AM by pent
 #1

In Internet Invisible Project (I2P) there is a big problem with *.i2p name resolution. There is no authentication mechanisms that this .i2p domain corresponds to this .b32.i2p address.

All corresponding records are distributed across routers in plain text "hosts" file format, and most of domains do not reolve properly, so the problem for user to find a valid record. He have to search in several "central" name storages by hands and even in google. The first thought when you enter i2p network is thought that it is dead.

However I downloaded several torrents from i2p using i2psnark internal anonymous torrent client. So, i2p works, but slow.

What if to integrate .bit (namecoin) name resolution (which is authenticated with digital signatures) into i2p host address?

And what is another point in .bit DNS system? If it will provide real IP address resolution - so there will be no anonymity. It must provide a way to resolve hosts in anonymous networks.

======= WORKING DEMO ========
How to check out?

Configure your browser to use proxy to 94.75.233.174 port 4444. Thats all.

Proxy does not support regular ICANN domains and IP.
.i2p and .bit (configured for i2p) only!!! 150 Kb/sec total traffic shaper enabled.


My own site supporting this project:

http://i2psupport.bit/

domain i2psupport.bit is resolved to (absolutely no any IP-address):

Code:
[root@server ~]$ ./namecoind name_scan d/i2psupport 1
[
    {
        "name" : "d/i2psupport",
        "value" : "{\"i2p\": { \"destination\": \"SN8pNsF~NHZek2NRUootxO465FnrcpZcdcRzQXGvjmwXER7HQKw5j~S4mEZuFEFMWTDXI3MTACJfN9y87sLBPHnJA0CEXjYKf2hM4YNJ2fLUXCZi0uLDaW-rUz4vEpUJF1-rcE~D4tiFO-2MKVNJLoGKvO87808XL0ejtdNCE-apxOWsGNBmxDdOM6dPx~F6tzmA-m8EeAzXvE-ZD8Q5yQX2dIiDXTFRTgfKQG0acyuNwBOWxRb2MvyoyxiKQFhcn2V~jR0Ub4~1eHNMq-308j1d1nZNPEPxnQPcMYY22lU427GASGYMOpngFH-Z8l1cKpiBAYCvDR1kvUASctLfBIE9U3IWRsYhQHhMPi5ZPuWNkM5U5oH4DXPctDmDsiIAtB-l4vUWTTkxmwU0~65URyb4EDFEVzcfmZuD0xMCq8Me9q1OgkhfIjdoCC-35D8cKPygCMdfZh4ZOHg932NmNLT5fTaKIiri~MSl4GwQPdC27iV7DRDZJV0YrjhIYJccAAAA\" } }",
        "txid" : "9f4903a2061d78398842619e49aacfca0e2021d3e2fd2ebc8d06f9effb311b27",
        "address" : "MxR1e7obQ5KcuaofuzXbceL3Aj1wfWME7v",
        "expires_in" : 35983
    }
]

====

No more words, just pics: http://i2psupport.org/
pent (OP)
Hero Member
*****
Offline Offline

Activity: 490
Merit: 500



View Profile
January 24, 2012, 12:40:01 AM
Last edit: January 24, 2012, 12:51:14 AM by pent
 #2

Well, this looks like materialized in wiki:
http://dot-bit.org/Domain_names#Value_field

Code:
"i2p": {
"destination": "XaZscx...0jGAAAA"
"name"  : "example.i2p"
"b32"  : "ukeu...nkdq.b32.i2p"
}

Also there is a solution for Tor .onion addresses.

I'll try to do some i2p code modifications to let i2p communicate with namecoind for name resoultion.

If someone do not understand what i am talking about, realize:

- Anonymous, but authoritative .bit domain
- Anonymous tor/eep site which has no any IP address correspondence

I can create a sometracker.bit domain, point it in to Tor and I2P location and noone will not know where it is located and who is responsible for it.

And I can send this address directly to Digital Millenium Copyright all of SOPA/PIPA supporters to get them check it out. lol
ptshamrock
Hero Member
*****
Offline Offline

Activity: 484
Merit: 500



View Profile
January 24, 2012, 01:54:34 PM
 #3

Well, this looks like materialized in wiki:
http://dot-bit.org/Domain_names#Value_field

Code:
"i2p": {
"destination": "XaZscx...0jGAAAA"
"name"  : "example.i2p"
"b32"  : "ukeu...nkdq.b32.i2p"
}

Also there is a solution for Tor .onion addresses.

I'll try to do some i2p code modifications to let i2p communicate with namecoind for name resoultion.

If someone do not understand what i am talking about, realize:

- Anonymous, but authoritative .bit domain
- Anonymous tor/eep site which has no any IP address correspondence

I can create a sometracker.bit domain, point it in to Tor and I2P location and noone will not know where it is located and who is responsible for it.

And I can send this address directly to Digital Millenium Copyright all of SOPA/PIPA supporters to get them check it out. lol


My finest Regards,

an admirer

"Money needs to be depoliticized, and the time has come for the separation of money and state to be accomplished."
Andrew Bitcoiner
Sr. Member
****
Offline Offline

Activity: 396
Merit: 250


Send correspondance to GPG key A372E7C6


View Profile WWW
January 24, 2012, 09:13:00 PM
Last edit: September 21, 2012, 06:07:33 AM by Andrew Bitcoiner
 #4

remo

MAKE MONEY! ADVERTISE FOR BITCOINS http://www.bitcoinadvertising.com
Bitcoin News Site http://coinbits.com
Bitcoin Blackjack http://bitjack21.com
Bitcoin, Darknet, IT consulting http://cryptophene.com
Red Emerald
Hero Member
*****
Offline Offline

Activity: 742
Merit: 500



View Profile WWW
January 24, 2012, 09:29:53 PM
 #5

You should look at https://github.com/itsnotlupus/nmcsocks

I think that is exactly what you want.

pent (OP)
Hero Member
*****
Offline Offline

Activity: 490
Merit: 500



View Profile
January 24, 2012, 09:44:39 PM
 #6

I will publish in near time i2p code hacks to support .bit zone.

Actually there is three variants:

- Resolve directly via namecoin HTTP-JSON-RPC interface of nearly installed namecoind
- Resolve directly via namecoin-friendly name server via IP
- Resolve directly via namecoin-friendly name server which is inside i2p network

Well, the 1st one is most simplier and authoritative, but will need a namecoin software installed along with i2p software. With all blockchain download.
The 2nd one will need to specify remote namecoin-friendly DNS via IP. This is not authoritative, not reliable and isnt secure.
The 3rd one will allow to put namecoin resloution DNS servers somewhere inside i2p network. This is more secure, but still isnt reliable and authoritative.

Working on 1st one.
pent (OP)
Hero Member
*****
Offline Offline

Activity: 490
Merit: 500



View Profile
January 24, 2012, 11:42:37 PM
 #7

Actually, the official namecoind is so raw... Its has no suitable method for signle name resolution.

I can query for "name_history <name>", but I think it can return possibly large data.

namecoind also needs to be patched ))
pent (OP)
Hero Member
*****
Offline Offline

Activity: 490
Merit: 500



View Profile
January 25, 2012, 04:13:53 AM
 #8

Okay. So we have an active domain bit.bit (I am not the owner). It has some history:
Code:
[pentarh@pentbook src]$ ./namecoind name_history d/bit
[
    {
        "name" : "d/bit",
        "value" : "support@kiellimited.com",
        "txid" : "c584be36a35b152c87c356b9efe4499d5e6e00bc26fed5d3324ce1582fa5cc9a",
        "address" : "N4u9f2h52Ft44Qe5bfo91xxMNLn1VC82au",
        "expires_in" : -27256,
        "expired" : 1
    },
    {
        "name" : "d/bit",
        "value" : "Krecovery",
        "txid" : "f7331a599cf4e59dbe30172822889ea87057ee75f1a3a48dcafe0621be10b4dc",
        "address" : "NG8iqBEqX85odxxjJCcFqyAGfVzF38TobT",
        "expires_in" : -26589,
        "expired" : 1
    },
    {
        "name" : "d/bit",
        "value" : "{\"map\": {\"\": \"78.47.86.43\", \"www\": \"78.47.86.43\"}}",
        "txid" : "988e3a9805fc60f1fbe30fbdb061a79bd6e73f5cbff039dbdd4cde1925cef855",
        "address" : "N32tEoKFnrtsbKBredM56BjxD4KmGtTdfH",
        "expires_in" : -17393,
        "expired" : 1
    },
    {
        "name" : "d/bit",
        "value" : "{\"ip\": \"78.47.86.43\", \"email\": \"gtempns1@san.gs\", \"info\": { \"status\": \"For sale.\" }, \"map\": {\"\": \"78.47.86.43\", \"www\": \"78.47.86.43\"}}",
        "txid" : "bb12684745370c4d785a640fdb1d2dfbe1f6a0ef41ff55f5b18b9c1f331ce614",
        "address" : "MzMm4F3mRA9hMpa7ABN9nZCZAq3JWd4UWA",
        "expires_in" : 11258
    },
    {
        "name" : "d/bit",
        "value" : "{\"ip\": \"78.47.86.43\", \"email\": \"gtempns1@san.gs\", \"info\": { \"status\": \"For sale.\" }, \"map\": {\"\": \"78.47.86.43\", \"www\": \"78.47.86.43\"}}",
        "txid" : "9b091fbb236b59de79f926c32b77b0348e34db5c6de3fe69dc2edd252e757d61",
        "address" : "N4yKKfvMjF9NX4PNzPguiPbegMmzjhiLJ1",
        "expires_in" : 22440
    }
]

The only two last records are valid, all others expired.

Native namecoind has no methods for suppressing such expired records. So I make a small patch, which is implementing direct name resolution in namecoind

Method: name_resolve
Args: <name>
Example:
Code:

[pentarh@pentbook src]$ ./namecoind name_resolve d/bit
[
    {
        "name" : "d/bit",
        "value" : "{\"ip\": \"78.47.86.43\", \"email\": \"gtempns1@san.gs\", \"info\": { \"status\": \"For sale.\" }, \"map\": {\"\": \"78.47.86.43\", \"www\": \"78.47.86.43\"}}",
        "txid" : "bb12684745370c4d785a640fdb1d2dfbe1f6a0ef41ff55f5b18b9c1f331ce614",
        "address" : "MzMm4F3mRA9hMpa7ABN9nZCZAq3JWd4UWA",
        "expires_in" : 11258
    },
    {
        "name" : "d/bit",
        "value" : "{\"ip\": \"78.47.86.43\", \"email\": \"gtempns1@san.gs\", \"info\": { \"status\": \"For sale.\" }, \"map\": {\"\": \"78.47.86.43\", \"www\": \"78.47.86.43\"}}",
        "txid" : "9b091fbb236b59de79f926c32b77b0348e34db5c6de3fe69dc2edd252e757d61",
        "address" : "N4yKKfvMjF9NX4PNzPguiPbegMmzjhiLJ1",
        "expires_in" : 22440
    }
]
Actually I dont know what to do with two active records Sad Is the only last valid, or both (split brain)? Current patch is:
Code:
--- namecoin.cpp.old    2012-01-25 04:34:52.000000000 +0200
+++ namecoin.cpp.new    2012-01-25 02:01:06.000000000 +0200
@@ -677,6 +677,61 @@
     return oRes;
 }
 
+
+Value name_resolve(const Array& params, bool fHelp)
+{
+    if (fHelp || params.size() < 1)
+        throw runtime_error(
+            "name_resolve <name>\n"
+            "Return an active name record.\n");
+    
+    Array oRes;
+    vector<unsigned char> vchName = vchFromValue(params[0]);
+    string name = stringFromVch(vchName);
+    CRITICAL_BLOCK(cs_main)
+    {
+        vector<CDiskTxPos> vtxPos;
+        CNameDB dbName("r");
+        if (!dbName.ReadName(vchName, vtxPos))
+            throw JSONRPCError(-4, "failed to read from name DB");
+        
+        CDiskTxPos txPos;
+        BOOST_FOREACH(txPos, vtxPos)
+        {
+            CTransaction tx;
+            if (!tx.ReadFromDisk(txPos))
+            {
+                error("could not read txpos %s", txPos.ToString().c_str());
+                continue;
+            }
+
+            Object oName;
+            vector<unsigned char> vchValue;
+            int nHeight;
+            uint256 hash;
+            if (!txPos.IsNull() && GetValueOfTxPos(txPos, vchValue, hash, nHeight))
+            {
+                if(nHeight + GetDisplayExpirationDepth(nHeight) - pindexBest->nHeight <= 0)
+                {
+                   // Not returning expired record
+                   continue;
+               }
+                oName.push_back(Pair("name", name));
+                string value = stringFromVch(vchValue);
+                oName.push_back(Pair("value", value));
+                oName.push_back(Pair("txid", tx.GetHash().GetHex()));
+                string strAddress = "";
+                GetNameAddress(txPos, strAddress);
+                oName.push_back(Pair("address", strAddress));
+                oName.push_back(Pair("expires_in", nHeight + GetDisplayExpirationDepth(nHeight) - pindexBest->nHeight));
+                oRes.push_back(oName);
+            }
+        }
+    }
+    return oRes;
+}
+
+
 Value name_scan(const Array& params, bool fHelp)
 {
     if (fHelp || params.size() > 2)
@@ -1197,6 +1252,7 @@
     mapCallTable.insert(make_pair("name_list", &name_list));
     mapCallTable.insert(make_pair("name_scan", &name_scan));
     mapCallTable.insert(make_pair("name_history", &name_history));
+    mapCallTable.insert(make_pair("name_resolve", &name_resolve));
     mapCallTable.insert(make_pair("name_debug", &name_debug));
     mapCallTable.insert(make_pair("name_debug1", &name_debug1));
     mapCallTable.insert(make_pair("name_clean", &name_clean));

And I'm in the way to resolve in java this mess into i2p network address Smiley Smiley Smiley
Code:
[pentarh@pentbook src]$ ./namecoind name_resolve d/pent
[
    {
        "name" : "d/pent",
        "value" : "{ \"ip\" : \"192.168.1.1\", \"ip6\" : \"2001:4860:0:1001::68\", \"i2p\": { \"destination\": \"s2bzxafMCmDEujaZF44c558MBqYKC95YvoTqNaqMVGIoV68BUlCQu4Z6pjmuxSptHWo38LPx55nEqLLaKFljX7yr30o-iRBwsIev5M1HeX62YVJYxTP5acUxTKaG15dLwKLXRsqeHES8g21vwbz9LsHYsDR9IOYaJFnsBIOfLK4H5GYgcdogazZcuSvVrvX7jdpleGI7g6I81vzuGD0X0NZ~tpj~gypQsomwIZUYknTiaZ37X9TV7DpRbeYkevX7qnSX3odnk007Lhgrt2vN07-DpUHQLmTgr-GbYUVT0Xq-PB5Q2Oi5Rfl1MKQGQ7WXQyVW7MwmQpwgFMMqzQM8SDHqpqrxpsv3VHZ~GIkcKU4rlPazOzxan6PLmvaPigtbKJ0MCHUwD~zHAU~26DuSkRLvquCtxKqfOWE5z8JyaN~zxHivj7X8J7YpibXJdD53RcQ7ozsz9bvOTi0kQItuLR9ROlrxEfReUmWr0VKaCgmV4OvLfyi8~034nj7NAdKeAAAA\", \"name\" : \"example.i2p\", \"b32\" : \"b4szsgxsqgzqg76y3gcxolir54pwjokjjkbane645myukzqrbyoq.b32.i2p\" }, \"map\" : { \"www\": { \"ip\" : \"192.168.1.2\", \"ip6\" : \"2001:4860:0:1001::69\", \"i2p\": { \"name\" : \"example.i2p\", \"b32\" : \"b4szsgxsqgzqg76y3gcxolir54pwjokjjkbane645myukzqrbyoq.b32.i2p\" } } } }",
        "txid" : "f4d4b0849517767b2ef820a513902ee8dde87bd4794a2599198ed4f0b68a36f0",
        "address" : "N7t7sLxHzA7tiXYMExKtBgb4jGX12cHiYN",
        "expires_in" : 36000
    }
]
rjk
Sr. Member
****
Offline Offline

Activity: 448
Merit: 250


1ngldh


View Profile
January 25, 2012, 04:16:34 AM
 #9

If you aren't there already, you might want to get on Freenode, channel #namecoin and/or #namecoin-dev - there are a few dedicated folks there that might be able to assist with coding ideas and questions.

Mining Rig Extraordinaire - the Trenton BPX6806 18-slot PCIe backplane [PICS] Dead project is dead, all hail the coming of the mighty ASIC!
pent (OP)
Hero Member
*****
Offline Offline

Activity: 490
Merit: 500



View Profile
January 25, 2012, 04:18:01 AM
 #10

If you aren't there already, you might want to get on Freenode, channel #namecoin and/or #namecoin-dev - there are a few dedicated folks there that might be able to assist with coding ideas and questions.
thanks. i will
doublec
Legendary
*
Offline Offline

Activity: 1078
Merit: 1005


View Profile
January 25, 2012, 04:57:11 AM
 #11

The usual way to lookup a single name is "name_scan" with the numeric argument set to 1. eg:

Code:
namecoind name_scan d/bluishcoder 1
[
    {
        "name" : "d/bluishcoder",
        "value" : "{\"map\":{\"\":\"69.164.206.88\"}}",
        "txid" : "ebad6e9dfcb8d1204a49a6da089f6a102ea5779612c745d94766153215bc9a3f",
        "expires_in" : 27317
    }
]

You need to check if the returned name is the same as the one you asked for. If it is, and expires_in is greater than 0 you have the right record. Another approach is to monitor the namecoin network for blocks. When you get one do a "name_scan" to obtain the complete history. Cache that and do fast lookups using it. Whenever a new block arrives invalidate the cache and repopulate it.

pent (OP)
Hero Member
*****
Offline Offline

Activity: 490
Merit: 500



View Profile
January 25, 2012, 05:08:26 AM
 #12


You need to check if the returned name is the same as the one you asked for. If it is, and expires_in is greater than 0 you have the right record. Another approach is to monitor the namecoin network for blocks. When you get one do a "name_scan" to obtain the complete history. Cache that and do fast lookups using it. Whenever a new block arrives invalidate the cache and repopulate it.

Well, thanks ) That was i looked for.

Are the proposed Value templates are final? Can they change? They looks like a drafts.
doublec
Legendary
*
Offline Offline

Activity: 1078
Merit: 1005


View Profile
January 25, 2012, 05:39:36 AM
 #13

Are the proposed Value templates are final? Can they change? They looks like a drafts.
They are drafts but it's feedback from implementers (ie. people like you) that will help decide whether they're final. If you implement it, it'll no doubt become the final spec for namecoin/i2p integration.
markm
Legendary
*
Offline Offline

Activity: 3024
Merit: 1121



View Profile WWW
January 27, 2012, 03:02:27 PM
 #14

I have knotwork.bit, I also have knotwork.i2p, knotwork.com and knotwork.net

Do I have to tell namecoin just one destination, or can I tell it about an i2p way to get there, a .onion way to get there, a .com way and a .net way and so on?

-MarkM-

Browser-launched Crossfire client now online (select CrossCiv server for Galactic  Milieu)
Free website hosting with PHP, MySQL etc: http://hosting.knotwork.com/
pent (OP)
Hero Member
*****
Offline Offline

Activity: 490
Merit: 500



View Profile
January 27, 2012, 06:26:50 PM
 #15

Having .com/.net or other IP-resolving correspondences is a de-anonymizer option for your location. And I am talking here for fully anonymous domain and hosting network.

For i2p with .bit you can specify:

"i2p" : { "destination" : "====516byte-hash-here====" },
--OR --
"i2p" : { "b32" : "====32byte-hash-here====.b32.i2p" },
--OR --
"i2p" : { "name" : "knotwork.i2p" },

OR even all together
"i2p" : { "destination" : "====516byte-hash-here====" ,
            "b32" : "====32byte-hash-here====.b32.i2p" ,
            "name" : "knotwork.i2p"
}

You can specify alternate "tor" and "ip4" locations if you wish, but this will not work with I2P tunnel proxy.

And here is a problem. i2p "destination" field has length of 516+ bytes. So it counsumes >50% of total allowable record length ( 1Kb).
It is better to use .b32.i2p hash address.
using of regular i2p domain name is not recommended. regular i2p domains has strong resolving issues.


Red Emerald
Hero Member
*****
Offline Offline

Activity: 742
Merit: 500



View Profile WWW
January 27, 2012, 06:44:53 PM
 #16

I have knotwork.bit, I also have knotwork.i2p, knotwork.com and knotwork.net

Do I have to tell namecoin just one destination, or can I tell it about an i2p way to get there, a .onion way to get there, a .com way and a .net way and so on?

-MarkM-

I think you can (and should) put all of the possible ways. I'm not sure how good the current namecoin resolvers are at picking the "correct" one though.  I know using the public DNS servers will only give you the IPs.  If you run namecoind locally you should be able to choose which way to go.

pent (OP)
Hero Member
*****
Offline Offline

Activity: 490
Merit: 500



View Profile
January 27, 2012, 07:08:47 PM
 #17

There is no sense in anonymous .bit domains delegated to regular NS servers or pointing destination to regular ip4/ip6 addresses.

There is no sense in that because it is more simplier way to use regular domain with whois protect.

The future of NameCoin is in anonymous networks.

I2P has ugly and not authoritative DNS system, but has very strong anonymous crypted network.
Tor has authoritative .onion domains, but they are looks not user-friendly.

NameCoin Has authoritative anonymous domain system, but has no anonymous network implementations.

They all made for each other.
pent (OP)
Hero Member
*****
Offline Offline

Activity: 490
Merit: 500



View Profile
January 27, 2012, 07:23:35 PM
 #18

And unlike I2P, Tor is just a proxy service, primary made for HTTP proxying.

I2P has ability for different service communications inside its anonymous network. For example, torrent client i2psnark. It is operates via encrypted tunnels, while Tor strongly do not recommend to let torrent traffic go through Tor network.

So the future of NameCoin is in I2P.
pent (OP)
Hero Member
*****
Offline Offline

Activity: 490
Merit: 500



View Profile
January 28, 2012, 02:31:15 AM
Last edit: January 28, 2012, 03:06:09 AM by pent
 #19

Actually it works!

This is the proof of concept.

Anonymous, authoritative domain pent.bit resolving into anonymous encrypted i2p network. No one (except the owner) will never ever shut it down by any reason. I believe this is the next step for FREE INTERNET.

I picked some random i2p hash address from address book for testing and assigned to http://pent.bit (need patched i2p router software to check it)

In some reason I cant update my domain with new address for my eepsite, so i created a bug request.

By the power of chance this randomly picked i2p host now resolving and responding at http://www.pent.bit (need patched i2p router software to check it) Smiley And there is a some TV serials in HD 720p are available for direct download ==LOL== Hello my dear SOPA ))



My own domain with instruction will be located here and soon i release patches in github under gpl3.

http://zpuzc2b2chuon3q62sfh5r6ys3y7zdpdohm2ohkvy7j7fogn4iqa.b32.i2p/ (need i2p router software to check it).

It is still not .bit because there is a delay in first_update namecoin procedure.
slush
Legendary
*
Offline Offline

Activity: 1386
Merit: 1097



View Profile WWW
January 28, 2012, 03:01:16 AM
 #20

Very nice! I was thinking about the same project for Tor. Unfortunately I'm too busy so I hope somebody else will do the job for me :-)).

Quote
And unlike I2P, Tor is just a proxy service, primary made for HTTP proxying.

This is incorrect, Tor is acting as a SOCKS5 proxy and is relaying any TCP traffic, not only HTTP.

Pages: [1] 2 3 »  All
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!