EVG101 Part 1: Introduction to Bitcoin

Everest Ventures Group
EVG101
Published in
10 min readMar 11, 2019

Welcome to Part 1 of Everest’s crypto and blockchain guide! In this introductory article, we will focus on the fundamental elements upon which Bitcoin is built on. We will begin with a discussion of Bitcoin and its significance, before moving on to the cryptographic and crypto-economic elements which give Bitcoin its unique properties.

To go back to the EVG101 home page: link

To go to the next article on the people behind Bitcoin: link

Table of Contents

  1. What is Bitcoin?
  2. bitcoin or Bitcoin?
  3. What is a hash function? What is a hash?
  4. What’s in a block?
  5. Where does the word “blockchain” come from?
  6. What are public and private keys?
  7. What is a consensus algorithm and why is it important?

TLDR;

A summary of Part 1 of our guide

Without further ado, let’s get started!

1. What is Bitcoin?

Bitcoin is a digital currency, or cryptocurrency, which, unlike traditional currencies, is not issued or controlled by a centralized organization, making it the first successful decentralized currency in history. Consequently, the value of Bitcoin is determined solely by its users. The decentralized nature of Bitcoin means that no one, not even the government, can take Bitcoin away from its users. Anyone with an Internet connection can participate in the Bitcoin network. Bitcoin provides a safe haven for individuals from the overarching power of monolithic governments and corporations which dominate our world.

A network of Bitcoin nodes. Each node is a computer which is connected to other nodes in the network by downloading and broadcasting copies of the blockchain.

The Bitcoin network is made up of many nodes. Each node helps to maintain a decentralized, distributed ledger of transactions, otherwise known as a blockchain, by downloading and updating the same copy of the digital ledger. Information on every Bitcoin transaction ever made is recorded permanently on the blockchain, creating a trusted foundation to determine the validity of future transactions.

The integrity of this network is dependent on both the cryptographic properties (such as hash functions, which we will elaborate on below) of Bitcoin as well as the decentralized consensus mechanism (proof of work) which aligns the collective interests of Bitcoin users. In particular, miners in Bitcoin who help to process transactions, maintain and extend the blockchain are incentivized with bitcoin as a reward.

Cryptography and crypto-economic incentives help to propagate a virtuous cycle of Bitcoin:

The virtuous cycle which propels Bitcoin
  • People can securely exchange bitcoin with each other only because the mining process is decentralized and widely distributed, without relying on a trusted central authority
  • Which is only possible because there are lots of miners validating transactions and extending the blockchain
  • Which works only because they are incentivized by the bitcoin rewards they receive for doing it
  • Which only has value to them because people are able to exchange bitcoin with each other for items or services of value in the first place!

Bitcoin offers decentralized digital ownership. Digital assets are usually represented by lines of code which can be easily replicated. Digital assets are thus usually managed and protected by a 3rd party such as a bank. Bitcoin overcomes this, and secures digital assets by maintaining an immutable ledger recording asset transfers through a unique combination of cryptographic security and economic incentives which encourages its decentralized participants to stay honest.

2. bitcoin or Bitcoin?

In general, Bitcoin with a capital `B` refers to the entire concept of Bitcoin and its network whereas bitcoin with a lower-case `b` refers specifically to the currency.

3. What is a hash function? What is a hash?

Earlier we mentioned that one of the key elements in Bitcoin is cryptography. Merriam-Webster English dictionary defines cryptography as “the enciphering and deciphering of messages in secret code or cipher.” So why is this necessary in a decentralized open system where all of the participants can theoretically see all the transactions?

However, openness is why we exactly need cryptography. Because we want a system where we can:

  1. Prove ownership of bitcoin without having to trust a possibly malicious centralized intermediary
  2. Verify that a user possesses the money they are trying to send without disclosing their identity to participants in the Bitcoin network
  3. Protect user privacy

To do this, we need some kind of clever scheme to mask and unmask information, which is what cryptography is all about! And hashing is one of the most popular and famous techniques used in cryptography.

A hash function is a set of rules which turn a piece of information of any size into a piece of data of uniform size. The hash is the output of this function. Bitcoin uses the SHA-256 algorithm as its hash function, which produces a hash output that is represented by a 256 digit-long sequence of 0s and 1s.

In general, a cryptographic hash function has 3 properties:

  1. Consistency: Given a piece of information, the same hash will be generated
  2. Secure: a hash function is one-way; it is computationally infeasible to take a hash output and figure out what the original input was
  3. Low collision rate: The odds that two different pieces of data input will have the same hash output is very, very small

Here is an example which can help to illustrate what a hash function does. We will use the following piece of text as an input to the SHA-256 hash function:

Mary went to the supermarket and bought five apples

This is what the hash output from the SHA-256 algorithm looks like: 1101101100111110001010101100011001110100110111011011000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

And this is its hexadecimal (using 0–9 and a-f, total of 16 characters to represent each digit) representation: db3e2ac674ddaf273e3210d9c21208e6f326548f110921ff9cead7d44a37c00d

The SHA-256 hash function has the additional property that the hash output changes dramatically even when the input is modified only marginally. Using the same input as above, correcting only the word `apples` to `apple`,

Input: Mary went to the supermarket and bought five apple

New hexadecimal output: 5536acce7f9fb329e0b908fc90d43cae996ff7eb81a2c4bf04827e829316b393

Previous hexadecimal output: db3e2ac674ddaf273e3210d9c21208e6f326548f110921ff9cead7d44a37c00d

We can see that the output has changed significantly from the previous output despite only a minute change in the input text.

To try this magic out yourself, here is a link to a SHA256 hash calculator: link

You can think of your passport number as a hash: your passport number is obtained from some information (your name, date of birth, etc.) by following a set of rules.

Similarity of passport number generation process to hashing

Note how this hash fulfils the 3 aforementioned properties:

  1. Given the same information, the same passport number will be generated
  2. Given just your passport number, it is impossible to obtain the exact information used to generate it (name, date of birth etc.)
  3. Your passport number is unique

Applications of hash functions in Bitcoin:

  • Block header hash
  • Transactions are summarized with hash functions in a merkle tree (To keep this guide short, we will not explain what a merkle tree is. However, it can be thought of as a way of concisely summarizing data through a hash function)
  • Generation of public key, Bitcoin address from private key

4. What’s in a block?

Each block in the blockchain contains a block header and a set of transactions belonging to that block. The block size limit is 1 megabyte (1,000,000 bytes), with the majority of this limit being taken up by transaction data.

The actual block header has a total size of only 80 bytes. It contains:

A block header’s contents

A block may be visualized as follows:

Visualization of a block

5. Where does the word blockchain come from?

The origin of the term blockchain comes from its structure. The header of each block in the blockchain contains the hash of the previous block’s header. Consider two adjacent blocks 1 and 2 in a blockchain. The hash of the header of block 1 is located in the header of block 2. Likewise, the hash of the header of block 2 is contained in the header of the next block 3. This produces a chain of blocks which are linked by the hashes of their headers.

Detailed look at how the blocks are connected by hashes
Visualization of a blockchain

By tracing one block to the previous one and so on, one can reconstruct the entire history of the blockchain through all the transactions recorded on the blockchain. Thus, the blockchain should be thought of as a new type of data structure which serves as a database for storing transactions. A public blockchain has the added advantage of being immune to censorship, downtime, or third-party interference.

At any one point in time, there might be multiple versions of a blockchain belonging to the same network. However, only one blockchain will be accepted as the correct one through a consensus algorithm. It is important that only one blockchain is recognized by the network as the true blockchain for reasons related to reliability and security which we will explore later on.

6. What are public and private keys?

Private keys and public keys are part of a cryptographic system known as public-key cryptography. They help to secure Bitcoin transactions by ensuring that only the rightful owners of the bitcoins in question can spend them.

Why can’t we use passwords for Bitcoin?

The idea of password verification is dependent on the idea of keeping a secret. An item is encrypted with a password (encryption), and one gains access to that item by providing the same password for decryption (verification). Traditionally, a centralized entity stores passwords and verifies them for users. However, Bitcoin is a public, decentralized network with no central point of operation and no secrets. Public-key cryptography allows Bitcoin to circumvent this issue by having a public key for encryption and a private key for verification; no third-party is needed to store any information.

Private / Public Key Generation

A private key can be seen as the ultimate password. It is the most important thing you own in Bitcoin! A private key is used to generate the public key, which in turn is used to generate the Bitcoin address. The private key is also used, together with the transaction data, to generate a digital signature using ECDSA (Elliptic Curve Digital Signature Algorithm, a process involving some kind of hash function).

All bitcoins are associated with specific Bitcoin addresses. The digital signature generated from your private key is used to authorize the spending of Bitcoin associated with your Bitcoin address. Thus, anyone with control of your private keys controls the bitcoins in the Bitcoin addresses associated with those private keys.

Generation of public key, Bitcoin address from the private key

The public key is derived from the private key through a one-way process known as elliptic curve multiplication, in such a way that it is impossible to obtain the private key from the public key. The public key is used to secure outgoing transactions as well as to verify the authenticity of the digital signature, ensuring that only the designated recipient can spend the output. We will elaborate more on the role of public keys and private keys in Bitcoin transactions in Part 3 of our guide.

Likewise, the Bitcoin address is derived using SHA-256 and some additional procedures from the public key. The Bitcoin address can be thought of as a public identity of the holder of the private key. Together, the Bitcoin address, public key, and private key form a unique identity in the Bitcoin network. Every existing bitcoin is associated with a Bitcoin address, which in turn is controlled by the private key and public key associated with that address.

7. What is a consensus algorithm and why is it important?

A consensus algorithm refers to a mechanism by which multiple participants in a system achieve agreement on the validity of a piece of information, despite the presence of faulty processes or actors in the system. This provides guarantees of reliability in a network involving multiple unreliable participants.

In the context of Bitcoin and blockchain, participants in the blockchain might perceive different versions of the blockchain floating around and not know which blockchain to accept as the truth. This is problematic because bad actors in the system can take advantage of this to make transactions in which they spend the same bitcoin twice on different versions of the blockchain. There needs to be a single blockchain which everyone in the system can agree on to avoid situations like this.

A consensus algorithm is needed to choose the correct blockchain

The consensus algorithm provides a means for network participants to agree on what the next block in the blockchain should be, and which blockchain should be recognized as the truth. In Bitcoin’s case, the longest blockchain is recognized as the truth. The consensus algorithm introduced by Bitcoin has the unique trait that it is trustless: participants do not need to trust anyone else for the truth, they trust in the rules of the system (that the longest blockchain is the truth).

Ultimately, the consensus algorithm is a crucial element of any blockchain. Blockchains are a decentralized databases which provide a solid foundation for people to transact with confidence or to build apps on. By helping the network to agree on a blockchain, it allows the participants to be confident and secure in their knowledge that the information they have is correct.

We will explain how this consensus process works in subsequent sections of our guide.

Concluding Remarks

In this article, we have covered the basic features of Bitcoin. In the next article, we will elaborate on the different users and stakeholders in Bitcoin, before using this knowledge to go into more detail on the mechanisms underlying Bitcoin in the following articles.

We see this guide as a continuous work-in-progress! Please leave any questions or remarks in the comments section and we will try our best to include them in updated versions of our guide. And if you found our guide useful, please leave some claps!

For more information on Everest, please visit our website.

--

--