I was just wondering if I2P built-in kademlia could be used as the base infrastructure (so to send messages, searches, discovering etc.)
No, the built-in Kademlia is AFAIK only for internal lookups of I2P destinations and the corresponding tunnel endpoints. There's an explanation and an schematic view in the
technical I2P introduction.
Oh, and Kademlia is per default disabled as network database: In the
explanation of the network database it says:
The netDb is distributed with a simple technique called "floodfill". Previously, the netDb also used the Kademlia DHT as a fallback algorithm. However, it did not work well in our application, and it was completely disabled in release 0.6.1.20.
I2P provides an anonymous transport layer. A quote from the
introduction into application programming:
Applications that are designed to work with I2P can take advantage of its built in data security and optional pseudonymous authentication. All data sent over the network is transparently end to end encrypted (not even the routers get the cleartext), and any application using the streaming or datagram functionality has all of that data authenticated by the sending destination's public key.
I2P provides something similar to UDP (unordered best effort) and TCP (ordered and guaranted delivery):
There are also efficiency considerations to review when determining how to interact on top of I2P. The streaming library and things built on top of it operate with handshakes similar to TCP, while the core I2P protocols (I2NP and I2CP) are strictly message based (like UDP or in some instances raw IP). The important distinction is that with I2P, communication is operating over a long fat network - each end to end message will have nontrivial latencies, but may contain payloads of up to 32KB. An application that needs a simple request and response can get rid of any state and drop the latency incurred by the startup and teardown handshakes by using (best effort) datagrams without having to worry about MTU detection or fragmentation of messages under 32KB.
The ministreaming library itself uses a functional but inefficient scheme for dealing with reliable and in order delivery by requiring the equivilant of an ACK after each message which must traverse the network end to end again (though there are plans for improving this with a more efficient and robust algorithm).
IMO it makes much sense to use I2P as transport network because it has active development, it's stable, has many users and the file sharing developers don't need to reinvent the wheel of anonymous data transfer.
Greetings,
Nemo.