OpenP2P is a library designed to simplify the construction of peer-to-peer networks. To this end it offers a number of modules, such as the framework for a Kademlia DHT, from which it is simple to construct any number of different networks, or to build clients to interface with existing networks. It can found at Google Code.
The library is developed in C++.
The OpenP2P project aims to provide support for:
- Basic sockets/streams support (uses boost::asio for cross-platform networking support).
- RPC (Remote Procedure Call) based protocols,
- DHTs - for both node identification, node lookup and evenly distributed data storage and retrieval.
- Cryptography (using Crypto++)
- UPnP and other methods to workaround NATs.
- Darknet Routing
- Trust system
- Distributed search (low priority - pre-design stage) - note that this can be easily provided by using a Gossip protocol
- Coordinate-based overlays (low priority - pre-design stage - see VAST)
The premise of the project is that many peer-to-peer applications re-implement the same components, and also that peer-to-peer is a fundamentally useful and underused method of communication. As a result future versions are likely to provide modules to support existing protocols (e.g. BitTorrent's DHT protocol) so these can be effectively reused by applications.
All code within the project is licensed under the MIT License. The code is also cross-platform and therefore doesn't rely on any particular operating system or underlying hardware.
Some of the key tools/networks supported by OpenP2P are:
The OpenP2P Root Network is an implementation of the library that provides support for initially accessing the full network and identifying sub-networks to join. This solves the fundamental problem of bootstrapping as well as providing an efficient method to locate the desired sub-network.
FolderSync is a Dropbox-like tool that provides an efficient method to synchronise files quickly between nodes (typically different machines).
The OFTorrent protocol, or Owner Free Torrent protocol, is a modification of the idea of the 'Owner Free Filesystem' (or OFF), for providing an efficient and private means to share files. In effect, it's very similar to torrenting (hence the name), but it is not possible to know with any reasonable certainty what torrents any nodes are downloading or seeding. The key advantage is that file data can be transferred directly, as opposed to dark-nets which are very secure but usually have considerably worse performance. However, file data for an OFTorrent must usually be about twice the size of the original data to provide the desired privacy.
Remote storage protocol
Work is currently underway to design a peer-to-peer ('cloud'-like) remote storage protocol, allowing nodes on a network to offer space and other nodes to store and retrieve their data. The intended use would generally be for personal data, or data for within certain groups, where a method of remote storage would be useful. Data security is the easy part - it can be provided by encrypting all data to be stored remotely, and then decrypting it on retrieval. Reliability is a more significant concern, of which there are some very reasonable solutions. A mechanism is also needed to ensure there is some balance between users providing space and consuming the space of others - some sort of peer-to-peer economy would be best placed to provide this. The current thinking is to use something like BitCoin, because it is tried-and-tested and allows currency to be used from other things (so you make money selling hard disk space and then buy other items with that), although it is slow for payments to be processed. There are also some additional complexities here - a market needs to be created, and with it a trust mechanism will ultimately end up being needed.