Looking at the DEVp2p protocol, I see that a peer can return info on capabilities ETH or SHH . I do not see in the protocol docs what those mean. How does a client discover if the peer is only implementing RLPx / Kademlia discovery, rather than the full Ethereum protocol?
1 Answer
The RLPx protocol suite consists of at least two protocols:
- The Kademlia like discovery protocol, that involves UDP packets that are simply signed by the nodes and not encrypted
- The RLPx/devp2p protocol, that involves encrypted TCP packets. This protocol requires a two-phase handshake. In the first phase the peers exchange the secret used to encrypt the messages, while in the latter they negotiate the capabilities (i.e. the devp2p subprotocols) that they support.
Looking at the DEVp2p protocol, I see that a peer can return info on capabilities ETH or SHH
As already said during the initial RLPx/devp2p handshake (the Hello Message) the peers exchange the info on their capabilities, i.e. the devp2p wire sub-protocols and versions that they supports:
- eth, ETH is the protocol used to exchange information about the blockchain (it has message types like GetBlocks,GetBlockHashes etc.)
- shh, whisper
- (there are also other subprotocols, e.g. les)
How does a client discover if the peer is only implementing RLPx / Kademlia discovery, rather than the full Ethereum protocol?
That said, I think that either a bootnode does not implement/answer to devp2p messages.
-
1The second bullet point for sub-protocols should be
shh
github.com/ethereum/wiki/wiki/Whisper#basic-design and not SSH. Sep 6, 2018 at 15:18 -
Yes, you are right, thank you for pointing it out ^^. They are written in lower case (at least eth and shh) (as reported here github.com/ethereum/wiki/wiki/%C3%90%CE%9EVp2p-Wire-Protocol). SSH is secure shell :)– BriomkezSep 6, 2018 at 18:05