bitcoin & bitcoin mining(final)

48
Bitcoin and Bitcoin Mining Introduction Lab of Professor Hidetoshi Shimodaira Zehady Abdullah Khan Bachelor 4 th year, Mathematical Science Course, Department of Information and Computer Sciences, School Of Engineering Science, Osaka University. 1 2013-06-12

Upload: abdullah-zehady

Post on 29-Jan-2015

169 views

Category:

Self Improvement


6 download

DESCRIPTION

 

TRANSCRIPT

Page 1: Bitcoin & bitcoin mining(final)

Bitcoinand

Bitcoin MiningIntroduction

Lab of Professor Hidetoshi Shimodaira

Zehady Abdullah KhanBachelor 4th year,Mathematical Science Course,Department of Information and Computer Sciences,School Of Engineering Science,Osaka University.

1

2013-06-12

Page 2: Bitcoin & bitcoin mining(final)

Contents

Introduction of Bitcoin.

What is Bitcoin Mining?

Different Mining Methods.

Pool-Hopping Problem.

Introduction of Hopping-Proof Methods.

2

According to mainly two papers: 1. Bitcoin: A peer-to-peer electronic cash system S. Nakamoto, Tech Report, 20092. Analysis of Bitcoin Pooled Mining Reward Systems Meni Rosenfeld - Distributed, Parallel, and Cluster Computing,2011

Page 3: Bitcoin & bitcoin mining(final)

Bitcoin

Bitcoin

Digital Currenc

y

Public Key Cryptogra

phy

Internet Security

Cryptography

Financial Transaction

E-Cash

Complex Network

Intro3

Page 4: Bitcoin & bitcoin mining(final)

What is Bitcoin? A digital currency

Unit: BTC (1 BTC = 110 USD). Buy or sell goods.

Differences Decentralized and Distributed. Low fee & Fast Transaction. Anonymous: Address <=> Address transaction. Value increase (Only 21,000,000 Bitcoin)

How do you get and use bitcoin? Bitcoin exchanges to buy and sell bitcoin. Bitcoin wallets to use bitcoin to receive or send bitcoin.

4

Page 5: Bitcoin & bitcoin mining(final)

How Bitcoin looks like? Not a physical object like gold or paper-money. A chain of digital signatures in a block-chain.

Block header Transactions

Block Reward(B) 25 bitcoin per valid block Halves every 4 year

How do you count your bitcoin? Bitcoin wallet collects/remembers all the transactions

associated with you.

5

Page 6: Bitcoin & bitcoin mining(final)

Block: Human Readable format

6

Page 7: Bitcoin & bitcoin mining(final)

Block Confirmation: Proof of Work

Current target(Tcur): “Bits” field Maximum target(Tmax):

0x00000000FFFF0000000000000000000000000000000000000000000000000000

Condition of Block confirmation Hash of block header Tcur

Block Difficulty(D): (2016 Blocks / every 2 week)

Which hash will validate the block ?

A Hash validating a block is a Rare Event SHA256 chooses any 256-bit number from 0 ~ 2^256

7

Nonce ChangeA completely

different hash of theblock header

SHA 256 CryptographicHash Function

Block Header

Hash of Block header

(256 bit Number)

Page 8: Bitcoin & bitcoin mining(final)

Block Validation Probability 0x00000000FFFF00000000000000000000000000000000000000000000

00000000

The offset for difficulty 1 is and for difficulty D is

The expected number of hashes we need to calculate to find a block with difficulty D is

Every hash has a probability of to validate a block.

8

208 bits16bits

Tmax

Page 9: Bitcoin & bitcoin mining(final)

Bitcoin Mining Intro If your hash rate is h and you mine for time , on average the

number of found blocks is

D = Difficulty, h = miner’s hashrate

Exp- Ananda buys a mining computer with h = 1Ghash/s = 10^9 hash/s . If he mines for a day(86,400 s) when D = 1690906 and B= 50BTC Found Blocks = ht / ( 2^32 * D) = 0.0119 blocks = 0.0119 * B = 0.595 BTC

Classification of mining Solo Mining: Mining alone. Pooled Mining: Mining with other miners in a mining pool.

9

Page 10: Bitcoin & bitcoin mining(final)

Solo Mining as a Poisson Process Number of trial is depends on miner’s hash rate h p: Probability of success(very small). n: Number of blocks found by a miner

mining for time t with hash rate h results in on average blocks. n follows the Poisson distribution P0(λ) where λis the parameter

called intensity.

P: Payout P= N x 1B = N x 25 x 11500¥ (1B = 1block = 25 BTC)

Exp: Ananda has V[P]=0.0119B2 , σ = 5.454B, About 3 months to find a block in solo mining. The process is completely random and memoryless. May wait on average 3 more months.

10

Page 11: Bitcoin & bitcoin mining(final)

Pooled Mining Joint effort & reward distribution. H: Total hash rate of all miners. Single miner’s hash rate h = qH (0<q<1) E[Pp]: Total average payout of the pool

E[Ps]: Single miner’s payout in pooled mining

V[Ps]: Single miner’s variance in pooled mining

11

Page 12: Bitcoin & bitcoin mining(final)

Pooled Mining f: Fee/Block, B = Block reward.

Operator’s fee for a block = fB. Actual Reward for the pool miners = B – fB = (1-f)B.

In a pool Each miner submits shares into the pool. Share: Hash of a block header calculated by a miner which is

less than Tcur assuming D=1 (e.g. Tcur = Tmax).

Each hash has a probability of to be a share in the pool.

Each share has a probability p = to validate a block. For a single share, a miner’s Expected payout = Expected contribution to total reward = pB

12

Page 13: Bitcoin & bitcoin mining(final)

Pooled Mining Reward System A pool has the potential to improve the variance of a

miner. Dividing a reward in a fair way is difficult.

Existing pool reward systems

13

Pooled Mining

Simple Reward Systems

Proportional Pay-per-share

Score-basedSystems

Slush’s Method

Geometric Method

Pay-per-last-N-shares

Page 14: Bitcoin & bitcoin mining(final)

Proportional Pool

14

Page 15: Bitcoin & bitcoin mining(final)

Proportional Pool (1-f)B is distributed in proportion to the number of

shares in a Round. Round: Round is the time between two success (2

blocks). n: Number of shares submitted by a miner during a round. N: Total number of shares during the round. Miner’s payout =

Assumption: Fixed number of miners in a proportional system.

N follows a negative binomial distribution with success rate p=1/D.

15

Page 16: Bitcoin & bitcoin mining(final)

Proportional Pool: Expected Value & Variance

After the success in the previous round, in the next round, we have N-1 failed shares before the final successful share.

16

Page 17: Bitcoin & bitcoin mining(final)

Proportional Pool: Expected Value & Variance

After the success in the previous round, in the next round, we have N-1 shares before the final success share.

Exp : if D = 1.5 x 106, Variance per share of a miner in a pool is 1.13 x 105

times less than the variance in solo mining.

17

Page 18: Bitcoin & bitcoin mining(final)

Pool-Hopping Problem

18

Pool-Hopping: Some miners leave pool early to increase their profit but that decrease the profit of continuous miners.

N: Total Number of shares follows a geometric distribution with parameter p.

Given that, I shares already submitted, then N > I.

Page 19: Bitcoin & bitcoin mining(final)

Simplification…

19

Page 20: Bitcoin & bitcoin mining(final)

Pool-hopping Amplification factor

20

Represents the amplification factor when xD = (pI )

(1/p)=I shares have already been submitted. Monotonically decreasing function.

A pool hopper will mine if x < x0 and mine solo when x > x0.

The payout of the honest miners will be less than expected because of hopping by pool hoppers.

Page 21: Bitcoin & bitcoin mining(final)

Pay-per-share Pool

21

Page 22: Bitcoin & bitcoin mining(final)

Pay-per-share pool(PPS) A hopping-proof method. Reward is given per share. When a participant submits a share, he is immediately

rewarded with (1-f)pB independent of found blocks . Operator keeps all the rewards for found blocks.

PPS is a deterministic value known in advance. Properties:

Offers zero variance in the reward per share. No waiting time. No losses due to pool-hopping.

But operator is taking the risk What if no blocks are found? Chance of bankruptcy.

22

Page 23: Bitcoin & bitcoin mining(final)

Marcov chain Modeling in PPS pool When will the PPS pool go bankrupt? Goal: Estimate the financial reserves that the pool

operator should keep to prevent pool bankruptcy.

Pool operator’s balance can be modeled as the Markov chain where each submitted share corresponds to a step.

23

Page 24: Bitcoin & bitcoin mining(final)

Marcov chain Modeling in PPS pool(continued)

By the central limit theorem, Long term behavior of the stochastic process is equivalent to the following form with the same expectation fpB and variance pB2.

Scaling the initial condition by a factor of , we get the following equivalence.

24

Page 25: Bitcoin & bitcoin mining(final)

Bankruptcy Recurrence Equation an: Probability to ever reach 0 (represents bankruptcy).

Given: We start in state n and denoting By conditioning on the first step we can get recurrence

eqn.

The characteristic polynomial of this eqn. is General solution:

Boundary Conditions: , we have Thus,

25

Page 26: Bitcoin & bitcoin mining(final)

Safe reserve for a PPS pool

R: Starting reserve of the pool operator. δ: Probability that the pool will ever go bankrupt.

To maintain a bankruptcy probability at most , pool should reserve at least

Exp1: B = 50 BTC,δ=1/1000,f = 5% , R=3454 BTC Exp2: If operator fixes f=1%,he has R = 500BTC, then Probability of bankruptcy δ= 81.9%

26

Page 27: Bitcoin & bitcoin mining(final)

Hopping Immunity Theorem It’s impossible to stop hopping if you pay rewards

to unsuccessful shares. Theorem:

Suppose, difficulty D and block reward B are fixed. Let a reward method distribute (1-f)B among

shares in the round according to a deterministic function of the round length and the share index.

27

Expected Reward per share at the time of submission is always (1-f)pB

The entire reward is always given to the

last share submitted .

Page 28: Bitcoin & bitcoin mining(final)

Methods not discussed PPS is not that good. Hopping-proof methods.

First attempt done in Slush’s pool using exponential score function to give scores to the miners.

Not completely hopping-proof. Other Score based methods

Geometric method. Pay-per-last-N-shares.

Some other advanced method.

28

Page 29: Bitcoin & bitcoin mining(final)

Things I want to research Statistical analysis of pooled mining. Statistical analysis of transaction graphs. Integrate or Develop better mining pools.

29

Page 30: Bitcoin & bitcoin mining(final)

Bibliography Bitcoin: A Peer-to-Peer Electronic Cash System - S. Nakamoto, Tech Report, 2009

Analysis of Bitcoin Pooled Mining Reward Systems - Meni Rosenfeld - Distributed, Parallel, and Cluster Computing,2011

On Bitcoin and Red Balloons - M. Babaioff, S. Dobzinski, S. Oren, and A. Zohar, SIGEcom(Special Interest Group on ecommerce) Exchanges, 10(3), 2011 Quantitative Analysis of the Full Bitcoin Transaction Graph - D. Ron and A. Shamir, Financial Cryptography 2013 Bitter to Better — How to Make Bitcoin a Better Currency - S. Barber, X. Boyen, E. Shi, and E. Uzun, Financial Cryptography 2012 Cryptographic hash-function basics: Definitions, implications,

and separations for preimage resistance, second-preimage resistance, and collision resistance

- P Rogaway, T Shrimpton - Fast Software Encryption, 2004 - Springer

30

Page 31: Bitcoin & bitcoin mining(final)

The End

31

Page 32: Bitcoin & bitcoin mining(final)

Bitcoin Global Nodes

Charts32

Page 33: Bitcoin & bitcoin mining(final)

Bitcoin Demographics

Charts33

Page 34: Bitcoin & bitcoin mining(final)

Bitcoin Purchase

Charts34

Page 35: Bitcoin & bitcoin mining(final)

Roles in Bitcoin Network

Charts35

Page 36: Bitcoin & bitcoin mining(final)

Things happened because of bitcoin

Charts36

Page 37: Bitcoin & bitcoin mining(final)

Real world/Offline interactionYou can buy and Purchase with BTC!!!

Charts37

Page 38: Bitcoin & bitcoin mining(final)

Offline Bitcoin meetups in USA

Charts38

Page 39: Bitcoin & bitcoin mining(final)

Companies and Venture Capital

Charts39

Page 40: Bitcoin & bitcoin mining(final)

Bitcoin Client Software(Wallet)

40

Page 41: Bitcoin & bitcoin mining(final)

Bitcoin Software Download

Graphs41

Page 42: Bitcoin & bitcoin mining(final)

Bitcoin Penetration

Graphs42

Page 43: Bitcoin & bitcoin mining(final)

Downloads vs Penetration

vs Internet Access

Graphs43

Page 44: Bitcoin & bitcoin mining(final)

Global Search Traffic

44 Graphs

Page 45: Bitcoin & bitcoin mining(final)

Trading Volume

45 Graphs

Page 46: Bitcoin & bitcoin mining(final)

Trading Volume

46 Graphs

Page 47: Bitcoin & bitcoin mining(final)

Bitcoin Volatility

247

Page 48: Bitcoin & bitcoin mining(final)

Is everything positive ? NO Bitcoin can topple governments, destabilize

economies, and create uncontrollable global bazaars for contraband.

Bitcoins will facilitate transactions for criminals, online poker players, tax-evaders, pornographers, drug dealers, and other unsavory types tired of carrying around a

Vermeer. Bitcoin is just like knife or hammer. You can

kill or you can use it the most efficient,profitable way !!!!

48