bitcoin droidcon tunisia

22
Designing Secure Bitcoin Wallets with Multi-Signature Transactions Johann Barbie [email protected] www.37coins.com

Upload: johannbarbie

Post on 08-May-2015

185 views

Category:

Internet


0 download

DESCRIPTION

Designing Secure Bitcoin Wallets with Multi-Signature Transactions - Droidcon Tunisia 2014

TRANSCRIPT

Page 1: Bitcoin   Droidcon Tunisia

Designing Secure Bitcoin Wallets with

Multi-Signature Transactions

Johann Barbie

[email protected]

Page 2: Bitcoin   Droidcon Tunisia

The Speaker

IBM, 5 years● Consultant,

Security & Scaling

- Johann Barbie Engineer

Tree Planet, 1 year ● Team Leader,

Web Development

37 Coins, Since 2013● Co-Founder

Page 3: Bitcoin   Droidcon Tunisia

Agenda

BITCOIN

1 2 3 4 5the

Inventionthe

Currencyon

Androidthe

Technologyon

SMS

Page 4: Bitcoin   Droidcon Tunisia

Byzantine General Problem

● Byzantium very rich!● greedy neighbours● Neighbours wish to invade

Byzantium● non strong enough by itself● Generals can send

unlimited messengers● Generals can not trust any

other general● How to agree on an attack

strategy?

G1G2

G3

G4G5

G6

Page 5: Bitcoin   Droidcon Tunisia

● 2008 published paper○ based on torrent protocol○ based on pub key encryption○ use proof of work to

create network consensus● 2009 published open source software

○ birth of blockchain● 2010 last post in december

Bitcoin is not organization or company Bitcoin is a protocol based on mathematical rules

Satoshi Nakamoto

Page 6: Bitcoin   Droidcon Tunisia

Blockchain

private key

public key

Transaction

Wallet

sign with private key

Icons by Olivier Guin from The Noun Project

Page 7: Bitcoin   Droidcon Tunisia

In 1993, the cartoon below appeared with the caption,

"On the Internet, no one knows you're a dog,"

and was widely circulated.

An Invention like the Internet

Page 8: Bitcoin   Droidcon Tunisia

Trust and Access

World Financial System

BitcoinVS

Page 9: Bitcoin   Droidcon Tunisia

Access to Banking

1.7 Bn

7 Bn

Icons by Olivier Guin from The Noun Project

Page 10: Bitcoin   Droidcon Tunisia

Free Currency

Page 11: Bitcoin   Droidcon Tunisia

Free Currency

Page 12: Bitcoin   Droidcon Tunisia

Free Currency

● Fee depends on size in kb● No government controls

Bitcoin is the money of the people

Only people?

"On the blockchain, no one knows you're a fridge"by @jonwaller

Page 13: Bitcoin   Droidcon Tunisia

Price Development 2013

Page 14: Bitcoin   Droidcon Tunisia

Bitcoin on Android

taken from Andreas Schildbach’s https://play.google.com/store/apps/details?id=de.schildbach.wallet

Page 15: Bitcoin   Droidcon Tunisia

In App Payment

In-App Payments?

● Purchase of app content● Purchase of app features● Donations

Alternative to Google Play, Flattr, PayPal, ...

taken from Andreas Schildbach’s http://schildbach.de/talks/bitcoin-inapp-payments/

Page 16: Bitcoin   Droidcon Tunisia

Sending the Request

class de.schildbach.wallet.integration.android.BitcoinIntegration

/*

* Request specific amount of Bitcoins from user,

* without feedback from the app.

*/

static void request(Context context, String address, long amount);

/*

* Request specific amount of Bitcoins from user,

* with feedback from the app.

*/

static void requestForResult(Activity activity, int requestCode, String address, long amount);

taken from Andreas Schildbach’s http://schildbach.de/talks/bitcoin-inapp-payments/

Page 17: Bitcoin   Droidcon Tunisia

Behind the Scenes

Intent sent to Bitcoin app action = android.intent.action.VIEW data = bitcoin:1PZmMahjbfsTy6DsaRyfStzoWTPppWwDnZ?amount=0.1

URL formatted to BIP21 standard (BIP = Bitcoin Improvement Proposal)

Result returned to calling app resultCode = OK|CANCELED extras[transaction_hash] = c8a9e036ecbbe75c...

taken from Andreas Schildbach’s http://schildbach.de/talks/bitcoin-inapp-payments/

Page 18: Bitcoin   Droidcon Tunisia

Get the Code

● git clone https://code.google.com/p/bitcoin-wallet/

● Cd to integration-android subproject.

● mvn clean install

● or just copy & paste the BitcoinIntegration class to your project.

Also have a look at sample-integration-android demo app.taken from Andreas Schildbach’s http://schildbach.de/talks/bitcoin-inapp-payments/

Page 19: Bitcoin   Droidcon Tunisia

ePOSEscrowCustomer Rewards

Android, ScalableCustomer Service IntegrationExchange API IntegrationMulti-factor AuthentificationMulti-signature Transactions

Internet Cellular Network

Gateway Merchant

37Coins - Gateway and ePOS

Page 20: Bitcoin   Droidcon Tunisia

Multi-Signature Transaction

pay to address:

Icons by Olivier Guin from The Noun Project

1 unique key

1 key to unlock

pay to script:

m unique key

n key to unlock

Page 21: Bitcoin   Droidcon Tunisia

System Overview

Page 22: Bitcoin   Droidcon Tunisia

Q&A

Thank you!Contact:

@[email protected]

https://www.37coins.comhttps://bitfinger.org