spec and Encoder
Simplify serialization of envelopes