||1 year ago|
|levin||1 year ago|
|.gitignore||2 years ago|
|LICENSE||4 years ago|
|README.md||1 year ago|
|peer_retreiver.py||1 year ago|
|setup.py||2 years ago|
The Levin network protocol is an implementation of peer-to-peer (P2P) communications found in a large number of cryptocurrencies, including basically any cryptocurrency that is a descendant from the CryptoNote project.
Ask a node for it's peer list, sorted on
python3 peer_retreiver.py 126.96.36.199 34567
99.48.XX.XX:34567 62.24.XX.XX:34567 93.44.XX.XX:34567 238.137.XX.XX:34567 163.86.XX.XX:34567 250.227.XX.XX:34567 [...]
A Levin header (33 bytes) looks like this:
u_int64- A levin signature.
01 21 01 01 01 01 01 01also known as 'Benders nightmare'.
u_int64- Payload size as an indicator of how many bytes to read from the network.
bool- Recipient should return data.
u_int32- The command.
e9 03 00 00- Possible commands:
1007, etc. See
int32- Return code.
u_int32- Protocol version. Usually
The payload that comes after that is a serialized Boost struct, which can be found
in the Wownero codebase, e.g:
The terminology for a (possible nested collection) of structs is called a
Section() in this module.
For the actual serialization from the perspective of Wownero, check out
For deserialization look at
Data is almost always in little-endian byte order, with the exception of keys (strings) for values in serialized structs.
Lastly, this module is presented as 'best effort' and, for example, does not guarantee that all Levin data types are supported.
- Big thanks to m2049r for his Java implementation of Levin on Monerujo (remote node finder).
© 2018 WTFPL – Do What the Fuck You Want to Public License