fix polymorphic args
minor
make binary encoding customizable at the protocol level