Block chain & DLT
Chapter 2:
Bitcoin
Dr. Trupti Lotlikar
Department of Information Technology
FR.CRIT, Vashi.
Introduction
• The term cryptocurrency originated from the words crypto and currency.
• Crypto means obscured or hidden and currency means money.
• The amalgamation of both these terms refers to encrypted decentralized digital currencies.
• Cryptocurrencies are digital in nature that are designed to be faster, cheaper, and highly
reliable. It is an open source encrypted ledger of transactions built on blockchain
technology.
• It is created via mining and users can transact directly with each other over the Internet.
Introduction
• In the world of cryptocurrency, the importance of banks to store more and facilitate
transactions is redundant.
• A cryptocurrency system is resilient against fraud as cryptocurrency users can not only
record but also verify each other’s transactions.
• The acceptance of all the nodes participating in a transaction is a must before the
transaction is committed onto a ledger.
• A ledger that is made up of digital transactions is public and secure and doesn’t require any
financial institution such as banks to offer trust; so, it is referred to as a trustless system.
4
Introduction
• Cryptocurrency is still emerging and is considered as an investment instead of a currency.
• Trading on cryptocurrency exchanges is gaining importance despite its volatile prices.
Bitcoin, Ether, Litecoin are some of the examples of popular cryptocurrencies.
Bitcoin
• Bitcoin was invented in 2008 with the publication of a paper titled “Bitcoin: A Peerto- Peer Electronic
Cash System,”written under the alias of Satoshi.
• Nakamoto combined several prior inventions such as b-money and HashCash to create a completely
decentralized electronic cash system that does not rely on a central authority for currency issuance or
settlement and validation of transactions.
• Bitcoin is a collection of concepts and technologies that form the basis of a digital money ecosystem.
• Units of currency called bitcoin are used to store and transmit value among participants in the bitcoin
network.
• Bitcoin users communicate with each other using the bitcoin protocol primarily via the internet.
• Users can transfer bitcoin over the network to do just about anything that can be done with
conventional currencies, including buy and sell goods, send money to people or organizations, or
extend credit.
• Bitcoin can be purchased, sold, and exchanged for other currencies at specialized currency exchanges
• Unlike traditional currencies, bitcoin are entirely virtual.
• There are no physical coins or even digital coins per se.
• The coins are implied in transactions that transfer value from sender to
recipient.
• Users of bitcoin own keys that allow them to prove ownership of bitcoin in
the bitcoin network. With these keys they can sign transactions to unlock the
value and spend it by transferring it to a new owner.
• Keys are often stored in a digital wallet on each user’s computer or
smartphone.
• Possession of the key that can sign a transaction is the only prerequisite to
spending bitcoin, putting the control entirely in the hands of each user.
• Bitcoin is a distributed, peer-to-peer system. As such there is no “central”
server or point of control.
• Bitcoin are created through a process called “mining,” which involves
competing to find solutions to a mathematical problem while processing
bitcoin transactions.
• Any participant in the bitcoin may operate as a miner, using their computer’s
processing power to verify and record transactions.
• Every 10 minutes, on average, a bitcoin miner is able to validate the
transactions of the past 10 minutes and is rewarded with brand new bitcoin.
• Essentially, bitcoin mining decentralizes the currency-issuance and clearing
functions of a central bank and replaces the need for any central bank.
• Bitcoin consists of:
• • A decentralized peer-to-peer network (the bitcoin protocol)
• • A public transaction ledger (the blockchain)
• • A set of rules for independent transaction validation and currency
issuance (consensus rules)
• • A mechanism for reaching global decentralized consensus on the valid
blockchain (Proof-of-Work algorithm)
Keys and Addresses
• Ownership of bitcoin is established through digital keys, bitcoin addresses, and digital
signatures.
• The digital keys are not actually stored in the network, but are instead created and
stored by users in a file, or simple database, called a wallet.
• Most bitcoin transactions requires a valid digital signature to be included in the
blockchain, which can only be generated with a secret key; therefore, anyone with a
• copy of that key has control of the bitcoin.
• The digital signature used to spend funds is also referred to as a witness, a term used in
cryptography. The witness data in a bitcoin transaction testifies to the true ownership of
the funds being spent.
• Keys come in pairs consisting of a private (secret) key and a public key.
• Public key as similar- bank account number
• Private key as similar- secret PIN, or signature on a cheque, that provides
control over the account.
• These digital keys are very rarely seen by the users of bitcoin.
• For the most part, they are stored inside the wallet file and managed by
the bitcoin wallet software
• In the payment portion of a bitcoin transaction, the recipient’s public key is
represented by its digital fingerprint, called a bitcoin address.
• Similar to beneficiary name on a check (i.e., “Pay to the order of ”).
• In most cases, a bitcoin address is generated from and corresponds to a public
key. However, not all bitcoin addresses represent public keys; they can also
represent other beneficiaries such as scripts
• This way, bitcoin addresses abstract the recipient of funds, making transaction
destinations flexible, similar to paper cheques
Private key
• A private key is simply a number, picked at random.
• More precisely, the private key can be any number between 1 and n - 1, where n is a
• constant (n = 1.158 * 1077, slightly less than 2256) defined as the order of the elliptic
• curve used in bitcoin .
• To create such a key, we randomly pick a 256-bit number and check that it is less than n - 1.
• In programming terms, this is usually achieved by feeding a larger string of random bits,
collected from a cryptographically secure source of randomness, into the SHA256 hash
algorithm, which will conveniently produce a 256-bit number.
• If the result is less than n - 1, we have a suitable private key.
• 1E99423A4ED27608A15A2616A2B0E9E52CED330AC530EDCC32C8FFC6A526AEDD example
Public Key
• The public key is calculated from the private key using elliptic curve
multiplication, which is irreversible: K = k * G, where k is the private key,
G is a constant point called the generator point, and K is the resulting
public key. A point on the curve.
• Because the generator point is always the same for all bitcoin users, a
private key k multiplied with G will always result in the same public key K.
Private and Public Keys
• A bitcoin wallet contains a collection of key pairs, each consisting of a
private key and a public key.
• The private key (k) is a number, usually picked at random. From the
private key, we use elliptic curve multiplication, a one-way cryptographic
function, to generate a public key (K).
• From the public key (K), we use a one-way cryptographic hash function
to generate a bitcoin address (A).
Cryptocurrency Wallets
• Bitcoin or any other cryptocurrency transaction can be done only using a digital wallet.
• A digital wallet or cryptocurrency wallet is a software program that stores the user’s
private and public keys enabling the user to transact crypto assets.
• It is a management system that interacts with various blockchains to enable users to
send and receive digital currency and monitor their balance.
• Cryptocurrencies are stored immutably on the blockchain using your public key, i.e.,
your public key is used by other wallets to send funds to your wallet’s address.
However, the private key is required if you want to spend cryptocurrency from your
address.
Types of Wallets
Hot Wallets
• A hot wallet is designed for online day-to-day transactions.
• It is always connected to the internet, and hence, it is a strong candidate for hackers.
Cold Wallets
• A cold wallet is a digital wallet that is not connected to the internet.
• They are not free.
• Being offline, they are more secure and used for storing cryptocurrencies long term.
Types of Wallets
• Bitcoin wallets can be categorized as follows, according to the platform:
• Desktop wallet
• A desktop wallet was the first type of bitcoin wallet created as a reference implementation
and many users run desktop wallets for the features, autonomy, and control they offer.
• Running on general-use operating systems such as Windows and Mac OS has certain
security disadvantages however, as these platforms are often insecure and poorly
configured.
• Mobile wallet
• A mobile wallet is the most common type of bitcoin wallet.
• Running on smartphone operating systems such as Apple iOS and Android.
• Many are designed for simplicity and ease-of-use, but there are also fully featured mobile
wallets for power users.
• Web wallet
• Web wallets are accessed through a web browser and store the user’s
wallet on a server owned by a third party.
• This is similar to webmail in that it relies entirely on a third-party server.
Some of these services operate using client-side code running in the user’s
browser, which keeps control of the bitcoin keys in the hands of the user.
• Most, however, present a compromise by taking control of the bitcoin keys
from users in exchange for ease-of-use.
• It is inadvisable to store large amounts of bitcoin on third-party systems
• Hardware wallet
• Hardware wallets are devices that operate a secure self-contained bitcoin wallet on special-
purpose hardware.
• They are operated via USB with a desktop web browser or via near-field-communication (NFC)
on a mobile device.
• By handling all bitcoin-related operations on the specialized hardware, these wallets are
considered very secure and suitable for storing large amounts of bitcoin.
• Paper wallet
• The keys controlling bitcoin can also be printed for long-term storage.
• These are known as paper wallets even though other materials (wood, metal, etc.) can be
• used.
• Paper wallets offer a low-tech but highly secure means of storing bitcoin long term. Offline
storage is also often referred to as cold storage.
Hot Wallets
Hot Wallets
Hot Wallets
Hot Wallets
Hot Wallets
Hot Wallets
Hot Wallets
Hot Wallets
Cold Wallets
Cold Wallets
Cold Wallets
Cold Wallets
Cold Wallets
Cold Wallets
Difference between Hot and Cold Wallets
Types of Cryptocurrency
Difference
Difference
Transactions in Blockchain
Transactions in Blockchain
Transactions in Blockchain
Components in a block
Components in a block
Components in a block
Unspent Transaction Output (UTXO)
Unspent Transaction Output (UTXO)
Unspent Transaction Output (UTXO)
Unspent Transaction Output (UTXO)
Cas
e1
https://www.bitaddress.org/bitaddress.org-v3.3.0-SHA256-
dec17c07685e1870960903d8f58090475b25af946fe95a734f88408cef4aa194.html
Cas
e1
Cas
e1
Cas
e1
Cas
e1
Base 58
• https://www.browserling.com/tools/base58-decode
Base58 is a group of binary-to-text
encoding schemes used to
represent large integers as
alphanumeric text. The Base58
encoding format is designed for use
in Bitcoin and is used in many
other cryptocurrencies.
Cas
e2
https://www.bitcoin-italia.org/bit2factor/
Bitcoin Blockchain:
Consensus in
Bitcoin
Bitcoin Blockchain:
Consensus in
Bitcoin
Bitcoin Blockchain:
Consensus in
Bitcoin
Bitcoin Blockchain:
Consensus in
Bitcoin
Bitcoin Blockchain:
Consensus in
Bitcoin
Bitcoin Blockchain:
Consensus in
Bitcoin
Bitcoin Blockchain:
Consensus in
Bitcoin
Bitcoin Blockchain:
Consensus in
Bitcoin
Bitcoin Blockchain:
Consensus in
Bitcoin
Bitcoin Blockchain:
Consensus in
Bitcoin
93
94
95
96
97
98
99
100
101
102
103
104
105
106
109
110
111
112
113
114
115
116
117
118
119
120
121
122
125
126
127
128
129
131
132
133