Towards a formal definition of electronic contracts