Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Learn Bitcoin and Blockchain

You're reading from   Learn Bitcoin and Blockchain Understanding blockchain and Bitcoin architecture to build decentralized applications

Arrow left icon
Product type Paperback
Published in Aug 2018
Publisher
ISBN-13 9781789536133
Length 94 pages
Edition 1st Edition
Tools
Concepts
Arrow right icon
Author (1):
Arrow left icon
Kirankalyan Kulkarni Kirankalyan Kulkarni
Author Profile Icon Kirankalyan Kulkarni
Kirankalyan Kulkarni
Arrow right icon
View More author details
Toc

An introduction to cryptography and cryptocurrency

The blockchain technology is the backbone of cryptocurrency and it uses cryptography to keep the data secure. In this section of the chapter, we will discuss cryptography, cryptocurrency, and how cryptography is used in cryptocurrency implementation. We will also look into the workings of fiat currency cryptography, energy use in cryptocurrency, and also the security features of cryptography that are used. We will learn everything we need to know about decentralized digital money and its underlying architecture.

As we browse through the various parts of this section, we will learn about the history of Bitcoin, its alternative currencies, Bitcoin basics, and the technical operation of Bitcoin; then, we will browse through the technical foundation of the blockchain, the fundamentals of cryptography, and how it keeps data secure. From there, we will move on to understanding blockchain, its features, the underlying architecture on top of each Bitcoin, and how cryptocurrencies are implemented.

Workings and security of fiat currencies

Before we understand cryptocurrency, let's first look at some basic currencies used around the world. These currencies are also known as fiat currencies.

They are shown in the following diagram:

Some of the characteristics of fiat currencies are as follows:

  • These are owned by the governments of countries
  • They are centrally controlled through banks or legal entities
  • They are inflationary, meaning the value of a currency decreases
  • They include various security properties to prevent counterfeiting and cheating, but it is not impossible to counterfeit them

Since it is not impossible to counterfeit currencies, law enforcement comes into the picture to stop and prosecute those involved in counterfeiting fiat currencies. We will now look at various security features that are implemented in fiat currencies, as shown in the following diagram:

You will find two watermarks. You'll also see micro lettering and identification marks being implemented. Most of the time, fluorescent ink is used on notes for detecting notes that are fake.

Understanding cryptocurrency and its uses

Cryptocurrency is a very interesting and intriguing topic that has become a global phenomenon. It is different from all the currencies that are found all over the world. Right from the working of cryptocurrency, to who owns or controls it, its benefits and limitations, its use and much more, are all based on new ideas and processes. Let's now see a brief overview of the various features of cryptocurrency.

The main features of cryptocurrency are as follows:

  • It is a digital asset used as a medium of exchange
  • It secures transactions and controls supply by using cryptography
  • It is a subset of alternative currencies
  • In 2008, the first decentralized cryptocurrency was conceptualized
  • Cryptocurrency is digital money, while the underlying technology that enables the moving of digital coins or assets between individuals is called blockchain

Hash function

The main cryptography techniques used in cryptocurrency are a hash function and a digital signature.

Let's look at each of these briefly. The hash function is a mathematical function with the following properties:

  • Any input that we provide, be it a string, number, floating number, or anything, can be of any size
  • It produces a fixed-size output such as a 128-bit hash outcome or even a 256-bit outcome
  • It is collision-resistant
  • It hides the data within it

Let's now look at an example of a hash function in the following diagram:

Let's look at the hash function being used here. In the preceding diagram, we gave Fox, one string, as an input to the encryption module and we applied a hash function to it. It gives a specific fixed hash outcome, which is also known as a digest hash sum. Let's say we pass another statement that says The red fox runs across the ice and we apply a hash function to it. It gives us a specific hash sum, also known as a digest. Then, we add another statement, The red fox walks across the ice, and we see that it changes the hash function as the input has been changed. This is the key feature that the hash function brings.

Digital signature

This is the second building block of cryptocurrency and is digitally analogous to the hand written signatures that we usually make.

The properties of the digital signature are as follows:

  • You can create your own signatures, but they can be verified by another person too
  • The signature is tied to a particular document or message so that it cannot be used again and again for different documents and messages

Let's now look at an example of a digital signature in the following diagram:

Let's take an example and say that there is a string in the document which states that "I agree to pay $5000 for the software". Since this is the document that is being signed, we first apply a hash function to it. It gives us a hash or digest of the document, which is again fixed in size. Then, we apply our private key, or a specific key, to encrypt it and we get the outcome as a digital signature. This digital signature is signed specifically for this input, which states that "I agreed to pay $5,000 for the software".

Here, we saw how cryptography and cryptocurrency are digital assets that are widely used. We also saw how cryptocurrency uses cryptography and its techniques, such as hash functions and digital signatures.

You have been reading a chapter from
Learn Bitcoin and Blockchain
Published in: Aug 2018
Publisher:
ISBN-13: 9781789536133
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image