📜 ⬆️ ⬇️

"Purple" I2P - a window into the world of C ++ applications

It is known that the official I2P is written in Java, which in itself repels potential users, thereby reducing the network's polarity than it could be. In addition, Java applications are quite demanding of resources, because launching I2P on weak devices is difficult and sometimes impossible. It also turned out that Java in Africa is not the same Java, and support for strong cryptography depends on the country, because of which it was necessary to postpone a massive transition to ECDSA.
Therefore, the implementation of I2P in C ++ has always been an urgent task. Of the many attempts, "Purple I2P" (Purple I2P) is currently the most successful and suitable for practical use. The name is determined by the color of the shirt on the I2P icon, to distinguish it from the official I2P, where the color is red and denotes a family of applications using this I2P implementation. i2pd is a general-purpose I2P router.


image

I have previously considered the components necessary to build such a system. In short, a router that implements the following functions is required for I2P networking:

If there is a need to exchange your own data, then on the router it is necessary to place the addresses for which you need additional protocols discussed here . However, one data transfer is not enough to interact with clients - you need to be able to manage local addresses and be able to access remote addresses. In the official I2P, this is implemented as a set of separate external applications, these services are built into i2pd. Currently implemented:
  1. HTTP proxy
  2. I2P tunnels, representing the mapping of addresses on TCP ports of the local machine
  3. SAM - command interface. Consider it in more detail.

')

SAM protocol


SAM (Simple Anonymous Messaging) has for a long time been actually the only protocol suitable for full-fledged interaction with I2P from C ++ applications. More precisely, there is BOB , which actually implements the same concept, but is much less common than SAM.
The I2P protocol recommended by the official I2P is of little use for these purposes, since it is a lower-level protocol and uses an external implementation of threads, also written in Java. There is currently no C ++ version. In the future, it is planned to issue the implementation of streams from i2pd as a separate library, working through I2CP.
For SAM, there is a ready-to-use C ++ library i2psam, which is actively used by cryptocurrencies to hide its traffic.
Despite the flaws and criticism, SAM is the most important protocol in the "purple" I2P, since a combination of an existing C ++ application using SAM and i2pd allows you to immediately abandon the use of Java without additional modifications.
The most popular of them are:
  1. I2p messenger
  2. iMule
  3. Bitcoin-I2P

In general, the protocol is fully justifying its name, from the point of view of the client, representing sockets that work either in command mode or in data transfer mode. If the client removes the socket, then the corresponding I2P construction is deleted. The work begins with the creation of a local address with the keys set by the client, or a temporary address with randomly generated keys. Then either can, using this address, establish a connection with the remote address, or wait for the next incoming connection from the remote address. After that, the socket goes into data transfer mode.
Such an interface can be implemented as an API and used directly from the application, without the need to use an external router, and distributed as a ready-made solution, without forcing the end user in the details of the I2P settings.

What is planned to implement


  1. I2CP so that Java applications can work through i2pd
  2. The node shaper to build faster and more reliable tunnels
  3. Update Address Book
  4. Datagrams
  5. Floodfill mode


Release 0.1.0


Actually the main idea of ​​this article is that the first stable release of i2pd, containing the above described functionality, is released.

Ubuntu binaries:
launchpad.net/~i2p.packages/+archive/ubuntu/i2p

for debian
deb.i2p2.no

For all other platforms compile from source here .
Requires crypto ++ and boost libraries.

Source: https://habr.com/ru/post/240815/


All Articles