some  initial refactoring corresponding to  communication with  bitcoin network