It turns out that there are several difficult problems to be solved, though the problems vary with the type of currency under discussion. For example, bank debit cards and automatic teller cards work because they have reliable authentication procedures based on both a physical device and knowledge of a private code. Digital currency over the network is more difficult because it is not possible to install physical devices and protect them from tampering on every workstation. Credit cards over the phone network are relatively secure because phone tapping is difficult and costly, and there is no central database connected to the network that contains all of the voice-provided credit card numbers. A variety of schemes are being developed.
Many systems use forms of public key cryptography to encrypt payment records.
This is relatively straightforward for, say, credit card numbers, but becomes substantially more difficult if you want to ensure anonymity.