Thanks! This could help.
This too is a good idea. The easiest “deserialization” is to use osmconvert to convert .pbf to .osm.