node implementation of the dhs protocol