Mod5 Crypto Bitcoin
Mod5 Crypto Bitcoin
Mod5 Crypto Bitcoin
Technologies
History of Blockchain
• The very primitive form of the blockchain was the
hash tree, (Merkle tree).
• This data structure was patented by Ralph Merkle in
1979
• functioned by verifying and handling data between
computer systems.
• In a peer-to-peer network of computers, validating
data was important to make sure nothing was altered
or changed during transfer.
• It also helped to ensure that false data was not sent.
• In essence, it is used to maintain and prove the
integrity of data being shared.
• In 1991, the Merkle tree was used to create a “secured
chain of blocks” — a series of data records, each connected
to the one before it.
• The newest record in this chain would contain the history
of the entire chain. Thus, the blockchain was created.
• In 2008, Satoshi Nakamato conceptualized the
distributed blockchain.
• It would contain a secure history of data exchanges,
utilize a peer-to-peer network to time stamp and verify
each exchange, and could be managed autonomously
without a central authority.
• This became the backbone of Bitcoin.
• And thus, the blockchain as well as the world of
cryptocurrencies was born.
Homework for 31.11.19
• Get a picture of Satoshi Nakamato.
Key Features of Blockchain
1. Blockchain keeps a record of all data exchanges,
referred to as a “ledger” in the cryptocurrency world.
• Each data exchange is a “transaction”.
• Every verified transaction is added to the ledger as a
“block”
2. It utilizes a distributed system to verify each
transaction
• a peer-to-peer network of nodes
3. Once signed and verified, the new transaction is
added to the blockchain and can not be altered.
• The (Private , Public) Key pairs are combined for a digital
signature.
• Your public key is how others are able to identify you.
• Your private key gives you the power to digitally sign and
authorize different actions on behalf of this digital identity
when used with your public key.
• In the cryptocurrency concept, this represents your wallet
address (public key)
• Your private key is what let’s you authorize transfers,
withdrawals, and other actions with your digital property like
cryptocurrencies.
• A cryptocurrency (or crypto currency) is a digital asset
designed to work as a medium of exchange using
cryptography to secure the transactions and to control the
creation of additional units of the currency.
Homework 31.11.19
• Differentiate Conventional vs Digital Currency
Why use Cryptocurrency?
Risks Involved
• Hackers: Targets for highly sophisticated hackers, who have
been able to breach advanced security systems.
• Fewer protections: If you trust someone else to hold your
cryptocurrencies and something goes wrong, that company
may not offer you the kind of help you expect from a bank or
debit or creditcard provider.
• Cost: Cryptocurrencies can cost consumers much more to use
than credit cards or even regular cash, often due to price
volatility.
• Scams: Fraudsters are taking advantage of the hype
surrounding virtual currencies to cheat people with fake
opportunities.
• Lack of Transparency. The anonymous nature of
cryptocurrencies make transparency and accountability
difficult for consumers seeking to ensure the safety of their
investments.
Types of Cryptocurrency
Bitcoin
• Both a cryptocurrency and an electronic payment
system
• Satoshi Nakamoto in 2008
• First decentralised payment network
• System is peer-to-peer
• 21 million bitcoins
• Completely Open source
• 1BTC = $1258.48
A Simple Cryptocurrency
GoofyCoin
• The simplest cryptocurrency.
• There are just two rules of GoofyCoin.
1. A designated entity, Goofy, can create new coins
whenever he wants and these newly created coins belong
to him.
2. Whoever owns a coin can transfer it on to someone else.
Transferring a coin is not simply a matter of sending the
coin data structure to the recipient — it’s done using
cryptographic operations.
• To create a coin, Goofy generates a uniqueCoinID that he’s
never generated before and constructs the string
“CreateCoin [ uniqueCoinID ]”.
• He then computes the digital signature of this string with
his secret signing key.
• The string, together with Goofy’s signature, is a coin.
• Anyone can verify that the coin contains Goofy’s valid
signature of a CreateCoin statement, and is therefore a
valid coin.
Transaction
Eg: Goofy wants to pay money to Alice, he will:
a. Take a hash pointer to that coin
b. Make a statement that he wants to pay the coin to
Alice. He refers to Alice through her public key
c. The statement is signed by Goofy.
d. Now Alice owns the coin and can prove it. She can
present the following data structure, which is validly
signed by Goofy and points to a coin that Goofy
owned.
e. Alice can go on and use the coin however she wants,
for example can make a payment to Bob using the
same datastructure, and so on.
• To summarize, the rules of GoofyCoin are:
1. Goofy can create new coins by simply signing a
statement that he’s making a new coin with a unique
coin ID.
2. Whoever owns a coin can pass it on to someone else
by signing a statement that saying, “Pass on this coin
to X” (where X is specified as a public key)
3. Anyone can verify the validity of a coin by following
the chain of hash pointers back to its creation by
Goofy, verifying all of the signatures along the way.
Double spending problem
• This a big security problem with GoofyCoin
Goofy makes a transaction to pay Alice
Alice makes a transaction to pay Bob
Then, Alice makes another transaction to Chuck, sending the
same coin
• Both the last transactions are signed by Alice.
• If Chuck doesn't know that Alice has already sent the money
to Bob, he will think that he's the owner.
• Both the claims of Bob and Chuck to be the owner are equally
valid, since they can follow the chain till Goofy.
• That's a problem because coins are not supposed to work that
way.
• This is called double-spending attack, because Alice is
spending the same coin twice.
ScroogeCoin
Concepts are like GoofyCoin, except it will solve the
double-spending problem in a particular way.
The key idea is that Scrooge is going to publish the history
of all the transactions in a blockchain, that will be
digitally signed by Scrooge.
So anyone can check the data blocks.
Each block will have one transaction in it and a hash
pointer to the previous block in the history.
• Scrooge will take the hash pointer, which represents this
entire structure, digitally sign it and publish it.
• Now anybody can verify that Scrooge really signed this
hash pointer.
• they can follow this chain all the way back and see the
entire history of all the transactions of ScroogeCoin.
Solution to double-spending problem
• The history allows us to detect double-spending.
• Assume Alice owns a coin, and she tries to pay that coin
both to Bob and to Charlie.
• Charlie will notice that something is wrong, because he can
look into the history and see that Alice already paid that
coin to Bob.
• then everyone can see that that's a double spending and
they'll be able to reject it.
Transactions types
• In ScroogeCoin there are two kinds of transactions:
1. CreateCoins transaction
2. PayCoins transaction
CreateCoins transaction: it is possible to create multiple
coins in one transaction.
• Every coin will have a serial number, a value and an owner
(a public key of the initial owner).
• So this transaction type creates a bunch of new coins and
assigns them to people as initial owners.
• Each coin will have a unique ID
• A CreateCoins transaction is always valid, because Scrooge
said so.
• If Scrooge puts this into the history, which he signs, then it's
valid by definition.
PayCoins transaction: consumes some coins and
destroys them, and creates new coins of the same total
value, but which might belong to different people.
• So, we will have a list of the coins that are going to be
destroyed.
• Then there's a creation of a bunch of new coins, whose
total value must add up to the total of destroyed coins.
• Just like before in the CreationCoins transaction each
one has an Id, a value and a owner.
• This transaction must be signed with all signatures of
the owner of one of the destroyed coins.
• The rules of ScroogeCoin say that PayCoins transaction is
valid if four things are true:
1. the consumed coins are valid: they were really created in
previous transactions
2. double-spending check: the consumed coins were not
already been spent in previous transactions
3. the total value of the newly created coins is equal to the
total value of the destroyed coins
4. all the digital signature of previous owners are valid
• In this case Scrooge will accept it and insert this block into
the blockchain, so everyone can check it.
• In this scheme the coins are immutable, they are just created
with a specific owner and then destroyed.
• But every operation is still possible.
Eg: To subdivide a coin, is enough to create a new transaction
that consumes a coin and produces two new coins of the same
total value.
Centralization Problem
Scrooge can be a problem. Scrooge says don't worry, I'm honest.
• But if Scrooge starts misbehaving, then we're going to have a
problem. Or if Scrooge just gets bored of the whole ScroogeCoin
scheme and stops doing the things that he is supposed to do, then
the system won't operate anymore.
• The problem we have here is Centralization: although Scrooge
is happy with the system, the users of it might not be.
• In order to improve on ScroogeCoin is necessary to
decentralize the system.
• In order to do that, we need to figure out how to provide the
same services of Scrooge, but in a decentralized way, in which
no particular party is the only trusted one.
Decentralization
• An important concept, not just for Bitcoin.
• Plays an important role for different digital technologies.
• Almost no system is purely decentralized or purely
centralized.
Eg: email.
oIt is a decentralized system, fundamentally.
oIt's based on a standard spaced protocol, SMTP.
oBut, at the same time, there is a dominance of a few
different web mail providers, which are a sort of
centralized service providers.
Bitcoin decentralization
1. Who maintains the transactions ledger?
2. What is the authority that decides which transactions are
valid?
3. Who creates new Bitcoins?
4. Who determines how the rules of the system change?
5. How do Bitcoins acquire exchange value?
• Bitcoin decentralization, refers to first three aspects.
• There are other things beyond the protocol such as Bitcoin
exchanges (conversion of Bitcoins to other currencies), wallet
softwares and a variety of other services provided by specific
companies.
• So, even if the underlying protocol is decentralized, these
services, developed on top of it, may be centralized or
decentralized.
Bitcoin network
• The Bitcoin protocol works on a peer-to-peer network,
where all the users are network nodes.
• To become part of the network , download a Bitcoin
client that can run on every laptop or PC with enough
disk space.
• Currently there are several thousand of Bitcoin nodes.
• this really resembles a peer to peer decentralized system.
• Bitcoin has more components.
Bitcoin mining, that requires a very high capital cost.
It's a consequence of how the system evolved.
• So, now there's a high concentration of power in the
Bitcoin mining ecosystem, and the community
frequently sees this as quite undesirable.
• Finally there's a third aspect: updates to the software.
• While one can conceptually imagine that every Bitcoin
node will look at the Bitcoin specification, it differes in
practice.
• In fact, the community trusts the core developers.
• So they have a lot of power when it comes to
determining what Bitcoin software each of these nodes
will run on their computer.
Distributed consensus
• Key to the operation of any distributed database is a
mechanism to ensure that the nodes on the network verify
the transactions, and agree with their order and existence on
the ledger — a mechanism called consensus.