Emergence of the Social Contract