Bitcoin: Seminar Report
Bitcoin: Seminar Report
Seminar Report
Submitted in partial fulfillment of the
requirements for the award of Degree of Bachelor of
Technology in Computer Science and Engineering
of the University of Kerala
Submitted by
HANZEL JESHEEN
(University Roll No: 12400028)
Seventh Semester
B.Tech Computer Science and Engineering
CERTIFICATE
This is to certify that this seminar report entitled BITCOIN is a bonafide
record of the work done by HANZEL JESHEEN (University Roll No. 12400028) under our
supervision and guidance, towards partial fulfillment for the award of Degree of Bachelor of
Technology in Computer Science and Engineering from the University of Kerala during the period
2012-2016.
Dr.Abdul Nizar M
Assistant Professor
ACKNOWLEDGEMENT
First and foremost I would like to express my sincere gratitude to the Seminar Coordinator,
Mrs. Reena Nair, Assistant Professor, Dept. Of Computer Science and Engineering for her
tremendous support and guidance. I would also like to thank Mr. Sreelal S, Associate
Professor and Mr. Salim A, Associate Professor who also formed the panel of faculty
assessing the seminar session.
I would also like to extend my deepest gratitude to Dr. Abdul Nizar, Professor And Head of
the Computer Science Department. I thank my friends for the continuous support throughout
the preparation.
Hanzel Jesheen
ABSTRACT
A purely peer-to-peer version of electronic cash would allow online payments to be sent
directly from one party to another without going through a financial institution. Digital
signatures provide part of the solution, but the main benefits are lost if a trusted third party is
still required to prevent double-spending. We propose a solution to the double-spending
problem using a peer-to-peer network. The network timestamps transactions by hashing them
into an ongoing chain of hash-based proof-of-work, forming a record that cannot be changed
without redoing the proof-of-work.
The longest chain not only serves as proof of the sequence of events witnessed, but proof that
it came from the largest pool of CPU power. As long as a majority of CPU power is
controlled by nodes that are not cooperating to attack the network, they'll generate the longest
chain and outpace attackers. The network itself requires minimal structure. Messages are
broadcast on a best effort basis, and nodes can leave and rejoin the network at will, accepting
the longest proof-of-work chain as proof of what happened while they were gone. The design
and technical aspects of bitcoin is the point of focus of this report rather than the socioeconomic aspects of it.
CONTENTS
Chapter No.
1.
2.
3.
4.
Title
Page No.
LIST OF FIGURES
INTRODUCTION
BITCOIN DESIGN
10
2.1. Transactions
10
11
11
2.4. Network
12
2.5. Incentive
13
CRYPTOGRAPHIC TECHNIQUES
14
14
14
15
CONCEPTS
17
17
4.2 Units
17
4.3 Ownership
17
4.4. Supply
18
4.5. Privacy
18
5.
BITCOIN NETWORK
19
5.1. Transactions
19
20
21
21
23
24
7.
SECURITY ISSUES
25
26
26
26
26
27
27
28
Conclusion
29
7.1. Disadvantages
29
30
References
31
LIST OF FIGURES
Figure No.
Title
Page No.
2.1
Bitcoin transactions
10
2.2
Timestamp server
11
2.3
12
3.1
15
3.2
15
3.3
16
5.1
Bitcoin Address
20
5.2
Bitcoin Blockchain
22
5.3
Payment Verification
25
CHAPTER 1
INTRODUCTION
In 2013 some mainstream websites began accepting bitcoins. WordPress had started in
November 2012, followed by OKCupid in April 2013, Atomic Mall in November 2013,
TigerDirect and Overstock.com in January 2014, Expedia in June 2014, Newegg and Dell in
July 2014, and Microsoft in December 2014. Certain non-profit or advocacy groups such as
the Electronic Frontier Foundation accept bitcoin donations.
In May 2013, the Department of Homeland Security seized assets belonging to the Mt. Gox
exchange. The U.S. Federal Bureau of Investigation (FBI) shut down the Silk Road website
in October 2013.
CHAPTER 2
BITCOIN DESIGN
2.1 Transactions
We define an electronic coin as a chain of digital signatures. Each owner transfers the coin to
the next by digitally signing a hash of the previous transaction and the public key of the next
owner and adding these to the end of the coin. A payee can verify the signatures to verify the
chain of ownership.
The problem of course is the payee can't verify that one of the owners did not double-spend
the coin. A common solution is to introduce a trusted central authority, or mint, that checks
every transaction for double spending. After each transaction, the coin must be returned to
the mint to issue a new coin, and only coins issued directly from the mint are trusted not to be
double-spent. The problem with this solution is that the fate of the entire
money system depends on the company running the mint, with every transaction having
to go through them, just like a bank.
We need a way for the payee to know that the previous owners did not sign
any earlier transactions. For our purposes, the earliest transaction is the one that counts, so
we don't care about later attempts to double-spend. The only way to confirm the absence of a
10
transaction is to be aware of all transactions. In the mint based model, the mint was aware of
all transactions and decided which arrived first. To accomplish this without a
trusted party, transactions must be publicly announced, and we need a system for
participants to agree on a single history of the order in which they were received. The payee
needs proof that at the time of each transaction, the majority of nodes agreed it was the first
received.
The proof-of-work also solves the problem of determining representation in majority decision
making. If the majority were based on one-IP-address-one-vote, it could be subverted by
anyone able to allocate many IPs. Proof-of-work is essentially one-CPU-one-vote. The
majority decision is represented by the longest chain, which has the greatest proof-of-work
effort invested in it. If a majority of CPU power is controlled by honest nodes, the honest
chain will grow the fastest and outpace any competing chains. To modify a past block, an
attacker would have to redo the proof-of-work of the block and all blocks after it and then
catch up with and surpass the work of the honest nodes. The probability of a slower attacker
catching up diminishes exponentially as subsequent blocks are added and with the passage of
time.
To compensate for increasing hardware speed and varying interest in running nodes over
time, the proof-of-work difficulty is determined by a moving average targeting an average
number of blocks per hour. If they're generated too fast, the difficulty increases.
2.4 Network
The steps to run the network are as follows:
1. New transactions are broadcast to all nodes.
2. Each node collects new transactions into a block.
3. Each node works on finding a difficult proof-of-work for its block.
4. When a node finds a proof-of-work, it broadcasts the block to all nodes.
5. Nodes accept the block only if all transactions in it are valid and not already spent.
12
6. Nodes express their acceptance of the block by working on creating the next block in
the chain, using the hash of the accepted block as the previous hash.
Nodes always consider the longest chain to be the correct one and will keep working on
extending it. If two nodes broadcast different versions of the next block simultaneously, some
nodes may receive one or the other first. In that case, they work on the first one they received,
but save the other branch in case it becomes longer. The tie will be broken when the next
proof-of-work is found and one branch becomes longer; the nodes that were working on the
other branch will then switch to the longer one.
New transaction broadcasts do not necessarily need to reach all nodes. As long as they reach
many nodes, they will get into a block before long. Block broadcasts are also tolerant of
dropped messages. If a node does not receive a block, it will request it when it receives the
next block and realizes it missed one.
2.5 Incentive
By convention, the first transaction in a block is a special transaction that starts a new coin
owned by the creator of the block. This adds an incentive for nodes to support the network,
and provides a way to initially distribute coins into circulation, since there is no central
authority to issue them. The steady addition of a constant of amount of new coins is
analogous to gold miners expending resources to add gold to circulation. In our case, it is
CPU time and electricity that is expended.
The incentive can also be funded with transaction fees. If the output value of a transaction is
less than its input value, the difference is a transaction fee that is added to the incentive value
of the block containing the transaction. Once a predetermined number of coins have entered
circulation, the incentive can transition entirely to transaction fees and be completely
inflation free.
The incentive may help encourage nodes to stay honest. If a greedy attacker is able to
assemble more CPU power than all the honest nodes, he would have to choose between using
it to defraud people by stealing back his payments, or using it to generate new coins. He
ought to find it more profitable to play by the rules, such rules that favour him with more new
coins than everyone else combined, than to undermine the system and the validity of his own
wealth.
13
CHAPTER 3
CRYPTOGRAPHIC TECHNIQUES
Fixed length
Deterministic
Computationally Efficent
Collision Resistant
14
known as a CPU cost function, client puzzle, computational puzzle or CPU pricing function.
It is distinct from a CAPTCHA, which is intended for a human to solve quickly, rather than a
computer.
16
CHAPTER 4
BITCOIN CONCEPTS
4.2 Units
The unit of account of the bitcoin system is bitcoin. As of 2014, symbols used to represent
bitcoin are BTC, XBT:1 Small amounts of bitcoin used as alternative units are millibitcoin
(mBTC), microbitcoin (BTC), and satoshi. Named in homage to bitcoin's creator, a satoshi
is the smallest amount within bitcoin representing 0.00000001 bitcoin, one hundred millionth
of a bitcoin. A millibitcoin equals to 0.001 bitcoin, which is one thousandth of bitcoin. One
microbitcoin equals to 0.000001 bitcoin, which is one millionth of bitcoin. A microbitcoin is
sometimes referred to as a bit.
4.3 Ownership
Ownership of bitcoins implies that a user can spend bitcoins associated with a specific
address. To do so, a payer must digitally sign the transaction using the corresponding private
17
key. Without knowledge of the private key, the transaction cannot be signed and bitcoins
cannot be spent. The network verifies the signature using the public key. If the private key is
lost, the bitcoin network will not recognize any other evidence of ownership; the coins are
then unusable, and thus effectively lost. For example, in 2013 one user said he lost 7,500
bitcoins, worth $7.5 million at the time, when he discarded a hard drive containing his private
key.
4.4 Supply
The successful miner finding the new block is rewarded with newly created bitcoins and
transaction fees. As of 28 November 2012, the reward amounted to 25 newly created bitcoins
per block added to the block chain. To claim the reward, a special transaction called a
coinbase is included with the processed payments. All bitcoins in circulation can be traced
back to such coinbase transactions. The bitcoin protocol specifies that the reward for adding a
block will be halved approximately every four years. Eventually, the reward will be removed
entirely when an arbitrary limit of 21 million bitcoins is reached 2140, and record keeping
will then be rewarded by transaction fees solely.
4.5 Privacy
Privacy is achieved by not identifying owners of bitcoin addresses while making other
transaction data public. Bitcoin users are not identified by name, but transactions can be
linked to individuals and companies. Additionally, bitcoin exchanges, where people buy and
sell bitcoins for fiat money, may be required by law to collect personal information. To
maintain financial privacy, a different bitcoin address for each transaction is recommended.
Transactions that spend coins from multiple inputs can reveal that the inputs may have a
common owner. Users concerned about privacy can use so-called mixing services that swap
coins they own for coins with different transaction histories. It has been suggested that
bitcoin payments should not be considered more private than credit card payments.
18
CHAPTER 5
BITCOIN NETWORK
5.1 Transactions
A transaction is a section of data confirmed by a signature. It is sent to the bitcoin network
and forms blocks. It typically contains references to preceding transactions and associates a
certain number of bitcoins with one or several public keys (bitcoin addresses). It is not
encrypted because there is nothing to encrypt in the bitcoin system. A block chain browser is
where all transactions are combined in the form of a block chain. They can be found and
verified. This is necessary to determine technical transaction parameters as well as verify the
details of payments.
A bitcoin is defined by a sequence of digitally signed transactions that began with its creation
as a block reward. The owner of a bitcoin transfers it to the next owner by digitally signing it
over to the next owner in a bitcoin transaction, much like endorsing a traditional bank check.
A payee can verify each previous transaction to verify the chain of ownership. Unlike
traditional check endorsement, bitcoin transactions are irreversible, which eliminates risk of
chargeback fraud.
A bitcoin is a currency object an entity which is traded, though nothing prevents trades in
fractions of, or multiple bitcoins. Bitcoins are intended to be fungible, though each has its
own distinct history.
Although it would be possible to handle bitcoins individually, it would be unwieldy to make a
separate transaction for every satoshi in a transfer. Transactions are therefore allowed to
contain multiple inputs and outputs, and in that way bitcoins can be split and combined.
Common transactions will have either a single input from a larger previous transaction or
multiple inputs combining smaller amounts, and one or two outputs: one for the payment, and
one returning the change, if any, back to the sender. Any difference between the total input
and output amounts of a transaction is offered to miners as a transaction fee.
Transaction confirmation is needed to prevent double spending of the same money. After a
transaction is broadcast to the Bitcoin network, it may be included in a block that is published
to the network. When that happens it is said that the transaction has been mined at a depth of
1 block. With each subsequent block that is found, the number of blocks deep is increased by
one. To be secure against double spending, a transaction should not be considered as
confirmed until it is a certain number of blocks deep. This feature was introduced to protect
19
the system from repeated spending of the same bitcoins (double-spending). Inclusion of
transaction in the block happens along with the process of mining.
The classic bitcoin client will show a transaction as "unconfirmed" until the transaction is 6
blocks deep. Sites or services that accept bitcoin as payment for their products or services can
set their own limits on how many blocks are needed to be found to confirm a transaction. The
number six was chosen deliberately: it is based on a theory that there's low probability of
wrongdoers being able to amass more than 10% of the entire network's hash rate for purposes
of transaction falsification and an insignificant risk (lower than 0.1%) is acceptable. For
offenders who don't possess significant computing power, 6 confirmations are an
insurmountable obstacle. In turn any party having more than 10% of the network's computing
power will not find it difficult to achieve 6 confirmations in a row. However to obtain such a
power would require millions of dollars' worth of investment, so the risk of an attack is
deemed minimal. Bitcoins that are distributed by the network for finding a block can only be
used after 100 confirmations e.g. 100 discovered blocks. The classic bitcoin client won't
display the coins earned for solving a block until there are 120 confirmations.
The ability to transact bitcoins without the assistance of a central registry is facilitated in part
by the availability of a virtually unlimited supply of unique addresses which can be generated
20
and disposed of at will. The balance of funds at a particular bitcoin address can be ascertained
by looking up the transactions to and from that address in the block chain. All valid transfers
of bitcoins from an address are digitally signed using the private keys associated with it.
The bitcoin specification starts with the concept of a distributed timestamp server. A
timestamp server works by taking a SHA256 hash function of some data and widely
publishing the hash, for instance, in a newspaper or Usenet post. The timestamp proves that
the data must have existed at the time, in order to produce the hash. For bitcoin, each
timestamp includes the previous timestamp hash as input for its own hash. This dependency
of one hash on another is what forms a chain, with each additional timestamp providing
evidence that each of the previous timestamp hashes existed.
with the number of leading zero bits required, a hash can always be verified by executing a
single round of double SHA-256.
For the bitcoin timestamp network, a valid "proof-of-work" is found by incrementing a nonce
until a value is found that gives the block's hash the required number of leading zero bits.
Once the hashing has produced a valid result, the block cannot be changed without redoing
the work. As later records or "blocks" are chained after it, the work to change the block
would include redoing the work for each subsequent block.
Majority consensus in bitcoin is represented by the longest chain, which required the greatest
amount of effort to produce it. If a majority of computing power is controlled by honest
nodes, the honest chain will grow fastest and outpace any competing chains. To modify a past
block, an attacker would have to redo the proof-of-work of that block and all blocks after it
and then surpass the work of the honest nodes. The probability of a slower attacker catching
up diminishes exponentially as subsequent blocks are added.
To compensate for increasing hardware speed and varying interest in running nodes over
time, the difficulty of finding a valid hash is adjusted roughly every two weeks. If blocks
22
were generated too quickly, the difficulty increases and more hashes are required to find a
block and to generate new bitcoins.
Bitcoin mining is a competitive endeavor. An "arms race" has been observed through the
various hashing technologies that have been used to mine bitcoins: basic CPUs, high-end
GPUs (graphics processing units) common in many gaming computers, FPGAs (fieldprogrammable gate arrays) and ASICs (application-specific integrated circuits) all have been
used with the latter reducing profitability of each former technology. The newest addition,
ASICs, are built into devices that are specialized for bitcoin mining. As bitcoins become more
difficult to mine, computer hardware manufacturing companies have seen an increase in sales
of high-end products.
Computing power is often bundled together or "pooled" into a central server to reduce
variance in miner income. Individual mining rigs often have to wait relatively long periods of
time to confirm a block of transactions and receive payment. When miners cooperate in a
pool, all participating miners receive a number of the bitcoins every time a participating
server solves a block. This payment is proportional to the amount of work an individual
miner contributed to help find that block.
Cloud mining is where the mining equipment is hosted in a remote data center. The mining
power is sold to the user for a certain period of time in a contract or traded on an exchange.
Cloud Mining providers generally use "pooled" mining to have more frequent payouts for
customers.
5.4.1 Mining Process
A rough overview of the process to mine bitcoins is:
1. New transactions are broadcast to all nodes.
2. Each miner node collects new transactions into a block.
3. Each miner node works on finding a difficult proof-of-work for its block.
4. When a node finds a proof-of-work, it broadcasts the block to all nodes.
5. Nodes accept the block only if all transactions in it are valid and not already spent.
6. Nodes express their acceptance of the block by working on creating the next block in
the chain, using the hash of the accepted block as the previous hash.
Nodes are incentivized to work on extending the longest chain or risk their work being
wasted. If two nodes broadcast different versions of the next block simultaneously, some
nodes may receive one or the other first. In that case, they work on the first one they received,
but save the other branch in case it becomes longer. The tie will be broken when the next
proof-of-work is found and one branch becomes longer; the nodes that were working on the
other branch will then switch to the longer one.
23
New transaction broadcasts do not necessarily need to reach all nodes. As long as they reach
many nodes, however, transactions will get into a block before long. Block broadcasts are
also tolerant of dropped messages. If a node does not receive a block, it will request it when it
receives the next block and realizes it missed one.
5.4.2 Mined Bitcoins
By convention, the first transaction in a block is a special transaction that produces new
bitcoins owned by the creator of the block. This adds an incentive for nodes to support the
network, and provides a way to initially distribute coins into circulation, since there is no
central authority to issue them.
The continual and steady addition of new coins is analogous to gold miners expending
resources to add gold to circulation. In this case, it is computing power (CPU time) and
electricity that is expended.
The incentive can also be funded with transaction fees. If the output value of a transaction is
less than its input value, the difference is a transaction fee that is added to the incentive value
of the block containing the transaction. Once a predetermined number of coins have entered
circulation, the incentive can transition entirely to transaction fees and be completely
inflation free.
Businesses that receive frequent payments will probably still want to run their own nodes for
more independent security and quicker verification.
25
CHAPTER 6
SECURITY ISSUES
the attack and incentives even stronger, thus potentially leading to a 51% attack and the
collapse of the currency.
Gavin Andresen and Ed Felten disagreed with this conclusion, Felten defending his assertion
that the bitcoin protocol is incentive compatible. The original authors responded that the
disagreement stemmed from Felten's misunderstanding of how miners are compensated in
mining pools, that the assertion was in error, given the presence of a strategy that dominates
honest mining, and that the error stemmed from Felten et al. not modeling block withholding
attacks in their analysis.
28
CHAPTER 7
CONCLUSION
7.1 Disadvantages
The wrongful use of bitcoin by criminals has attracted the attention of financial regulators,
legislative bodies, law enforcement, and the media. The FBI prepared an intelligence
assessment, the SEC has issued a pointed warning about investment schemes using virtual
currencies, and the U.S. Senate held a hearing on virtual currencies in November 2013. CNN
has referred to bitcoin as a "shady online currency [that is] starting to gain legitimacy in
certain parts of the world", and The Washington Post called it "the currency of choice for
seedy online activities".
Several news outlets have asserted that the popularity of bitcoins hinges on the ability to use
them to purchase illegal goods. In 2014, researchers at the University of Kentucky found
"robust evidence that computer programming enthusiasts and illegal activity drive interest in
bitcoin, and find limited or no support for political and investment motives."
A CMU researcher estimated that in 2012, 4.5% to 9% of all transactions on all exchanges in
the world were for drug trades on a single deep web drugs market, Silk Road. Child
pornography, murder-for-hire services, and weapons are also available on black market sites
that sell in bitcoin.
Several deep web black markets have been shut by authorities. In October 2013 Silk Road
was shut down by U.S. law enforcement leading to a short-term decrease in the value of
bitcoin. In 2015, the founder of the site was sentenced to life in prison. Alternative sites were
soon available, and in early 2014 the Australian Broadcasting Corporation reported that the
closure of Silk Road had little impact on the number of Australians selling drugs online,
which had actually increased. In early 2014, Dutch authorities closed Utopia, an online illegal
goods market, and seized 900 bitcoins. In late 2014, a joint police operation saw European
and American authorities seize bitcoins and close 400 deep web sites including the illicit
goods market Silk Road 2.0. Law enforcement activity has resulted in several convictions. In
December, 2014, Charlie Shrem was sentenced to two years in prison for indirectly helping to
send $1 million to the Silk Road drugs site, and in February, 2015, its founder, Ross Ulbricht,
was convicted on drugs charges and faces a life sentence.
Some black market sites may seek to steal bitcoins from customers. The bitcoin community
branded one site, Sheep Marketplace, as a scam when it prevented withdrawals and shut
29
down after an alleged bitcoins theft. In a separate case, escrow accounts with bitcoins
belonging to patrons of a different black market were hacked in early 2014.
30
REFERENCES
[1]
[2]
[3]
F. Reid and M. Harrigan, "An Analysis of Anonymity in the Bitcoin System, " 2011.
[Online]. Available: http://arxiv.org/abs/1107. 4524.
[4]
The Economist, "Digital Curriencies - Bits and Bob, " June 2011. [Online]. Available:
http://www.economist.com/node/18836780.
[5]
31