Implements the bitcoin wire protocol