"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 polarity of the network than it could be. In addition, Java applications are quite resource-demanding, because running 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, which is why I had to postpone the massive transition to ECDSA.
    Therefore, the implementation of I2P in C ++ has always been an urgent task. Of the many attempts, 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 implementation of I2P. i2pd is a general-purpose I2P router.


    Earlier, I considered the components necessary for building such a system. In short, to work on an I2P network, you need a router that implements the following functions:
    • Transport responsible for direct connections to other nodes. Usually via the Internet, but can also be through other networks, for example, Thor
    • Tunneling and sending data
    • Search and maintain a list of other nodes up to date
    • Transfer of transit traffic of other participants

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

    SAM protocol

    SAM (Simple Anonymous Messaging) for a long time was actually the only protocol suitable for full interaction with I2P from C ++ applications. More precisely, there is still a BOB that actually implements the same concept, but is much less common than SAM.
    The I2CP protocol recommended by official I2P is of little use for these purposes, since it is a lower-level protocol and uses an external stream implementation written in Java too. There is no C ++ version at the moment. In the future, it is planned to arrange 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 conceal its traffic.
    Despite the flaws and criticism, SAM is the most important protocol in purple I2P, since the combination of an existing C ++ application using SAM and i2pd allows you to immediately stop using Java without additional modifications.
    The most popular of them:
    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 construct is deleted. Work begins with creating a local address with keys specified by the client, or a temporary one with randomly generated keys. Then, either using this address, it can 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 into details of I2P settings.

    What is planned to be implemented

    1. I2CP so Java applications can work through i2pd
    2. Node profiler to build faster and more reliable tunnels
    3. Updatable 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 functionality has been released.

    Binaries for Ubuntu:

    for Debian

    For all other platforms, compile from source from here .
    Crypto ++ and boost libraries are required.

    Also popular now: