edcon - hardware wallets and smart contracts

15
Hardware Wallets and Smart Contracts EDCON February 2017 Nicolas Bacca @btchip

Upload: eric-larcheveque

Post on 21-Feb-2017

447 views

Category:

Engineering


7 download

TRANSCRIPT

Page 1: Edcon -  Hardware wallets and smart contracts

Hardware Wallets and Smart Contracts

EDCONFebruary 2017

Nicolas Bacca @btchip

Page 2: Edcon -  Hardware wallets and smart contracts

A trust layer between the blockchain and the physical world

For industrials, enterprises and consumers

Securing the first and last mile

LEDGER TECHNOLOGY

Page 3: Edcon -  Hardware wallets and smart contracts

Without trust, data has no actionable value

node

node

node

node

nodeCloud servers

User on a PC or a smartphone Industrial

sensor / IoT

node

node node

Connected object

Blockchain/ITtrusted zone

Physical worldabsence of trust

Is this really you?

Am I allowed to execute this transaction?

Critical temperature data

Did the driver got switched?

Page 4: Edcon -  Hardware wallets and smart contracts

Hardware Wallets - high level overview

Public data Do you want to roll the dice for 3.1337 ETH ?

YES NO

Operations on private data, with user validation and proof of user presence

Page 5: Edcon -  Hardware wallets and smart contracts

The Smartcard (198x)

Not convenient (reader mandatory and multiple middleware / drivers)

Not designed to operate in a hostile environment (turns into an oracle)

Not developer friendly (Java Card (2000) or bust)

Page 6: Edcon -  Hardware wallets and smart contracts

The USB Smartcard (2005)

More convenient (self reader, drivers preinstalled or no driver necessary)

Not designed to operate in a hostile environment (turns into an oracle with user blind approval)

Not developer friendly (Java Card or bust)

UserPresence

Page 7: Edcon -  Hardware wallets and smart contracts

The Hardware Wallet (2012)

Plug and play (self reader, no drivers necessary)

Designed to operate in a hostile environment

Developer friendly (Native code, Open Source)

UserPresence and validation

Page 8: Edcon -  Hardware wallets and smart contracts

Why ? Cryptocurrencies come with built-in bug bounties

#SFYL

Lost keys

Malwares, viruses - direct financial gain

Ransomware 2.0 - indirect financial gain

Because Why Not

Page 9: Edcon -  Hardware wallets and smart contracts

Ransomware 2.0 - Be Your Own Thief

Derive private key on path 44’/60’/0’/0’/0 (BIP 32)

44’/60’/0’/0’/0/entropy

Do you want to send something to yourself ? It really belongs to you, no problem here, I checked it all

Hey I got some entropy to sell you

Ok, seems legit

Page 10: Edcon -  Hardware wallets and smart contracts

Safe Smart Contract interaction

Bare minimum : verify that you’re performing the right action with the right contract

Extension : verify the action parameters

Not necessary / meaningful for all actions

Different UX might be necessary for individual contracts and actions

Page 11: Edcon -  Hardware wallets and smart contracts

Trustless / Networkless is complicated

Associate an address to an ABI ?

Knowing the ABI is not enough - an example with ERC-20

0x89205A3A3b2A69De6Dbf7f01ED13B2108B2c43e7

A9059CBB Keccak(“transfer(address,uint)”)

00000000000000000000000070faa28A6B8d6829a4b1E649d26eC9a2a39ba413 Destination address 0000000000000000000000000000000000000000000000000000000000000001 Amount with decimals specified at contract instance creation

Page 12: Edcon -  Hardware wallets and smart contracts

Mini Trusted ABI proposal

Decorate a BSON version of the original ABI to mention : Methods for which the data can be ignored (Addresses that shall or may be internal) (Data components to convert to addresses that shall or may be internal)

Add the nonce used when creating the contract

Sign with the creator address

Device can check contract address = Keccak(recovered creator address, nonce) (Device requires the path along with addresses that shall or may be validated)

Page 13: Edcon -  Hardware wallets and smart contracts

Need more ? You can build your own app

Native application 1

Native application 2

Native application 3

MicrokernelUserseed

MMU lock

User modeSupervisor mode

System call

Dashboardapplication

Starts

Page 14: Edcon -  Hardware wallets and smart contracts

Want to dig into it ?

Commit showing ERC-20 integration into our ETH applicationhttps://github.com/LedgerHQ/blue-app-eth/commit/0c094f4fe6e2c2fedd6d05094072c8cdaab9f21c

Nano-S resources : compiler and SDK - https://github.com/ledgerhq/ledger-nano-s

Developer Slack : http://slack.ledger.co

Join us and discuss :)

Page 15: Edcon -  Hardware wallets and smart contracts

Thank you @btchip