bitcoin and the future of cryptocurrency

72
@Ben_Hall [email protected] Blog.BenHall.me.uk Hacker in Residence at #1seed Bitcoin & The Future of Cryptocurrency

Upload: ben-hall

Post on 29-Jan-2015

121 views

Category:

Technology


2 download

DESCRIPTION

Presented at NDC London - 6th December 2013

TRANSCRIPT

Page 1: Bitcoin and the future of cryptocurrency

@Ben_Hall [email protected] Blog.BenHall.me.uk

Hacker in Residence at #1seed

Bitcoin & The Future of Cryptocurrency

Page 2: Bitcoin and the future of cryptocurrency

Agenda

1. What is Bitcoin and how does it work?2. Integrating Bitcoin into your website3. Bitcoin Mining4. Alternatives & the future

Page 3: Bitcoin and the future of cryptocurrency
Page 4: Bitcoin and the future of cryptocurrency
Page 5: Bitcoin and the future of cryptocurrency
Page 6: Bitcoin and the future of cryptocurrency
Page 7: Bitcoin and the future of cryptocurrency

AND NOT A SHIT WAS GIVEN

Page 8: Bitcoin and the future of cryptocurrency

Intro to Cryptocurrencies

“A cryptocurrency is a peer-to-peer, decentralized, digital currency whose implementation relies on the principles of cryptography to validate the transactions and generation of the currency itself” ~ Wikipedia

Page 9: Bitcoin and the future of cryptocurrency

Bitcoin

• Bitcoin or BTC is an online currency that holds value in all countries and isn't controlled by banks.

• “A new kind of money” Bitcoin.org• Trade to/from Fiat currencies

Page 10: Bitcoin and the future of cryptocurrency

Bitcoin

• Instant Peer-to-Peer transactions• Zero or low processing fees• Banks are scared.

Page 11: Bitcoin and the future of cryptocurrency

Who created it?

• Satoshi Nakamoto - pseudonymous person or group of people

• Guardian person of the year 2013• Paper == November 2008• First “block” in January 2009

• Worked on it until 0.3.19

Page 12: Bitcoin and the future of cryptocurrency

BIPs

• BIP stands for Bitcoin Improvement Proposal• https://github.com/bitcoin/bips

• Current version is 0.8.5

Page 13: Bitcoin and the future of cryptocurrency

Coin

• 1 BTC == 100m Satoshis. • 0.00000001 BTC• Current price for 1 BTC === $1073• Current price for 1 mBTC === $1.073

• Technically no bitcoins, only records of bitcoin transactions.

Page 14: Bitcoin and the future of cryptocurrency

Transaction

• An input. This is a record of which bitcoin address was used to send the bitcoins to Alice in the first place (she received them from her friend, Eve).

• An amount. This is the amount of bitcoins that Alice is sending to Bob.

• An output. This is Bob’s bitcoin address

Page 15: Bitcoin and the future of cryptocurrency

Wallets

• A wallet is a computer file which holds Bitcoins. Bitcoins are sent between wallets; each is represented by one or more addresses.

Page 16: Bitcoin and the future of cryptocurrency

Addresses

• A wallet's Bitcoin address is a public identifier for sending money to that wallet, just like an email address directs email to your account.

• Bitcoin addresses look like this: 1LF7MLgPVVTfa9ySp5UUWA7y4TGpNc6ny6.

Page 17: Bitcoin and the future of cryptocurrency

Public / Private Key

• Private key stored in wallet. Public key is your address.

• Think SSH.• Lose your private key, you’re f—ked. Lose all

bitcoins.• Who controls private key, controls bitcoin.

Page 18: Bitcoin and the future of cryptocurrency

More than one address

• Each address should only be used for a single transaction.

• Not enforced.• Single wallet handles all addresses

Page 19: Bitcoin and the future of cryptocurrency

Storing coins

• Online Wallets – Likely to be hacked.• Mobile Wallets (Blockchain Wallet)• Paper Wallets / Cold Storage

Page 20: Bitcoin and the future of cryptocurrency

THE ONLY REASON QR CODES EXIST?

Page 21: Bitcoin and the future of cryptocurrency

ESPN

Page 22: Bitcoin and the future of cryptocurrency

The future?

Page 23: Bitcoin and the future of cryptocurrency

Making your first trade…

• Create a wallet. Create an address. • Receive an amount from another address

• Public block chain• https://blockchain.info/address/

1BTCorgHwCg6u2YSAWKgS17qUad6kHmtQW

Page 24: Bitcoin and the future of cryptocurrency
Page 25: Bitcoin and the future of cryptocurrency
Page 26: Bitcoin and the future of cryptocurrency

Double Spending

• Double-spending is the result of successfully spending some money more than once.

• Bitcoin protects against double spending by verifying each transaction added to the block chain to ensure that the inputs for the transaction had not previously already been spend

• The block chain is a shared public ledger

Page 27: Bitcoin and the future of cryptocurrency

Block Chain

Page 28: Bitcoin and the future of cryptocurrency

Nodes

Page 29: Bitcoin and the future of cryptocurrency

Common use-cases?

Page 30: Bitcoin and the future of cryptocurrency
Page 31: Bitcoin and the future of cryptocurrency
Page 32: Bitcoin and the future of cryptocurrency

Just about anything.

Page 33: Bitcoin and the future of cryptocurrency

Buying Bitcoin

• https://quickbitcoin.co.uk/• https://bitbargain.co.uk/buy

• REALLY DIFFICULT!

Page 34: Bitcoin and the future of cryptocurrency

Exchanges

Page 35: Bitcoin and the future of cryptocurrency

Bank of America Merrill Lynch

Page 36: Bitcoin and the future of cryptocurrency

Accepting Bitcoin payments

Page 37: Bitcoin and the future of cryptocurrency

Simple as giving someone a QR code

• Blockchain API• Callback to site when money transferred

Page 38: Bitcoin and the future of cryptocurrency

Generating Receiving Addresses

• https://blockchain.info/api/receive?method=create&address=$receiving_address&callback=$callback_url

• { "fee_percent":0, "destination":"1A8JiWcwvpY7tAopUkSnGuEYHmzGYfZPiq", "input_address":"1KZoUuPWFAeyVySHAGqvTUDoX6P3ntuLNF", "callback_url":"http://yoururl.com" }

Page 39: Bitcoin and the future of cryptocurrency

Implementing The Callback• value

– The value of the payment received in satoshi. Divide by 100000000 to get the value in BTC.

• input_address – The bitcoin address that received the transaction.

• confirmations – The number of confirmations of this transaction.

• {Custom Parameters} – Any parameters included in the callback URL will be passed back to the callback URL in

the notification. • transaction_hash

– The transaction hash.• input_transaction_hash

– The original paying in hash before forwarding. • destination_address

– The destination bitcoin address. Check this matches your address.

Page 40: Bitcoin and the future of cryptocurrency

CONFIRMATIONSAim for 6. Why 6? Stop double spending.

Page 41: Bitcoin and the future of cryptocurrency

Blockchain API

• https://blockchain.info/api/

• Realtime notifications• https://blockchain.info/api/api_websocket

• Get transaction details• http://blockchain.info/rawtx/$tx_hash

Page 42: Bitcoin and the future of cryptocurrency

Bitcoin JS

• BitcoinJS is a set of open-source libraries designed to let you quickly realize your custom Bitcoin project

• Highly optimized version of the node, i.e. the P2P part of Bitcoin. Its main intended use is as a server component to give lighter clients access to the data in the block chain (in real-time.)

• https://github.com/bitcoinjs/bitcoinjs-server

Page 43: Bitcoin and the future of cryptocurrency

Coinbase

Page 44: Bitcoin and the future of cryptocurrency

Vanity Bitcoin Addresses

• Vanitygen command line tool

• ./vanitygen 1Seed• 1Seed9wVtrKZTBbAZqz1XiTmboYyvpD3t

• Bruteforce. Generates millions, returns only the ones matching prefix.

Page 45: Bitcoin and the future of cryptocurrency

Price?

• Gets confusing.• Need to keep changing toreflect exchange

• 0.4595 BTC

• 1 BTC === 1000 mBTC• 459 mBTC

Page 46: Bitcoin and the future of cryptocurrency

Mining Bitcoin

Page 47: Bitcoin and the future of cryptocurrency

What are you mining for?

• Mining is the process of adding transaction records to Bitcoin's public ledger of past transactions.

• As a reward for their services, Bitcoin miners can collect transaction fees for the transactions they confirm, along with newly created bitcoins

Page 48: Bitcoin and the future of cryptocurrency

Searching for a coin

• Only 21m in total. Currently 12m mined.• Once all mined then transaction fees will be

incentive. • Need miners for network to work.

Page 49: Bitcoin and the future of cryptocurrency

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. New bitcoins are successfully collected or "mined" by the

receiving node which found the proof-of-work. 6. Nodes accept the block only if all transactions in it are

valid and not already spent.7. 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.

8. Repeat.

Page 50: Bitcoin and the future of cryptocurrency
Page 51: Bitcoin and the future of cryptocurrency

Mining for bitcoins

• Difficulty is a measure of how difficult it is to find a new block compared to the easiest it can ever be.

• Changes every 2016 blocks.• Blocks just keep getting added to the end of

the chain at an average rate of one every 10 minutes

Page 52: Bitcoin and the future of cryptocurrency

Hash Rate

• The hash rate is the measuring unit of the processing power of the Bitcoin network

• Current network hash rate is 6,618,000 GH/s

• 1 GH/s is 1,000,000,000 hashes per second.

Page 53: Bitcoin and the future of cryptocurrency
Page 54: Bitcoin and the future of cryptocurrency

Hardware

• ASIC (Application-specific integrated circuits) chipsets – do one thing and one thing only. Mine bitcoins (SHA256 cryptocurrencies)

• No-one uses GPU now.• Speed measured in hashrate • 30 GH/s = 0.0213 BTC in 24 hours.• 3000 GH/s = 2.155 BTC in 24 hours.

Page 55: Bitcoin and the future of cryptocurrency
Page 56: Bitcoin and the future of cryptocurrency

Kncminer Neptune - $12,995.00Breakeven == 12 days?

3 month profit = $133k ?

Page 57: Bitcoin and the future of cryptocurrency
Page 58: Bitcoin and the future of cryptocurrency

DAYS OF RUNNING IT ON A LAPTOP ARE OVER :’(

Page 59: Bitcoin and the future of cryptocurrency

Alternatives

Page 60: Bitcoin and the future of cryptocurrency

42 different variations

• Bitcoin algorithm based on SHA256 • Litecoin based on Scrypt

• Litecoin is Silver to Bitcoins Gold.

Page 61: Bitcoin and the future of cryptocurrency

Litecoin

• Currently $30

• Litecoin ASIC Mining hasn’t been released yet.• Difficulty much lower. More potential profit?

Page 62: Bitcoin and the future of cryptocurrency

When Bitcoin sneezes, the altcoins catch a cold

Page 63: Bitcoin and the future of cryptocurrency

The Future?

Page 64: Bitcoin and the future of cryptocurrency

Bitcoin all the way down

Reddit.

Page 65: Bitcoin and the future of cryptocurrency

Money Transfer

• Western Union, M-Pesa etc. • All irrelevant.

Page 66: Bitcoin and the future of cryptocurrency

Icecoin

The future for Iceland too?

Page 67: Bitcoin and the future of cryptocurrency

1BTC === $100,000

Page 68: Bitcoin and the future of cryptocurrency

9 months ahead of schedule.

Page 69: Bitcoin and the future of cryptocurrency

Finally…

Page 70: Bitcoin and the future of cryptocurrency
Page 71: Bitcoin and the future of cryptocurrency
Page 72: Bitcoin and the future of cryptocurrency

Thank you.

@[email protected]