# No-Tag-Back Gossiping
> Version: 0.1.0 (Draft)
> Authors: Antoine Toulme <firstname.lastname@example.org>, Dean Eigenmann <email@example.com>
## Table of Contents
3. [Message Path](#message-path)
5. [Last hop](#last-hop)
6. [Origin and Last Sender](#origin-and-last-sender)
In this specification we highlight a series of simple improvements that can be made to gossip protocols improving their reliability.
For purposes of this specification we assume that nodes initially take part in a handshake where they exchange secrets, and share identities that will be used to sign messages.
Nodes MAY ratelimit their peers. Ratelimiting information SHOULD be exchanged in the handshake. The information that SHOULD be exchanged is the following:
- epoch length
- number of full messages
- number of headers
- max hops for full messages
- max hops for headers
All the numbers MUST be for fixed period of time, designated as the epoch.
The number of headers allowed SHOULD be much higher than full messages. Peers SHOULD prefer communicating headers only.
### Message Path
When a peer receives a message it MUST verify the validity of it. A message is valid if the previous sender has signed it along with the original sender.
Upon receiving and verifying the message, a peer SHOULD send it to all eager peers and send the signature to all lazy peers.
All peers MUST perform verification and add their own signature. This creates a path of headers that can help trace how a particular message transited through the network.
When receiving a message destined for itself, the peer MAY then opportunistically perform optimizations of routing to reduce distance to the sender, if necessary.
If a peer sees a blacklisted node as part of the message path, it MAY choose to stop propagating the message.
### Last hop
Using the path (or if using last sender, a number of hops), the peer MAY decide to propagate a message if it has a maximum number of hops.
To finish the propagation, the peer MAY send headers instead of the full message to all its peers. The peers MAY request the full message if they don’t get it in time (per Plumtree algorithm).
The headers are propagated further. Since the full message is no longer available, the path of peer headers is signed instead with new headers, which allows peers interested in the full message to request the full message from their immediate peer, or to perform a routing optimization to connect to one of the peers in the path with the full message.
### Origin and Last Sender
For scenarios where packet size may be very critical and network edges may be far apart, encoding an entire path could be problematic. We therefore encode the `origin` meaning the first sender of a message, and take note of the last sender, when retransmitting the message we MUST ensure that it does not get sent to the last sender or the origin.