separated protocol library to remove dependencies from libthryft proper