A cryptocurrency is a digital or virtual currency that uses cryptography, the process of encoding and decoding data, to secure transactions. Buying and selling is done using a blockchain, a decentralized public ledger.