Coinpunk - Enemy of the Banks

27
enemy of the banks COIN PUNK Kyle Drake Obsoleting the banking industry with HTML5 and JavaScript Tuesday, October 15, 13

description

A sneak preview into Coinpunk, the first fully open-source HTML5/JavaScript Bitcoin Wallet Service.

Transcript of Coinpunk - Enemy of the Banks

Page 1: Coinpunk - Enemy of the Banks

enemy of the banks

COIN PUNK

Kyle Drake

Obsoleting the banking industry with HTML5 and JavaScript

Tuesday, October 15, 13

Page 2: Coinpunk - Enemy of the Banks

What is Coinpunk?• First open-source Bitcoin web wallet

service

• Designed and intended for power users and developers

• Funded by a grant from the Bitcoin Foundation (and others)

Tuesday, October 15, 13

Page 3: Coinpunk - Enemy of the Banks

Coinpunk “Old School”

Tuesday, October 15, 13

Page 4: Coinpunk - Enemy of the Banks

• Ruby application

• Bitcoind (official client) JSON RPC does all heavy lifting

• Implemented in 4 days

• Stored all private keys on server

• Works. But there’s a Serious security risk.

Coinpunk “Old School”

Tuesday, October 15, 13

Page 5: Coinpunk - Enemy of the Banks

• July 2011: Bitomat “loses” database. $220,000 USD

• August 2011: MyBitcoin hacked. $800,000

• August 2012: Bitcoinica hacked. $460,000

• March 2012: Linode servers trawled. $250,000

• Sept 2012: BitFloor hacked. $250,000

• April 2013: InstaWallet hacked. $4.6 million

Major Bitcoin Wallet Thefts

Tuesday, October 15, 13

Page 6: Coinpunk - Enemy of the Banks

We’re starting to think putting the private keys on a central server is a really bad idea. I can’t imagine why.

Tuesday, October 15, 13

Page 7: Coinpunk - Enemy of the Banks

But web interfaces are easy to use. They’re lightweight. They’re universal. They make sense to non-tech users.

Tuesday, October 15, 13

Page 8: Coinpunk - Enemy of the Banks

How can we provide a web interface while reducing server trust?

Tuesday, October 15, 13

Page 9: Coinpunk - Enemy of the Banks

“Bitcoin wallets” that store the private keys on the server are not wallets.

They are Bitcoin accounts.

The Problem

Tuesday, October 15, 13

Page 10: Coinpunk - Enemy of the Banks

The Solution

Move the wallet encryption over to the browser.Yes, really.No, seriously!

Tuesday, October 15, 13

Page 11: Coinpunk - Enemy of the Banks

Fear, Uncertainty and Doubt

“DOOMED”? REALLY?Tuesday, October 15, 13

Page 12: Coinpunk - Enemy of the Banks

Tuesday, October 15, 13

Page 13: Coinpunk - Enemy of the Banks

Counterpoint

http://log.nadim.cc/?p=33Tuesday, October 15, 13

Page 14: Coinpunk - Enemy of the Banks

Tuesday, October 15, 13

Page 15: Coinpunk - Enemy of the Banks

Coinpunk “New Wave”

• HTML5/JS frontend• Node.js backend• Redis• Bitcoind

Tuesday, October 15, 13

Page 16: Coinpunk - Enemy of the Banks

Coinpunk “New Wave”

Browser generates Bitcoin private keys, encrypts them, sends encrypted payload to server for storage/backup.

Tuesday, October 15, 13

Page 17: Coinpunk - Enemy of the Banks

Coinpunk “New Wave”

Browser also creates all the transactions. The server (and therefore hackers) cannot spend the user’s money.

Tuesday, October 15, 13

Page 18: Coinpunk - Enemy of the Banks

Progress

Tuesday, October 15, 13

Page 19: Coinpunk - Enemy of the Banks

Browser Crypto Libraries• CryptoJS

• Stanford JS Crypto Lib (SJCL)

• BigInteger (JSBN)

• BitcoinJS-lib

• RandJS

https://github.com/kyledrake/randjs

Tuesday, October 15, 13

Page 20: Coinpunk - Enemy of the Banks

RandJS• Uses

window.crypto.getRandomValues if exists, otherwise falls back

• Allows you to decide whether you’re cool with that.

Tuesday, October 15, 13

Page 21: Coinpunk - Enemy of the Banks

window.crypto.getRandomValues

Tuesday, October 15, 13

Page 22: Coinpunk - Enemy of the Banks

Observations• It’s all kindof slow

• SJCL PBKDF2 is (a lot) faster than CryptoJS

• Can’t go above 4k-5k iterations

• Limited pre-rolled authenticated encryption options (sjcl.encrypt)

http://tonyarcieri.com/all-the-crypto-code-youve-ever-written-is-probably-broken

Tuesday, October 15, 13

Page 23: Coinpunk - Enemy of the Banks

I’m not doing Bitcoin work.Why should I care?

Tuesday, October 15, 13

Page 24: Coinpunk - Enemy of the Banks

Browser-side crypto will become a lot more commonplace.

Tuesday, October 15, 13

Page 25: Coinpunk - Enemy of the Banks

JS crypto libraries will become secure, standardized and fast.

Tuesday, October 15, 13

Page 26: Coinpunk - Enemy of the Banks

One-way hashing of the password on the browser will be considered “best practice”.

Tuesday, October 15, 13

Page 27: Coinpunk - Enemy of the Banks

THANKS!

Tuesday, October 15, 13