is there a doc of the actual protocol?
There are several layers involved (and also there are two ways to connect... websocket or zmq to the p2p cloud over python).
The protocol is not fully defined, some things are documented in the links i gave you (the more specific can be the Trollnet and DarkWallet/Identity docs), others in the code...
Right now, if you go the websocket way, then you use the chan_post and chan_subscribe ws commands as in
https://github.com/darkwallet/gateway/blob/master/client/gateway.js.
How the name and encryption, peering etc is done is now coded under
https://github.com/darkwallet/darkwallet/tree/develop/js/backend/channels (we dont use btcchan.js at the moment which is a version using bitcoin encryption...).
I will be reviewing the documentation soon so you (and us!) understand better everything. We now are more or less done with implementing functionality and will be refactoring, cleaning up and getting this into the beta stage. Also we can review and consider options about crypto primitives that we are using.