Mobile Protocol specification

This is a DRAFT for protocol extensions to enable mobile devices to participate in bitmessage communication.

Intention
If you want to let mobile devices participate in bitmessage communication, you need a gateway device. Theoretically the device could participate like a standard node, but this will cause too much traffic. Even if you have a flat rate, it'll cost to much battery. This page describes a way, the standard protocol could be enhanced, to let mobile devices participate, at least through a gateway.

The Gateway
The gateway first of all is a standard bitmessage node. As a bitmessage node it connects to other nodes and collects and exchanges objects. The mobile gateway functionality is an extension, an additional protocol variant.

When a mobile device connects to a gateway it will identify itself in the "services" field of the version message to be a mobile device. The gateway will answer in the same field, that it is a gateway.

Therefore the service table has to be enhanced:

Network address
Because we have to share private keys between mobile node and gateway, we do ssh encryption on the connection. For that reason the "Network Address" gets an additional (optional) field for the public ssh key.

Sending messages
When accessed by a NODE_MOBILE the NODE_GATEWAY will not send any "addr" message, because the NODE_MOBILE will connect to the bitmessage network only through well known gateways. It will neither send a "inv" message, because it wants to reduce the traffic to the NODE_MOBILE.

When accessed to a NODE_GATEWAY the NODE_MOBILE will not send a "addr" message, too. But it might send an "inv" message, when it has objects to share. and it can share already all types of objects with the network.

With this very small protocol changes the NODE_MOBILE is already able to send messages using the bitmessage protocol, but with very reduced traffic load.

Receiving messages
For the receive direction we must bring the NODE_GATEWAY in the position to select the objects the NODE_MOBILE is interested in.

For that we introduce a new Message type:

setreceivekey
Receiving this message, the NODE_GATEWAY starts to send "inv" messages and offers the NODE_MOBILE objects. In opposite to a standard node connection, it offers only objects, which are already found to be for this node.

there might be multiple of this messages.

NODE_GATEWAY stores this information only as long as the connection exists. It can now filter the objects that are intended for NODE_MOBILE.

Whenever the NODE_GATEWAY notifies, that NODE_MOBILE might be interested in objects, it sends a "inv" message to offer them (must be only the objects, NODE_MOBILE is interested in!).

How does NODE_GATEWAY know, which objects are of interest: It uses the private key received in "setreceivekey" to filter private messages. Every "getpubkey" object is translated into a request. When the object arrives at NODE_GATEWAY or if its already there, it is offered in an "inv" message.