DAPPCON 2018: Integrating Hardware Wallets in Dapps: the Way Fwd with Dapps - Nicolas Bacca (Ledger)

DappCon 2018 · July 2018 · 10:43

Nicolas Bacca of Ledger discusses integrating hardware wallets into decentralized applications at DappCon 2018, covering the path forward for dapps that need secure, offline key storage. The talk addresses how hardware wallet support affects usability and trust for users signing transactions on Ethereum.

Speakers

Topics

From DappCon 2018, hosted by Dappcon Berlin.

Transcript

hi everybody thanks for the intro thanks for the music so I'm Nicola Becker CTO and co-founder of ledger so my talk today will be about looking at how we can make better hardware wallet to integrate a bit more deeply into new decentralized applications so I will be reviewing the different attacks that can be done to the smart contracts the different problems that we have who we can solve them so I pretty much gave the same version of this talk at ETH DC earlier in March so if you already were attending eg HEC you can start playing the Olympia game and your smartphone or something else but that's basically the introduction of a framework to start the discussion so let's go several problems

so first for those who are not really aware of how other wallets are working and what problems are trying to solve so it's quick very quick summary so the typical user computer is looking like that so it's kind of a piece of scrap punch together so if you're trying to hold the private key on this computer you might run into some issues later you might lose some funds so here's the hardware wallet is performing all cryptographic integration operations inside a secure device the idea is to prevent people from stealing the private keys first and to prevent smart malware that could either make you sign something you don't want to sign or that could just well make you lose money because it's fun so the different problem that you are

for Hardware wallet is that it's pretty simple to sign a transaction but if you want to interact with a must with a more sophisticated contract if you are running a specific operation you need a proper UI on the hardware wallet and that's really the main issue there who do we end up with a UI that's match the smart contract you are interacting with so why do we want to look at this problem or first because it's interesting then because it's a very I mean it's a complex problem that will tackle different steps of integration so you want to be properly integrated into the browser you want to provide the right information to users and finally well it's a good way to protect trades and to let people handle the private

keys and trade well decentralized exchanges are good example of people owning their keys and performing performing actions while owning all the while owning everything in my opinion so where are we today so that's ledger specific that could be applied to a lot of other hardware wallet we are basically integrated in all kind of decks based on geo X so the right is a good thing with your X is that since it's a common protocol once you integrate it into your ax you integrated everywhere so people did the initial integration and then we can support basically all others and then people got a hint of how to do it and implement it it also changes as well so I would say that the use of hardware

wallets for decentralized exchange is pretty widespread but the UI is not yet there so if you are trying today to trade using a decentralized exchange and hardware wallet you will get a very confusing string on your hardware wallet saying you are trying to sign something with that but you don't know what you're signing so it's ok I mean if your computer is not to compromise but if you have creative malware on it and it's not that right so if what could you do today if you want to start playing with ledger and JavaScript API so we have a nice JavaScript project which has been redesigned by gaetano duo on our team so if you are familiar with the old version from one year ago the new one is completely different it's actually

usable and written by somebody who knows JavaScript so unlike me so that's something that you can use and that quite nice you even have a smarter starter kit and some documentation so that's well interesting regarding how we managed to integrate Hardware wallet into the browser which is something interesting to do so we managed to hack on u2f which is an authentication protocol to use it to pass comments to the hardware wallet so u2f is usually done to just perform a signature so the idea was to replace passwords by your cryptographic signatures and you do that by exchanging a challenge to a server asking the server to sign a challenge and previously registering and having

the server store private key which is encrypted and only usable by the device so it's a common registration and I don't protocol but here you can modify a few things so typically if you modify your handle and instead of your handle you pass a comment and if instead of returning a signature your return a response you can build the tuner inside you to F so that's what we did and what those other wallet manufacturers I've been doing to provide an integration inside a browser so it's a very ugly hack functionally speaking but it works so since we want to access the device from the browser that was an easy way to do it and the negative side we don't get events and device connection reconnection so I mean the apps will

miss those kind of information and the UX could be made better on the plus side we get a guaranteed hash of the web origin when we when we use u2f so that's something that can be used to enforce on that's actually an application is coming from the right website tomorrow so that some things that's getting developed and that should be ready in a few in a few months so web USB support will provide a direct access to the USB devices from a web page so that would be less hackers and u2f that's a plus style on the minus side you will we will loose for examples of free web origin there will be a similar version for Bluetooth so if you want to integrate today if you want to

use a device from a browser web USB is interesting to look at even if it's not widely supported by everybody right now so we have done the protection of private key when we transact but now if we think about the different attacks that can happen when we interact with the comte right so how can we verify that we're integrating with the right website with the right contract to the right token and what does a different attack that can be done from there so first verifying that you're integrating with the right website so we have seen that people get creative replacing websites so easily by hacking DNS or by hacking lower part of the infrastructure so we have seen issues with it at all time with even with my HR wallet I think are some well some weeks ago so here you

to F can help because you will receive on the web origin Susy Hardware wallet of the device will be able to check which website the user ng is interacting with which is a hard initially so it's hard to solve but in order to properly verify that the hash matches the website you are interacting with you need to have a twisted stuff web origin hashes so you basically move the problem from not knowing anything to needing centralized stuff so it's it's not exactly good very things that you're interacting with the right nut contract so ENS helps on the host button the device it doesn't help much if you don't touch this registered origin either and well it couldn't driven typosquatting

that what some things that people have been exploiting and regular desktop applications as well so that's good but not enough if we want to properly protect the users let's say now if you if we want to interact with tokens we have kind of the same problem so we need to verify that the token name is matching the right come try to address for this token so we could have a trust we could have with process store as well but then we have the gain a centralized problem and how can we well how can we solve that firm so last problem when we are interacting with a smart contract we are going to call it function and we want to verify that the function that we are calling is actually the right function because otherwise a smart

malware could start pinging you and asking you to do something and you come to act while you are interacting with another part so presenting a high level version of the API is nice enough but if you want to have a proper UI and if you want to actually the user to understand what they are signing you need something a bit more specific so there is already a solution which is generic with message shining type I mean type message signing with the IP 712 it lets you verify everything that an operation would be signing but it might not be good enough for proper UX as well because if you are signing a complex structure like this

one in the end you don't want to give all these versions you don't want to give all this information to the user typically you don't want the user to verify the version that they are signing of the odds well you want to add your UI which is exactly matching what the contract is doing but you a generic API for that is kind of difficult in my opinion so the proposal is since we have seen that we need to be centralized a few things the proposal the main idea of the proposal is to have a new version I mean two other new API that will let you design specific application when you interact with this not contract so here's the smart contract would download a small application living into the hardware wallet that will manage the specific UI

part of the contract so that way if we manage to agree between different manufacturers we could load some kind of byte code that would be present what the contract is actually hosted hosel UI of the contract is actually played on the hardware wallet and move from there and have a really native UI regarding to the contract that would well solve that problem and solve the different scans that people can run on contrite so what is this API going to look like that's kind of an open question with a first framework to do that in C so with our own SDK but people might want to think about a way to actually write some kind of standard to think about how those applications could be coded for

the hardware wallet so on our side the way we will do the way we will do it so we will turn over a Tyrian application into a library that's an operation we have already done with Bitcoin so you will be able to load small applications that call back to that library for everything that's common to aetherium and implement a specific contract UI into this application so you will run we will load the application alongside to come to I delete it when you don't need it and this way I provide a completely native UI when interacting with the application so I had a few sly I had one side about our architecture but then since I am a bit short on time I will skip it so thank you [Applause]