Here is the plan: we won't build another network interface, instead the new P2P protocol would rely on the existing BMA. It would be added a WebSocket URL like /ws/p2p.
This URL would allow WebSocket connection, and would be exclusively reserved to member nodes. To ensure this behavior, at the connection step a challenge would be sent to the connecting peer to sign a document with a random hash in it provided by the server peer. If the signature matches, and the signing key is a member, then the connection can be established.
Once the connection is set, we have a 2-way tunnel for sending/receiving documents: blocks, identities, transactions, etc.
We would have 3 zones of connection: incoming, outcoming, sibling.
incoming would correspond to connections initiated by an external peer. Size 10.
outcoming would correspond to connections initiated by the local node. Size 10.
sibling would correspond to incoming connections with the same pubkey as the local node. Size unlimited.
A same pubkey (of a peer) cannot be more than once in the incoming+outcoming zone. The idea is to avoid connecting to a node that we already have a channel with.
Also, the usage of the legacy HTTP multicasting (through BMA URLs like POST /blockchain/block) would be lowered, yet still enabled and available. This allows mirror nodes to be in the place, which would still receive blocks and data through this legacy connection. Also, these mirror nodes would themselve share new documents to member nodes through this API.
Here is the plan: we won't build another network interface, instead the new P2P protocol would rely on the existing BMA
I thought it would have been a good start to depend less on BMA, since this API is getting older and older. If we want to replace BMA one day, I think we should have less things depending on it.