Bitcoin and Blockchain Fundamentals: L2 - Bitcoin Paradigm in 5Ws - Part 1 (Why, Where, Who)

Download as pdf or txt
Download as pdf or txt
You are on page 1of 60

BITCOIN AND BLOCKCHAIN FUNDAMENTALS

L2 – Bitcoin Paradigm in 5Ws | Part 1 (Why, Where, Who)

a.a. 2019-2020
2

Bitcoin in 5 Ws
§ Why?
Understand why Bitcoin has been created in the first place. Main topics covered: money features, cyberpunk movement, bitcoin
predecessors.

§ Where?
Understand what is the peer-to-peer architecture at Bitcoin basis. Main topics covered: P2P networks, Napster vs Bittorrent functioning,
Open-Source software

§ Who?
Understand how users are represented in the Bitcoin network. Main topics covered: Public-key cryptography, digital signature and money
authorization.

§ What?
Understand what is the underlying asset of the Bitcoin network. Main topics covered: digital scarcity, Proof of Work algorithm, difficulty
adjustment

§ When?
Understand how transactions chronology is kept decentralized. Main topics covered: blockchain role within Bitcoin and fee market.
3

What? Money needs scarcity


• The question “what” is all about the “thing” that we are actually transferring along with our transactions.
• In previous centralized systems like E-gold, while digital signatures were used to provide information about who was
passing value to whom, what was exchanged was defined by a centralized, trusted third party.
• In E-gold, the centralized company was issuing certificates redeemable in grams of physical gold, kept safe in a
vault managed by the centralized company itself (while occasionally audited by independent firms).

• The question “what” is relevant in a system where economic value is transmitted while it is not relevant in a
system such as BitTorrent, which we mentioned, where we transfer digital contents.
• In the digital world, producing scarcity is very difficult. Digital information is not scarce, digital information tends to
be always infinitely reproducible: I have information, I pass it, now we have two copies of information.
• On the other hand, value does not work like that: to be scarce, value essentially needs a non-reproducibility. I
must be able to give something to you that you must not be able to reproduce again.

How can we create a protocol where every single peer can independently validate what is being transmitted,
without any kind of centralized “peg” or “promise”?
4

Decentralization of the cost of money issuance


• How could we improve our system in such a way that every node could independently validate the cost of
production for any unit of value registered in the shared financial ledger? We know everybody is able to move
units of value “deposited” on an address to another address, but what are the condition for the initial deposit?
§ If the answer was “the ones defined by a centralized third party” such as in typical centralized digital payment
solutions, then we would have a single point of failure again.

§ If the answer was “no condition at all”, then our system could not work: while in the context of content sharing
it’s not really so important which condition we set to upload new data in the context of a financial system this
question is actually paramount. Otherwise everybody would have strong financial incentives to initially
deposit an eventually infinite amount of value in each one of his original inputs, which would lead the
scarcity, and thus the market value, of the digital asset, eventually to zero.

• The deposit (or creation, or extraction, or issuance) condition must be temporal in nature, in order to determine a
rate of “money production” which is not going to diverge to infinite. The rate of deposit could be associated to
the rate some event which occurs outside the system.

Proof of Work
5

Proof of Work [1/3]


• A Proof of Work system (or protocol, or function) is an economic strategy used to deter some service abuses, by
requiring some “work” from the service requester, usually meaning processing time by a computer.
• A key feature of these schemes is their asymmetry: the work must be moderately hard (but feasible) on the
requester side (otherwise it would not limit the service requests), but very easy to check for the service provider
(otherwise the latter would have to spend a lot of work to know if the requester deserves the service, opening up a
vulnerability to denial of service attacks).
• This idea is also known as a “CPU cost function”, “client puzzle”, “computational puzzle” or “CPU pricing function”. It is
comparable with a Sudoku or with Crosswords: games where finding the solution requires a lot of trial and error,
while verifying that some solution is correct, once it has been found, it is trivial and very quick.
• The popular PoW system that Bitcoin is inspired to was called “Hashcash”: it used hash functions in order to prove
the amount of computational work spent. A hash function is simply a function that takes in input value, and from
that input creates an output value deterministic of the input value. For any x input value, you will always receive
the same y output value whenever the hash function is run. In this way, every input has a determined output.
• Specifically, it used “hash collision”, which is a kind of brute force attack where a machine automatically tries out a
solution, over and over again with little changes every time, until the resulting hash function for one of the messages
finally respects some kind of constraint.
6

Proof of Work [2/3]


• If you want to “deposit” digital assets on the ledger, you have to create a “deposit” transaction with some output
towards addresses you control, but we no input at all (this “special” kind of transaction is called “coinbase”) and you
have to perform an hash of it, adding random numbers before applying the hash function over and over again,
until the resulting hash, for some of the numbers, gets the “right” result.
• The hash is a deterministic and irreversible cryptographic footprint that from a certain document leads us to a
certain result, and this hash is easy to verify once we have the document, but it is not possible to go back to the
hashed document from the hash only.
• What you are asked to do, in order to “deposit” bitcoins, is to make several attempts by adding a random
number to your “deposit” string, and then by changing this number until that the cryptographic footprint of
our deposit, the hash, is verifiably smaller than a certain number called "difficulty". While you are free to move
your digital assets already registered in the ledger freely (just signing and broadcasting a transaction), the only way
you have to “deposit” some new asset is by performing a double iterated SHA-256 hash collision.
• SHA-256 is a type of “Secure Hash Algorithm 2” (SHA-2), a set of cryptographic hash functions designed by the
United States National Security Agency (NSA).
7

Proof of Work [3/3]


Let’s do an example!
• Input string: "Hello, world!". Our target is to find a variation of it that SHA-256 hashes to a value smaller than 2^240.
• We vary the string by adding an integer value to the end called a nonce and incrementing it each time, then
interpreting the hash result as a long integer and checking whether it's smaller than the target 2^240. Finding a
match for "Hello, world!" takes us 4251 tries.

• "Hello, world!0" à 1312af178c253f84028d480a6adc1e25e81caa44c749ec81976192e2ec934c64 = 2^252.253458683


"Hello, world!1" à e9afc424b79e4f6ab42d99c81156d3a17228d6e1eef4139be78e948a9332a7d8 = 2^255.868431117
"Hello, world!2" à ae37343a357a8297591625e7134cbea22f5928be8ca2a32aa475cf05fd4266b7 = 2^255.444730341 ...
"Hello, world!4248" à 6e110d98b388e77e9c6f042ac6b497cec46660deef75a55ebc7cfdf65cc0b965 = 2^254.782233115
"Hello, world!4249" à c004190b822f1669cac8dc37e761cb73652e7832fb814565702245cf26ebb9e6 = 2^255.585082774
"Hello, world!4250" à 0000c3af42fc31103f1fdc0151fa747ff87349a4714df7cc52ea464e12dcd4e9 = 2^239.61238653
• In Bitcoin the hash value is also used as a reference, so somebody might say that their transaction has been mined
into block (we will see what a “block” is answering the “when” question) with
hash 0000c3af42fc31103f1fdc0151fa747ff87349a4714df7cc52ea464e12dcd4e9.
8

Proof of Work - Tradeoff


• In exchange for decentralized issuance of digital scarcity, you have to pay a cost. While other trade-offs of other
pieces of technology in Bitcoin are very often ignored, if not even denied, the specific trade-off suffered the opposite fate:
it’s often acknowledged, but in exaggerated and distorted form, giving space to some serious misconceptions and some
ill-advised urban legends.
• The cost you have to pay is “waste”. You have to “waste” energy, basically, to produce the PoW.

• But this is a requirement, not a bug. It’s by design, not by accident. The only way to make something hard to
produce, is to make it expensive to produce. There’s no other way around.

• First, energy in PoW is not any more “wasted” than in any other production process for any other (physical or intellectual)
good: it’s actually used.
• Second, the consumption of energy is likely going to remain lower than historical alternatives (order of magnitude less
than the energy consumption for gold extraction during the gold standard, for example).
• Third, entrepreneurs generating PoW in to get bitcoins aren’t incentivised to consume more energy: if anything, ceteris
paribus, they are incentivised to consume less energy for the same computation (for them energy is a cost, not a
revenue), increasing optimization and efficiency with new technological breakthroughs or with generation choices that can
have a waterfall effect on other energy-consuming industries.
9

…but Proof of Work is not enough.


• But this proof of work, by itself, is not enough to guarantee a form of money that is actually “hard money”, as in hard to
create.
• The PoW, by itself, does not guarantee that the supply of “digital gold” remain inelastic with respect to the
demand. Gold has a very important characteristic: if the demand for gold from the market increases, and therefore the
price increases, then also the production of gold in the mines slightly increases but not in the same way, because there
are fixed costs, expanding gold mines is a slow process, and the stock to flow ratio is very high, so there is some
inelasticity of supply compared to the demand, which makes gold a pretty “hard” form of money.
• PoW systems does not have this characteristic of inelasticity. In fact the PoW model had the characteristics of
being substantially very “inflationary”, because with the increase in computing power, with the improvement of computer
performances, with incentives to perform more PoW in case RPoW tokens started to be used as money, supply was
necessarily going to increase more and more, making those same token worth less and less, in a typical “stability trap”.
• As a result, when Satoshi Nakamoto had to deal with the problem of bitcoin scarcity and bitcoin production costs, he
added a peculiarity to the traditional PoW idea.

An algorithm of automatic adjustment of difficulty based on the supply itself.


10

Algorithmic difficulty adjustment (plus halving)


Algorithmic difficulty adjustment

• Whenever more bitcoins than a certain target are deposited on the register, then more computing power is
requested to make the next deposits. Whenever fewer bitcoins than a certain target are deposited on the register,
then less computing power is requested to make the next deposits.
• The difficulty target your hash has to meet, increases with the increase in production, decreases with the
decrease in production. This makes for an almost perfectly inelastic supply.

+
Algorithmic difficulty adjustment

• Every “era” of about four years, the stable supply rate is cut in half, eventually approaching a fixed stock with zero
flow. This makes bitcoin the first case in history of an asset with almost totally inelastic production compared to the
demand.
• The Bitcoin system always tends to make it harder to create new bitcoins, when there are many people who
compete to create new bitcoins, and to make it easier when there are fewer people competing, or anyway when
technological means are less developed.
11

Algorithmic difficulty adjustment - Tradeoff


• Difficulty adjustment is fundamental, because without it if we could not have “hard money”. But it requires a long, difficult
process of price discovery for this new “digital gold”, which is right now only at the beginning, with a very unstable
and very speculative demand.
• The price discovery process, that the market is still trying to perform on bitcoin, is slow and painful, as we know from
the huge volatility that affects bitcoins. It is a new financial asset, after all, with little history, of which the market does not
yet perceive the value in a stable manner.
• People implemented mining software leveraging powerful GPUs and now very specialized (and unfortunately very
centralized as for production) single-purpose ASICs. Right now, mining is a very risky, strategic and capital
intensive business: you can try to mine for fun, or for altruistic reasons (to “sustain the network), or for research
reasons. But not likely to make money out of it. If you think you are making profit, probably you are just because the
bitcoins you mine are going up in price, and you would be comparatively better off just buying instead of mining.
12

Bitcoin as digital gold


• The Bitcoin system always tends to make it harder to create new bitcoins, when there are many people who
compete to create new bitcoins, and to make it easier when there are fewer people competing, or anyway when
technological means are less developed.
• The way it actually works in Bitcoin is like this: 1 new “coinbase”, with block subsidy starting at 50 “units” and
decreasing every 4 years, can be “extracted” every 10 minutes on average. If it gets extracted more frequently
(because more people has incentives to try, with more hashing power deployed, either because the cost of computing
power is going down or the demand for the digital assets is going up), the difficulty increase, if it gets extracted
less frequently, it decrease.
• The rate of deposits is adjusted every 2016 of them, to aim for a constant two weeks adjustment period, which
means the deposits are kept close to an average of 6 per hour, or 1 for 10 minutes.

• The number of “units” generated is set to decrease geometrically, with a 50% reduction every 210,000 deposits
(or approximately four years). There will be a maximum of 2,099,999,997,690,000 “atomic” elements of value
(named “satoshis”, in collective homage to the original creator), which are currently most commonly measured in
aggregated units of 100,000,000, known as “one bitcoin”.
• It’s important to note that is not necessary to spend “whole bitcoins”: the divisibility of bitcoin units is extreme,
since we can spend one hundred millionth of 1 bitcoin.
13

When? Money needs chronology


• When we transmit value using PayPal, every time we spend euros, dollars on our account of our online payment
system, the central server managed by the company eliminates the money that we have already spent preventing us
from spending it again.
• In Bitcoin there is no company and no central server, so who defines the chronology of events? Without a defined
chronology, we have a problem that is called the problem of double-spending, that is, each of us can try to spend
units more than once, and the network has no way to converge over the one valid transaction to consider “confirmed”
again the others.
• If the network could somehow vote, maybe they could reach a consensus about chronology. But a simple voting
process, while it would be more than enough in a system with fixed, known players (often called “federation”), would
be unfeasible in a system composed of a dynamic set of unknown players. We cannot just use “node count” as a
proxy for our voting rights, since every single user could pretend to “be” millions of different nodes, maybe just using
some cheap virtual servers, in what is known as “Sybil attack”. We need another strategy, which is “Sybil-resistant”
in the context of the dynamic turn-over of hundreds of thousands of unknown, anonymous users.

When is the value actually transferred? When is value actually deposited?


14

Decentralization of chronological commitments


We need a way to push all the nodes to find (and keep) consensus over one single, consistent, immutable history
of asset transactions. Satoshi Nakamoto is, historically, the first person coming up with a solution to this problem in a
fully decentralized context. The solution is not “mathematical” (a true mathematical solution for this problem can be
actually shown to be impossible), but “statistical”, “asymptotical” and “economical” in nature.

block chain (or time chain)


15

Block chain [1/3]


• Every time a miner has to deposit new bitcoins, proving he has solved a cryptographic puzzle which includes his own
coinbase transaction, inside this cryptographic puzzle he now commits to something else as well. He does not input,
as a content of his message to be hashed, only the deposit of the new bitcoins he assigns to himself (for example new
12.5 bitcoins to my address at this time), but instead he inputs a “block” of information containing, along with that
coinbase (depositing what is now called “block reward”), also a collection of some of the transactions it sees
inside the system, and, even more importantly, the hash of the previous block of transactions, which had
been found by other miners 10 minutes before (on average).
• So now we have a block that contains:
• A reference to the previous block found by the miner 10 minutes ago;
• The transaction in which the miner assigns to himself the new generated bitcoins; and

• A list of some of other people's transactions already signed and broadcasted in the network.
• This is very important because it means that, from the economic point of view, all the actors are incentivized to
converge on the same time-line, on a coherent version of the same chronology.
16

Block chain [2/3]


• The problem in general does not have a strict mathematical solution, but Satoshi Nakamoto found an economic
solution:
§ if I am a miner, I could include in my block a transaction that contradicts (double-spends) another one in the
past, but then other nodes would consider my block invalid, and I would also lose the value of the new
coinbase I put in that block.

§ Since I have spent money, time, electricity, to find the correct hash, to solve the cryptographic puzzle, I
do not want, in the face of this expenses, to earn nothing.
§ I spent money to be a miner, I want to make money with the new bitcoins I deposited.
• Thus I have an incentive to create a block that is not invalid: this means if a valid transactions is included in a block by
a miner, the next block including that one, and the next one including both, and so on, will each guarantee an always
greater cost to change the past.
• Changing a transaction that has been “buried” under a block is relatively expensive, but changing a
transaction that has been “buried” under, say, 6 blocks, is extremely expensive and usually not feasible at all
from an economic point of view.
17

Block chain [3/3]


• In Bitcoin, the actual “block chain” data structure starts from what is called the “Genesis block”, directly created by
Satoshi Nakamoto during the bootstrap of the system. Modern versions of Bitcoin number it as block 0, though very
early versions counted it as block 1.
• The genesis block is almost always hardcoded into the Bitcoin software or applications. It is a special case of block,
in that it does not reference a previous block (of course, being it the first) and it produces an unspendable block
reward.
• The coinbase parameter contains, along with the normal data, the following text: “The Times 03/Jan/2009 Chancellor
on brink of second bailout for banks”. This was probably intended as proof that the block was created on or
after January 3, 2009, as well as a comment on the instability caused by bank bailout under fiat money paradigm.
18

Block chain – Tradeoff


• The last trade-off we have to make in the sense of transaction costs and times, in order to get decentralization of
chronology. Using a blockchain means that every node in the network must keep forever every change of system
state, so every on-chain transaction, every single one, must be retrieved, downloaded and verified by every
actor who will use Bitcoin for the whole history of the system, even in the far future.
• A person who will install and run Bitcoin in the year 2099, will have to download every transaction of those who bought
a coffee in 2019. This clearly greatly limits its “ “darkness”: we said that Bitcoin is born to be something as private
and as fungible as gold, but this fungibility and this privacy are not really guaranteed if everyone has to keep a
copy of every transaction forever. That's why in reality many of the bitcoin evolutions have nothing to do with the
use of “the blockchain”, but instead with the attempt to limit the use of blockchain.
• It’s noteworthy that the “when” problem represents the first time a “block chain” is actually mentioned, and that many
limitations Bitcoin faces are caused by this technology, not mitigated by it: it’s a global consensus system,
meaning that every node must validate forever all the state changes of the system, thus it’s not easy to scale or to
keep private.
• Indeed, the future of Bitcoin’s evolution isn’t at all about “Blockchain without Bitcoin”, as you can read in some
clueless claims, but mostly about “Bitcoin without Blockchain”.
19

Decentralization of incentives to inclusion


• There is a problem of incentives for miners to include your transactions. Example:
• You are buying something on an e-commerce,
• You create a bitcoin transaction,
• You sign with your secret key, so you produce a valid digital signature that everyone can verify,
• You send this transaction around to confirm to everyone how much you decided to pay to the online store, in
order to receive some goods or services in return.
• The online store waits for a miner to include your payment within the next block, so that he can be sure that you
will not be able to get another transaction confirmed that gives you back the money.
• But what is the incentive for miners to really put your transaction in their block? They just want to create a valid
block that contains the deposit of their new bitcoins. Why should they include your transaction, or new
transactions at all? They have no incentive to do it, except “altruism” or “for the good of the system”. Maybe many
miners would opt to save computing needed to verify scripts and signatures (which, while not being as much as the
one needed for hash collision, is still a lot) and to only include their own valid coinbase.

Miner Fees
20

Miner Fees [1/2]


• Fees are something that you attach to transactions to incentivize miners to actually include it in their blocks.
The higher the fee you chose, the higher the incentive to be included for your transaction. The space inside
the blocks is not infinite and the number of blocks per second is not infinite as well (a block every 10 minutes
on average), so there is a sort of auction, a sort of competition to enter this block. The more you pay, the more
the miners have incentive to include you in the next block.

• The way miner fees work in Bitcoin is this: the system grant permission to miners to include in their coinbase,
along with the current valid “block subsidy” of newly “minted” 12.5 bitcoin, also the difference between outputs and
inputs of all the valid transactions included in the block.
• From a technical point of view, what happens is that, instead of assigning to specific outputs all the bitcoins consumed
in your transaction inputs, you will save some. So when miners find a block, in their initial deposit transaction, they do
not just enter the new bitcoins to be put into circulation, but they also enter the whole difference between the
bitcoins consumed and the bitcoins received in all the transactions included.
• Every Bitcoin transaction spends zero or more bitcoins to zero or more recipients. The difference between the amount
being spent and the amount being received is the transaction fee (which must be zero or more).
21

Miner Fees [2/2]


• Bitcoin's design makes it easy and efficient for the spender to specify how much fee to pay, whereas it would be
harder and less efficient for the recipient to specify the fee, so by custom the spender is almost always solely
responsible for paying all necessary Bitcoin transaction fees.
• The minimum fee necessary for a transaction to confirm varies over time and arises from the intersection of supply
and demand in the market for “block space”.

• On the supply side, Bitcoin has a maximum block size that limits the maximum amount of transaction data that can be
added to a block. But blocks are not produced on a fixed schedule (the system targets an average of one block every
10 minutes over long periods of time but, over short periods of time, a new block can arrive in less than a second or
more than an hour after the previous block), so, as the number of blocks received in a period of time varies, so does
the effective maximum block size.

• On the demand side of Bitcoin's free market for block space, each spender is under unique constraints when it
comes to spending their bitcoins. Some are willing to pay high fees; some are not. Some desire fast confirmation;
some are content with waiting a while. Some use wallets with excellent dynamic fee estimation; some do not. In
addition, demand varies according to certain patterns, with perhaps the most recognizable being the weekly cycle
where fees increase during weekdays and decrease on the weekends.
22

Bitcoin Paradigm in 5Ws - Recap


• Bitcoin is composed by several pieces each one solving a specific problem. These are the following technological (and non) stacks used in Bitcoin:

§ A peer to peer network: This technology is used to make sure that there is not a single point of failure in the distribution of the data. Peers are equally
privileged, equipotent participants in the network. There is not a single server connected to many clients: every node of the network is, in a way, a
server for other nodes, and a client at the same time.
Problem solved: data centralization and single point of failure.

§ Decentralized source code: A free open standard (i.e. FLOSS development) is required to always be able to independently review and audit the
source code eliminating any central point of failure. This building block is not only technical but it’s legal as well. In order to leverage the decentralization
of source code, indeed, it’s not enough that many people are able to access it from a practical point of view, but it’s also important that they can share
their review freely without excessive legal concerns or risks.
Problem solved: code centralization and single point of failure.

§ Digital Signatures: This is a mathematical scheme used to verify the authenticity of digital messages or documents. No trusted parties are needed.
Problem solved: identity management and single point of failure.

§ Proof of Work: it is an economic strategy used to deter some service abuses, by requiring some computational work from the service requester.
usually meaning processing time by a computer.
Problem solved: digital scarcity.

§ Difficulty Adjustment (plus Halving): the Bitcoin protocol adjusts the difficulty of finding blocks by changing the range of the possible (random)
solutions that miners are trying to guess.
Problem solved: money supply elasticity.

§ Blockchain and Miner Fees: it is the data structured at Bitcoin basis composed of different block of transactions saved in a chronological way.
Problem solved: decentralization of chronology and single point of failure
23

Experimenting on the Bitcoin testnet


24

Bitcoin addresses, wallets and seeds


A Bitcoin address is an identifier of 26-35 alphanumeric characters (beginning with 1, 3 or bc1) that represents a possible
destination for a bitcoin payment.

N.B.
• Bitcoin addresses consist of random digits and uppercase and lowercase letters, with the exception that the uppercase
letter "O", uppercase letter "I", lowercase letter "l", and the number "0“, that are never used to prevent visual
ambiguity.
• Addresses starting with 1 or 3 are case-sensitive.
• For privacy purposes, a Bitcoin address should never be used twice.
• Bitcoin addresses should be always generated offline.
• A Bitcoin address is not the public key related to its private key, but a hashed version of it.
25

Bitcoin addresses, wallets and seeds


From a practical point of view, a Bitcoin address must fulfill only one task: to make it possible for its owner to send and
receive bitcoins. However, there are different types of address that present slightly different features:

Standard address – Multisig address – New multisig address –


Pay-to-Pubkey Hash (P2PKH) Pay-to-Script Hash (P2SH) Bech32

The original and most common An address secured in various A newer version of the P2SH
format for Bitcoin addresses. A unusual ways, for example format that improves security.
P2PKH address always start requiring more than a private Still not recognized by many
with 1. key to be managed. A P2SH Bitcoin services. A Bech32
address always start with 3. address always start with bc1.
Ex.
1BvBMSEYstWetqTFn5Au4m4 Ex. Ex.
GFg7xJaNVN2 3J98t1WpEZ73CNmQviecrnyi bc1qar0srrr7xfkvy5l643lydnw9r
WrnqRhWNLy e59gtzzwf5mdq
26

Bitcoin addresses, wallets and seeds


A Bitcoin wallet is a collection of private keys but may also refer to client software used to manage those keys and to
make transactions on the Bitcoin network.

Browser-based Wallet Smartphone-based Wallet


A web service to store bitcoins A variant of the software at the
online; a third party will keep basis of desktop-based
your balance on your behalf. wallets, optimized to be
Ex. Blockchain.info, deployed on smartphones.
Exchanges and Services Ex. Mycelium, BRD,...

Desktop-based Wallet Hardware Wallet


Software that allows you to be A special type of bitcoin wallet
in full control of your coins (so which stores the user's private
long as you keep your wallet keys in a secure hardware
file secret and secure). device.
Ex. Bitcoin Core, Electrum, ... Ex. Trezor, Ledger,...
27

Receiving and checking a transaction


HOW TO RECEIVE A PAYMENT ON THE BITCOIN TESTNET

1) In Electrum, in the lower application tab, select «Receive»


2) Copy your testnet address (alphanumeric code starting with m- or n-) into the previous
Notepad file and save
3) Open a web browser and type «https://testnet-faucet.mempool.co/»
4) Paste the address in the «address» blank space
5) Select 0.01 as the amount
6) Solve the Captcha and press «Send»
7) Copy the transaction ID in the notepad file and save

HOW TO CHECK THAT A TRANSACTION TOOK PLACE

1) In your web browser, type «https://live.blockcypher.com/btc-testnet/»


2) Copy the transaction ID that you previously saved in your «Notes» file in the top right corner of
the page and search
3) Check if you received the Testcoin (typically, a transaction requires 10 to 20 minutes to be
inserted into a block)
28

Exploring the blockchain


Block explorers are online blockchain browsers which display the contents of individual Bitcoin blocks, the complete
history of all the transaction ever happened on the blockchain, and the balances of all the addresses ever used.

Height: The number of blocks preceding a


particular block
Age: Time of block retrieval
Transactions: Number of TXs in the block
Total Fees: Sum of the fees paid
Block Size: Dimension of the block

TX ID

RECIPIENT

SENDER
UNSPENT INPUT
29

Signing messages and sending a transaction


As already said, the public key in Bitcoin is mainly used to sign a transaction. Using the public key as a digital signature
allows other users to check the validity of a transaction or even only who was the original sender of a message.
HOW TO SIGN AND VERIFY A MESSAGE

1) In your notepad file, copy your testnet address


2) In Electrum, in the upper application tab, select «Tools»
3) From the drop down menu, select «Sign/verify Message»
4) In the «Message» blank space, copy «I am Name Surname, today is 31/05/2019 and I am very
happy to attend this course»
5) Paste your address in the Address blank space
6) Press «Sign» to generate your signature

HOW TO SEND A TRANSACTION

1) In Electrum, in the lower application tab, select «Send»


2) In the «Pay to» blank space, copy the following address:
tb1qxep9hz0mlc0l2p7njt8kzrw876gljk5rc56we9
3) In «Amount», press on «Max»
4) Move the fee slider all on the right
5) Press «Preview», check that all the data are correct and then press «Send»
30

Managing Bitcoin in real life


31

Managing Bitcoin in real life


32

Managing Bitcoin in real life


33

Managing Bitcoin in real life


34

Managing Bitcoin in real life


35

Managing Bitcoin in real life


36

Managing Bitcoin in real life

TRADING WEB-BASED
PLATFORM WALLET

ENTRY POINT OPTIONAL


TO CRYPTO FEATURES

USER
ACCOUNT
37

M 20
A 1
Y 8
15
TH
Cryptocurrencies exchanges

Founded: 2017 Founded: 2014 Founded: 2013 Founded: 2014 Founded: 2017
Headquarters: Malta Headquarters: China Headquarters: China Headquarters: HK Headquarters: KR
Crypto traded: Crypto traded: Crypto traded: Crypto traded: Crypto traded:
100+ 100+ 100+ 30+ 100+
Daily Volume (est.): Daily Volume (est.): Daily Volume (est.): Daily Volume (est.): Daily Volume (est.):
2-4 billion 2-4 billion 1.5-3 billion 1-2.5 billion 1.2-1.3 billion
Accepts fiat: No Accepts fiat: Yes Accepts fiat: Yes Accepts fiat: Yes Accepts fiat: Yes

Founded: 2013 Founded: 2011 Founded: 2014 Founded: 2014 Founded: 2011
Headquarters: KR Headquarters: USA Headquarters: USA Headquarters: USA Headquarters: USA
Crypto traded: Crypto traded: Crypto traded: Crypto traded: Crypto traded:
20+ BTC, ETH, LTC, BCH 100+ 30+ 10+
Daily Volume (est.): Daily Volume (est.): Daily Volume (est.): Daily Volume (est.): Daily Volume (est.):
700-800 million 300-400 million 300-400 million 350 million 300 million
Accepts fiat: Yes Accepts fiat: Yes Accepts fiat: No Accepts fiat: No Accepts fiat: Yes
38

What is the value of a cryptocurrency’s network?


39

Google searches explain 91% of Bitcoin movements!


40

Correlation is not causality


41

Are there economic fundamentals justifying the Bitcoin prices’ trend?


42

In a long-run equilibrium, price equals marginal cost


43

A cointegration model to determine the equilibrium price of


BTC

Newly-minted coins Cost of electricity

Transaction fees Amortization and renovation of hardware


44

M 20
A 1
Y 8
15
TH
Breaking down Bitcoin mining: some numbers

N.B.: The hash rate represent the number of combinations tried per second to solve the Bitcoin block puzzle. 30
million TH/s means every second miners try around 30,000,000,000,000,000,000 combinations. Today, mining requires
specifically engineered hardware; reaching the same hash rate with commercial hardware would be almost impossible,
and terribly inefficient in terms of energy consumption. For example, 45 TH/s is the raw computational power that will be
provided by 100 billion PS4!
45

M 20
A 1
Y 8
15
TH
Breaking down Bitcoin mining: some numbers
Estimated Bitcoin Network Energy Consumption
(in TWh per year)
Source: DEVO Lab, 2018

60

50

40

30

20

10

0
8-ago-14 8-nov-14 8-feb-15 8-ma g-15 8-ago-15 8-nov-15 8-feb-16 8-ma g-16 8-ago-16 8-nov-16 8-feb-17 8-ma g-17 8-ago-17 8-nov-17 8-feb-18 8-ma g-18

N.B.: 50-60 TW/h per year is the range of electricity consumption of countries such as Czech Republic or Switzerland.
46

M 20
A 1
Y 8
15
TH
Breaking down Bitcoin mining: some numbers
47

Bitcoin: equilibrium vs. effective price

nov-13 mag-14 nov-14 mag-15 nov-15 mag-16 nov-16 mag-17 nov-17 mag-18
Price Equilibrium price
48

Limitations and further researches

Off-chain solutions Systemic acceptance Commodity or currency


49

M 20
A 1
Y 8
15
TH
Different market, different rules

16,477.60$
17,527.30$

Legal

Variously regulated or unregulated

Regulated, with limitations

Illegal
50

Paying with Bitcoin


51

Paying with Bitcoin

2010-2011

2012-2014

2015-2017

On May 22nd, 2010, Laszlo Hanyecz (username laszlo on the popular


Today forum bitcointalk) made the first documented purchase of a good with
Bitcoin, buying two Papa John’s pizzas for 10,000 BTC.
52

Paying with Bitcoin


The original ad from one of the first businesses
2010-2011 to accept Bitcoin, Grass Hill Alpacas farm in
Massachusetts, USA. In 2011 David Forster, son
of the couple who ran the farm, persuaded his
parents to let him sell their alpaca socks in
exchange for bitcoins.

2012-2014

2015-2017

Today
53

Paying with Bitcoin

2010-2011

2012-2014

2015-2017

Silk Road was an online black market and the first modern darknet
market, best known as a platform for selling illegal drugs, shut down
Today by the FBI in 2014. All the transactions happening on the Silk Road
were being conducted with bitcoins.
54

Paying with Bitcoin

2010-2011

2012-2014

2015-2017
Crypto-based debit and credit cards allow their holders to spend bitcoins (or
other cryptocurrencies) in any POS-equipped shop. When purchasing, the
company that issues the card offers a real time conversion service between
fiat and crypto currencies. However, at the beginning of 2018, a breakdown
Today by Visa and other major international banking companies left many of these
services inoperative.
55

Paying with Bitcoin

2010-2011

2012-2014

2015-2017

Today
56

Take home – Bitcoin jargon


57

Exercises 1 & 2
§Which of the following is a correct Bitcoin address?
a) 1M1ue2ugsCXIurUbuUNsCZB5YBHXZVKe8R
b) 3XxCukfv8wm2upzhAARdh2SspbXq862WiK1jrzYnkb0sYNp
c) bc1qwqdg6squsna38e46795at95yu9atm8azzmyvckulcc7kytlcckxswvvzej
d) bc3qar0srrr7xfkvy5l643lydnw9re59gtzzwf5mdq

§What can you buy with Bitcoin?


a) Euro, US dollars, Japanese yen, etc.
b) Illegal drugs and other illicit materials
c) Only pizzas from Papa John and Alpaca socks
d) All of the above
58

Exercise 3.1 – Who finds Satoshi finds a treasure


When Satoshi Nakamoto disappeared from the scenes in 2010, he left many mysteries behind
him. One of the most fascinating is that of Satoshi’s treasure. Having Nakamoto been the first
miner, he had the opportunity to accumulate an astonishing number of Bitcoin: the estimate is
around 1,148,800 BTC, that have never been spent and have been left dormant in their
addresses. One of the possible addresses of Satoshi’s treasure is
15LJefP26GX9CKPQM3idAVdRpQkiw9uFFa, that contains 250 BTC left untouched since 2010.
Keeping in consideration that the number of possible Bitcoin addresses is 2160, while the number
of possible private keys is 2256 (meaning some addresses are associated to more than one
private key), what is the probability of randomly finding the private key corresponding to
Satoshi’s dormant address?

a) 1.26*10-29
b) 1.37*10-34
c) 6.84*10-49
d) 8.63*10-78
59

Exercise 3.2 – Who finds Satoshi finds a treasure


§ The number of Bitcoin that will ever be mined is 21 million, and the minimum unit in which a Bitcoin can
be expressed is a Satoshi, which is equal to 0.00000001 BTC. Let’s assume the case of maximum
distribution of bitcoins (i.e. all the bitcoins have been produced and distributed in the maximum
number of addresses). What would be the probability of finding a wallet containing at least a satoshi?

a)1.43*10-33
b)1.37*10-34
c)1.81*10-62
d)8.63*10-78

N.B. Do you really want to try finding Satoshi’s treasure? The website http://www.allprivatekeys.com/ hosts an on-the-fly database with
all the possible private keys for a Bitcoin address. Pay attention, however: the database is
1,157,920,892,373,161,954,235,709,850,086,879,078,528,375,642,790,749,043,826,051,631,415,181,614,943 pages long. Good luck!
60

Generating a BTC live price ticker


1) Open Microsoft Excel
2) Go to tab «Data», then click on "New Query»
3) Select «From other origins» and then «From Web»
4) In the URL space, insert the following link: https://api.kraken.com/0/public/Ticker?pair=XBTEUR and then press
OK
5) You should now have a table: click on «Record» cell
6) In the new table, click on «Record» again
7) Now, you should have a table with a list of rows going from «a» to «o». Click on «Convert into table» in the upper
left corner
8) In the table, click on the table icon in the left corner, then «Keep bottom rows»
9) In the «Number of rows» blank space, write 1 and then press OK
10) Double click on the «Name» cell of the table and rename it in «BTC» (without quotation marks)
11) Click on «Save and upload» in the upper left corner
12) In the «Live Price» column, go to cell E3 and write down the following formula: =VALUE(xxx), where xxx is the
number of the cell with the BTC live price
13) Done! You have your first BTC tracker. By clicking on «Data», «Update all» you will have the BTC price always
updated

You might also like