Evolution of money from barter