Decentralizing the Network
A few thought on how to decentralize this network to a P2P network.
Minimal vs. Miner Peers
I want to divide the Network Peers into two types of Peers:
- Miner A minimal Peer shall only provide basic peer, similar to a client in a server-client application, but still connected to a slew of other peers of both kinds and not connected to one elevated server-like peer.
A miner Peer shall be a full peer, that takes over more of the functions of the server, than the minimal Peer.
- Networking Layer := IPFS
- Encoding / Decoding Layer := Protobufs
- Messages Layer
- Application Layer
I propose, that all the networking connections and P2P are managed through IPFS and their protocols. This makes for fewer work and IPFS is well tested and in active development for future proof protocols and implementations.
Encoding / Decoding Layer
Data, sent through the networking layer, needs to be encoded and decoded on all sides the same. I propose, that this encoding and decoding is done using Protocol Buffers (protobuf). Protobuf is multilingual, stable and maintained by Google and Google Open Source.
The interpretation of the Messages sent through the Networking Layer and encoded by the Encoding / Decoding Layer requires a separate layer. I propose, that communications on updates of the network's state should be published through IPFS PubSub containing CIDs, that have to be read from IPFS in order to properly use the Messages sent through IPFS.
After this each Message requires verification and possibly further action by the peer, which needs to be set in motion by the Message Layer. This should be implemented by us.
Those actions set in motion by the Message Layer are part of the Application Layer. The Application Layer on Miner Peers keeps a copy of the State of the Network, probably in the form of a Blockchain.
There are two language to choose from for the miner peer:
Python has the advantage of a better Protobuf documentation and implementation