Cryptocurrency

In this chapter, we will explore the original and best implementation of blockchain technology—cryptocurrency. Cryptocurrency is much more than just a blockchain application; it makes use of cryptographic primitives such as digital signatures to achieve asset management by using atomic events called transactions. Throughout this chapter, we will be familiarized with all the concepts required to understand how cryptocurrency is different from any of the traditional digital currencies.

In this chapter, we will cover the following topics:

  • The basics of Bitcoin
  • Keys and addresses
  • Transactions
  • Mining and consensus
  • Blockchain
  • Blockchain networks
  • The creation of a simple cryptocurrency application

Bitcoin was the first successful cryptocurrency to be deployed in a decentralized network. It is the best-known cryptocurrency to date due to its resilient software and infrastructure, widespread adoption in various fields, and high market capitalization. By the end of 2017, Bitcoin had achieved a market cap of 300 billion USD, which is the highest by any cryptocurrency to date. Most of the cryptocurrencies in the market are inspired by and use similar designs to Bitcoin. We will be using Bitcoin to learn about most of the relevant concepts in cryptocurrency, and later on in this chapter, we will also implement a cryptocurrency similar to Bitcoin.

A cryptocurrency is a digital asset that uses cryptography to secure, spend, and verify its value in the transactions. The cryptocurrency could be transferred from the owner to any recipient without the need for an intermediary to settle the transactions. Although the early adoption of cryptocurrency provided a number of features, such as pseudo anonymity, lower transaction fees, and removing the need for an intermediary, it never achieved true decentralization. There were known issues, such as double-spending. This was when a single asset was transferred to multiple recipients because there was no centralized source to verify these transactions. All of these issues were addressed when a completely decentralized cryptocurrency called Bitcoin was created in 2009. This solved the double-spend issue for the first time in a decentralized network by using immutable blockchain to achieve consensus among the nodes.