Exchange Digital Money using Bitcoin and...

25
31 July 2011 David Steele @dsteele (+)[email protected] Exchange Digital Money using Bitcoin and Python

Transcript of Exchange Digital Money using Bitcoin and...

Page 1: Exchange Digital Money using Bitcoin and Pythondavesteele.github.io/python-bitcoin-talk/PythonBitcoinTalk.pdf · 31 July 2011 David Steele @dsteele (+)dsteele@gmail.com Exchange Digital

31 July 2011

David Steele@dsteele

(+)[email protected]

Exchange Digital Money using Bitcoin and Python

Page 2: Exchange Digital Money using Bitcoin and Pythondavesteele.github.io/python-bitcoin-talk/PythonBitcoinTalk.pdf · 31 July 2011 David Steele @dsteele (+)dsteele@gmail.com Exchange Digital

2

Resources

Presentationhttp://davesteele.github.com/python-bitcoin-talk/

Software{apt-get|yum} install git python-simplejson python-irclib

pygame DjangoOr 'easy_install simplejson python-irclib pygame

Django'

git clone git://github.com/davesteele/python-bitcoin-talk.git

Page 3: Exchange Digital Money using Bitcoin and Pythondavesteele.github.io/python-bitcoin-talk/PythonBitcoinTalk.pdf · 31 July 2011 David Steele @dsteele (+)dsteele@gmail.com Exchange Digital

3

Page 4: Exchange Digital Money using Bitcoin and Pythondavesteele.github.io/python-bitcoin-talk/PythonBitcoinTalk.pdf · 31 July 2011 David Steele @dsteele (+)dsteele@gmail.com Exchange Digital

4

Page 5: Exchange Digital Money using Bitcoin and Pythondavesteele.github.io/python-bitcoin-talk/PythonBitcoinTalk.pdf · 31 July 2011 David Steele @dsteele (+)dsteele@gmail.com Exchange Digital

5

Page 6: Exchange Digital Money using Bitcoin and Pythondavesteele.github.io/python-bitcoin-talk/PythonBitcoinTalk.pdf · 31 July 2011 David Steele @dsteele (+)dsteele@gmail.com Exchange Digital

6

Page 7: Exchange Digital Money using Bitcoin and Pythondavesteele.github.io/python-bitcoin-talk/PythonBitcoinTalk.pdf · 31 July 2011 David Steele @dsteele (+)dsteele@gmail.com Exchange Digital

7

Hash

Page 8: Exchange Digital Money using Bitcoin and Pythondavesteele.github.io/python-bitcoin-talk/PythonBitcoinTalk.pdf · 31 July 2011 David Steele @dsteele (+)dsteele@gmail.com Exchange Digital

8

The Secret Sauce...

Page 9: Exchange Digital Money using Bitcoin and Pythondavesteele.github.io/python-bitcoin-talk/PythonBitcoinTalk.pdf · 31 July 2011 David Steele @dsteele (+)dsteele@gmail.com Exchange Digital

9

Terminology

The Bitcoin ledger consists of a communally-maintained chain of Blocks containing Transactions which record balance transfers between Addresses

Addresses are derived from a hash of the public key for a public/private key pair stored in the private Wallet

Transactions are Confirmed as they become embedded in the Longest Block Chain

Addresses can be aggregated locally in the Wallet using text Labels, also called Accounts

Page 10: Exchange Digital Money using Bitcoin and Pythondavesteele.github.io/python-bitcoin-talk/PythonBitcoinTalk.pdf · 31 July 2011 David Steele @dsteele (+)dsteele@gmail.com Exchange Digital

10

Page 11: Exchange Digital Money using Bitcoin and Pythondavesteele.github.io/python-bitcoin-talk/PythonBitcoinTalk.pdf · 31 July 2011 David Steele @dsteele (+)dsteele@gmail.com Exchange Digital

11

Getting Bitcoins

OR

Page 12: Exchange Digital Money using Bitcoin and Pythondavesteele.github.io/python-bitcoin-talk/PythonBitcoinTalk.pdf · 31 July 2011 David Steele @dsteele (+)dsteele@gmail.com Exchange Digital

12

GUI Client

Page 13: Exchange Digital Money using Bitcoin and Pythondavesteele.github.io/python-bitcoin-talk/PythonBitcoinTalk.pdf · 31 July 2011 David Steele @dsteele (+)dsteele@gmail.com Exchange Digital

13

bitcoind

Page 14: Exchange Digital Money using Bitcoin and Pythondavesteele.github.io/python-bitcoin-talk/PythonBitcoinTalk.pdf · 31 July 2011 David Steele @dsteele (+)dsteele@gmail.com Exchange Digital

14

bitcoind JSON-RPC using Python

rpcuser and rpcpassword defined in ~/.bitcoin/bitcoin.conf

Install python-bitcoinrpc https://github.com/jgarzik/python-bitcoinrpc

bitcoind runningPorts 8332 and 8333 accessibleAPI Calls are defined at

https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_Calls_list

Page 15: Exchange Digital Money using Bitcoin and Pythondavesteele.github.io/python-bitcoin-talk/PythonBitcoinTalk.pdf · 31 July 2011 David Steele @dsteele (+)dsteele@gmail.com Exchange Digital

15

Example Django Website

Page 16: Exchange Digital Money using Bitcoin and Pythondavesteele.github.io/python-bitcoin-talk/PythonBitcoinTalk.pdf · 31 July 2011 David Steele @dsteele (+)dsteele@gmail.com Exchange Digital

16

“Bitcoin Watch” Monitor

Page 17: Exchange Digital Money using Bitcoin and Pythondavesteele.github.io/python-bitcoin-talk/PythonBitcoinTalk.pdf · 31 July 2011 David Steele @dsteele (+)dsteele@gmail.com Exchange Digital

17

Opportunity – URI Scheme Handler

https://en.bitcoin.it/wiki/URI_Scheme

bitcoin:1Lg7peCQCBRBsmZJ5MoXikuQ25oZ4voBit?amount=5X8&label=Bitcoin%20Watch&message=Donation%20for%20watch%20service

Page 18: Exchange Digital Money using Bitcoin and Pythondavesteele.github.io/python-bitcoin-talk/PythonBitcoinTalk.pdf · 31 July 2011 David Steele @dsteele (+)dsteele@gmail.com Exchange Digital

18

Vending

Page 19: Exchange Digital Money using Bitcoin and Pythondavesteele.github.io/python-bitcoin-talk/PythonBitcoinTalk.pdf · 31 July 2011 David Steele @dsteele (+)dsteele@gmail.com Exchange Digital

19

Opportunity – Wallet Apps

Different:- Security Levels- Users- Use Cases

http://gitorious.org/pycoin - Bitcoin P2P Implementation

Page 20: Exchange Digital Money using Bitcoin and Pythondavesteele.github.io/python-bitcoin-talk/PythonBitcoinTalk.pdf · 31 July 2011 David Steele @dsteele (+)dsteele@gmail.com Exchange Digital

20

Is it Money? - Aristotle's Qualities of a Good Money

Durable

Portable

Divisible

Intrinsic Value

Page 21: Exchange Digital Money using Bitcoin and Pythondavesteele.github.io/python-bitcoin-talk/PythonBitcoinTalk.pdf · 31 July 2011 David Steele @dsteele (+)dsteele@gmail.com Exchange Digital

21

The Market View

Page 22: Exchange Digital Money using Bitcoin and Pythondavesteele.github.io/python-bitcoin-talk/PythonBitcoinTalk.pdf · 31 July 2011 David Steele @dsteele (+)dsteele@gmail.com Exchange Digital

22

Ledger Analysis

Metrics for a better idea of Bitcoin economy healthDifficulty vs time?

% Mining Pools

BTC Velocity?Tx Velocity?Median Tx BTC?Addresses

Reuse?Account detection metric

http://blockexplorer.com/

Page 23: Exchange Digital Money using Bitcoin and Pythondavesteele.github.io/python-bitcoin-talk/PythonBitcoinTalk.pdf · 31 July 2011 David Steele @dsteele (+)dsteele@gmail.com Exchange Digital

23

Ledger Analysis using Python

The bitcointools module parses local bitcoin data files

https://github.com/gavinandresen/bitcointools

Page 24: Exchange Digital Money using Bitcoin and Pythondavesteele.github.io/python-bitcoin-talk/PythonBitcoinTalk.pdf · 31 July 2011 David Steele @dsteele (+)dsteele@gmail.com Exchange Digital

24

Bitcoin Links

Market – Bitcoin Chartshttp://bitcoincharts.com

Plumbing – Block Explorerhttp://blockexplorer.com/Stats - http://blockexplorer.com/q

Technical – Bitcoin Wikihttps://en.bitcoin.it/wiki/Main_PageAddresses, Transactions, Signing, Blocks,

Peer Protocol

Community - http://forum.bitcoin.org/News

http://www.bitcoinnews.com/http://www.****coins.com/

Page 25: Exchange Digital Money using Bitcoin and Pythondavesteele.github.io/python-bitcoin-talk/PythonBitcoinTalk.pdf · 31 July 2011 David Steele @dsteele (+)dsteele@gmail.com Exchange Digital

25