8. Intro to Cryptocurrencies
“A cryptocurrency is a peer-topeer, decentralized, digital currency whose
implementation relies on the principles of
cryptography to validate the transactions and
generation of the currency itself” ~ Wikipedia
9. 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
11. 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
12. BIPs
• BIP stands for Bitcoin Improvement Proposal
• https://github.com/bitcoin/bips
• Current version is 0.8.5
13. 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.
14. 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
15. Wallets
• A wallet is a computer file which holds
Bitcoins. Bitcoins are sent between wallets;
each is represented by one or more addresses.
16. 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.
17. 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.
18. More than one address
• Each address should only be used for a single
transaction.
• Not enforced.
• Single wallet handles all addresses
19. Storing coins
• Online Wallets – Likely to be hacked.
• Mobile Wallets (Blockchain Wallet)
• Paper Wallets / Cold Storage
23. Making your first trade…
• Create a wallet. Create an address.
• Receive an amount from another address
• Public block chain
• https://blockchain.info/address/1BTCorgHwCg6u2YSA
WKgS17qUad6kHmtQW
24.
25.
26. 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
39. 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.
40. Aim for 6. Why 6? Stop double spending.
CONFIRMATIONS
42. 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
47. 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
48. 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.
49. 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-ofwork 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.
50.
51. 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
52. 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.
53.
54. 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.