document the wire protocol

in the messaging doc

also update the digest scheme to use sha256 and make this configurable,
since md5 is the previous default and has been shown to be bad.