Block generators in Chia are clvm programs that, when run with particular arguments, produce a list of coin spends. This provides opportunity to do compression by recognizing patterns and encoding.
The standard serialization mechanism of clvm is defined here.
If you review this specification, you'll see that deserialization begins by inspecting the first byte. If the byte is 0xff
, the object is a pair. If the byte is 0x00
to 0xfb
, the object is an atom whose length is partially or fully encoded by this first byte.