sszt
A human-readable serialization of ssz.
Format
The sszt
engine is written as a Serde deserializer for the recursive SsztValue
enum and should
be easily modified to support most formats supported by Serde.
Two major formats are currently supported:
- JSON
- YAML
The biggest deviations from the JSON / YAML specifications are appending the integer type at the end of the number using a string and declaring the type array (list / vector) in the first element.
Type | Representation |
---|---|
null | null |
bool | true | false |
number | "N:{u8|u16|u32|u64|u128|u256}" |
string | "string" |
vector (fixed length) | ["vector", "0:u8", "1:u8"] |
list (variable length) | ["list", "0:u8", "1:u8"] |
object | { "key1": "123:u32", "key2": ["vector", "456:u32"] } |
Examples
ssz encoding: 5c0000005000000001000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000010101010101010101010101010101010101010101010101010101010101010400000000000000
--
ssz encoding: 5c0000005000000001000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000001010101010101010101010101010101010101010101010101010101010101010400000000000000
--
ssz encoding: 0001020304100020000000
Maintainer
License
Apache 2.0