First commit of implementing a contract protocol - not finished