An electronic cash and credit system