Keycard: an open framework for smart cards in crypto

ETHCC 3 · March 2020 · 28:56

Guy-Louis Grau introduces Keycard, an open framework for using smart cards in crypto.

Speakers

Topics

From ETHCC 3, hosted by Ethereum France.

Transcript

good to go you may begin cruel hi everyone I'm Gil we go I'm a product manager with status and we're going to talk about smart cards so we've been working in status for about two years now on key card an open source project and it's a framework for smart cards in crypto applications so I'm gonna go through a couple of things first quickly what are smart cards exactly why we do need them in crypto and why they do solve problems and I'm going to talk about this framework we've developed this is not going to be a super technical talk I would like you to get out of the room knowing that it's pretty

easy to build your own smart cards for your own crypto applications or just use an existing smart card from an existing crypto project like status and build your applications around it so what are smart cards exactly so these are just these are a fascinating piece of hardware these are teeny computers with in with an OS with memory and you can run applications on them and they are built from the ground up as sexual elements and as we'd see these things are very very secure from a hardware standpoint one of the thing that's interesting is

every one of you right now in this room you have probably several smart cards on yourself you I mean your bank cards your SIM cards your passport your transportation cards there are smart cards actually and so message here is that we rely every day dozens of times a day everyone here in the streets on these things for very sensitive operation where you need to identify yourself and identify yourself these things are our reality and actually the volumes are massive there are 50 billions smart cards deploy in the world today and just this year there would be 10 billions more deployed and these

volumes they have consequences you know for the product itself first these things are very standardized they have a very high level of security obviously since there are billions of people using them every day for very sensitive things the security of these devices is under huge scrutiny and they are cost effective volumes are huge and cost as we'd see are pretty interesting and for the users - I mean when the user gets something like this in his hands it immediately recognizes this as something secure where is identity or is information are going to be stored securely and it unbury on usage you've got this in your

hand you understand that is going to be a key for identification or payments so what are smart cards they are bunch of iso standards to specify smart cards I'm not going to go into detail they come in two flavors in terms of interfaces they come with contacts here so that you can plug them within a reader and they are also contactless they use NFC in this case the same NFC that you've got in all your mobile phones and NFC is there to power the card this is a passive device obviously and NFC is also used as a channel of communication to communicate between the device your phone for

instance and the card among smart cards the super vast majority are Java cards and this is what we're going to talk about here today Java card is an open platform it's an OS and on this OS you can run as the name says Java applets so you can develop your own Java applet in Java of course and you can run them in any Java Carla and you can run multiple applets in in one card a couple of words on how these things are manufactured since some of you might want to build some smart cards and manufacture them so there are three main steps first we need to

produce the module here then you need to manufacture the card itself and then you need to personalize it as for the modules there are a handful of on the market these are silicone guys I've listed them here they are they have a level of technically that's super high they make way first and that's pick and placed into these modules these guys go through formal certification for their design process and from when you get these modules then they are what's interesting is that you've got hundreds of factory that are then able to manufacture the cards from these modules whatever your country is there are

several factories in your country that's able to manufacture that the level of technique city here is much much lower these are guys that are able from this module to inject that in some inlays plastic layers or in some other form factors here like a female they did this ring with NFC and you're gonna then need to personalize the cart with a set of scripts to load your applets and so on message here is that yeah it's pretty easy to find factories to manufacture these devices and the costs are pretty cheap such a card in the quantity like 1000 pcs it costs roughly two dollars so that is this pretty cost-effective so

what problems are we solving with math cotton crypto mainly three things first obviously we're talking about security here the overall idea is to store your private keys here your private keys are never leaving the car and you make audio signatures on the card and obviously your private keys are the security is paramount I mean it controls all your assets maybe your identity maybe your rights so the place where you store them is super important should not be on a server which would rather not be on the connected device like your phone so we basically the message is we need Hardware wallets in crypto and we need a variety of them we need different interfaces different costs different

usages and smart cards are super interesting there are teeny they are cheap they are super secure so they are important here then we've got this paradigm shift from the decentralized world to the centralized world that's pretty hard to explain to user where you go from a login and password paradigm to a private key paradigm and it's pretty important for your own users that they understand that that their sole owner owners of their private keys that they are not going to be able to we're not going to be able to recover them for them and the fact that I mean are where wellit's are helping here there are tangible things where the private keys are if you lose

your hardware well let's accept it if you've got a minimum key you lose these keys and last thing is about onboarding we've got it's pretty obvious we've got an onboarding issue beyond crypto if you are the app developer it's still pretty hard to guide your users from awareness of your DAP to the moment they are really able to interact with your DAP with some assets I mean how do you get your user to get the right app I mean the right browser the right wallet and to get some assets to interact with your DAP and we're gonna see how we can help with that some example of integrations this is the most obvious ones so obvious one this can be your hardware wallet if you

want mobile wallets developer you can use this card to store your keys your app is going to do all the UI it's gonna Forge the transaction for the user and then when you need to send a transaction you're going to transfer the transaction or its patch to the card it's going to be signed on the card and then send back through just one tap to your mobile application you get your signed transaction this work with desktop - if you've got a USB reader connected to your to your desktop so for desktop wallets you can also use smart cards then you've got payments I mean these embody payments better than anything else if you want to make physical crypto payments you can develop systems where

the transactions are created by point of sales and then user just can tap their card to pay directly with crypto we're not talking about some Visa gateways here but pure crypto payments then these things can be also a bridge between the blockchain and the physical world let's assume you're able to fix a smart card NFC smart card into an object in a way that you cannot remove it from the object then you can have this object sign a transaction on the blockchain when you are in the proximity of the object this can have application for work of art or any type of objects

obviously you can limit contra feet like that by authenticating the objects you can track the history of the object the provenance and more generally in supply chain you can also track directing on the blockchain the the life of these objects an interesting one now are pre-loaded cards you can build cards that come pre-loaded with some assets whether if you see 20 or NF T's and this is a great marketing tool because you can print things on this you can brand them you can offer them in events you can sell them you can put them in racks in stores and this solves part of the

onboarding problem we were talking about remember let's say you adapt developer you want to create some awareness of your DAP you want to get users to get the right wallet the right browser to get some assets with this card you can make your tab tangible you can then tap the card to download the right application on your phone let's say for instance status which is a web free browser coming with a wallet then you can tap again to directly go to your tap just like a contact a strong code and this comes with some assets to start off with your tap so that that's that's really interesting some more examples and here imagination is your is the

limit so nas is safe they've integrated key card code as a second factor for multi-sig for signature on the emergency go wallet grid plus they've integrated a fork of key card into their safe card card which is integrated in a hardware device which is called duality chain and explained which is a venezuelan payment provider they have they are replacing the printing of paper QR codes by providing key cards for their users in shops that give fiat to crypto instead of getting a printed paper with a QR code the users get a card I'm now

going to talk about key card per se the framework that we've developed well first off the philosophy is really I mean this project is totally open we're not in here for the money everything's open source you can use it you can fork it you can manufacture on your own cards we'll be happy to help you can also ask us to manufacture cards for you since we've got a production set up and they are I mean so what's in the kickoff framework there are a couple of things there are three Java card wellit's sorry applets that run

concurrently in the cards there's an API one API to reach to these three applets and we've developed some SDKs for Android for iOS and there's a command-line interface also to control click on these three applets do things do different things key card wallet is the main applet it's here to provide a lot of security and it's here to store value in the most sexual way possible and I'll come back to that NFC tag applet is a super simple one it just allows the car to behave like a contactless record and key card cash is a simpler version of the key card wallet

applet which is not your so much to store value but here to sign meta transactions and I'll come back to that and it's mostly about user experience and and knowing payments with the cards so some more detail key card wallet applet so it's basically a Yoshi called deterministic bib 32 wallet here you can either generate on card with the true number generator of the card a seed or you can import it from your phone and when you've got this seed you can then derive the master secret on any b32 path you could also just load

one given key pair here and then you can sign with the the card in terms of security obviously private keys never leave the card that's obvious and for any interaction with the card here you need to have preset a set your channel between your wallet or up and the card and you set up the sexual channel by sharing a symmetric secret between the two the two parties I mean between the phone and the card and for any interaction you also need to enter a pin with the card so that's to store value and here we are really talking about this whole wallet scenario then we've

got the NFC tag applet here you emulate an FC tag it's super simple with the API you can set the end F record which is the value of this link or this track code or this piece of data that we want to share between the phone and the two of you stages are you just want to tap your card and download an app this is going through this applet or you want to open a deep link for instance from your application with of your DAP you can do that through the this applet and kick up cache so it's a simpler way let applet here also you can generate keys actually you can generate one one

key pair on the card and signs transaction the big difference is that here you don't need to set up I mean it has a lower security profile you don't need to set up a sexual channel or enter PIN to sign transaction so I'm gonna come back on why it's useful but these all those payments and I'm gonna give another example about that just one point about how taps can interface with key card the first abuse cases you go to your DAP with the web 3 browser this way 3 browser is linked with a wallet of some sort if this way that integrates with the hardware

wallets and key card is one of them then any transaction provided by the DAP is going to be signed by your wallet and that's your key card that's the obvious example it works free status but there you need to set up a sexual channel beforehand before any interaction between the DAP and the card so there's a second way to do that something we've developed on status for now instead of app I mean that's something we we call the request screen you can allow adapt to create a transaction and and request any key card even a key card has never been used with your device to sign this transaction so the obvious case is

payments let's say you've got a point of sale that's running status and you're browsing a point of sale DAP you want any key card to be able to tap a transaction and pay you don't want the customer in front of you in a physical shop to just stop pairing and you don't even want into dial-up in because you don't necessarily trust this point of sale so the way it goes is the DAP is going to for two action and call this request screen so we made the web 3GS extension to call this request screen then this request screen is going to be shown a user can tap his card and add a panda get the meta transaction signed an example to explain these and how the different

applets are used let's consider the case of the preloaded a the preloaded card I was talking about let's say you want you know to offer or to sell cards that come pre-loaded with some assets and you want to guide the user through redeeming of these assets to a sexual wallet how is that gonna go so what we suppose here is that we've deployed a smart contract with its tap to redeem the value from the card actually it's stored on the smart contract before it's redeem to a sexual wallet and this smart

contract is going to hold a list of all the key card public keys and a list of the ash of the redeem codes and obviously also the assets that are associated with the cards so the flow is going to be pretty simple so you first user first needs to get starting get get started he's going to tap the card and well we don't see the colors here but the NFC tag applet is going to be used to just download the right while it can be status for instance it's going to download the wallet then the user is going to be guided within this app to

set up his key card wallet so here we're interfacing with the wallet applet and then if you tap again the card we're going to launch a redeeming tap and from there this tap is going to create a transaction to redeem through the smart contract the value and this is going to call the kick up cash applet is going to sign this method transaction and the contract is going to make all the Sectary he checks to see if it's the right key card that was tapped and if the users as entered the right redeeming code because it stores the ash of this code and from there the spot contract can release the assets to the sexual wallet which is

stored on the key card wallet so that's your roll flow and what I wanted to to illustrate here is that these three applets they are all of their utility and they and in this example they are really solving some on boarding and user experience issues so if you want to get started with this you can go to kick up the tech you'll find all the documentation there if you want to get some key cards you can get them also on this site we are super happy to help with your projects if any of these use case ring a bell to you we've got some repose for all of these use cases the redeeming one we've got a smart

contract so please just reach out to us we'll be super happy to help thank you [Applause] questions yes thank you very much I was wondering in the case of the preloaded card when and where does the key generation take place so I'll come back to the slide so that there are different a set of keys here the what we support here is that when we create the card so in the

factory actually or the group that prepares discard the key Cup cash as a key pair so the card comes with a key pair and kick up cash applet then the key card wallet where the value is going to store this be stored after the redeeming is created by the user actually so yeah it's a two-step process anyway so you're saying about preset there is year C 20s the NF T's so

basically I can deploy any year see 20 and program it into the card to let other other people use the the year see 20 with the card yeah I mean you know if you're talking about the preloaded case I've been describing here actually it's the the contract that's owning these assets whatever they are if n F T yes or 20 and you're the contract is just releasing them to the wallet so yeah you can use any of these assets the card is just in this case the card is just a way to prove to the contract that you all

the right card and you know the right redeeming code and it instructs the contract to release the asset to the situate of your choice and that we've designed this this way because we don't want the assets' to be you know blocked within the cards we could have made each card the owner of the assets' but then if you have a batch of 500 cards and it gets stolen then you stole I mean the assure of the cards loses everything here is really the contract that's holding the asset until the each card is being activated okay thank you so much many questions you mentioned an Android SDK does that mean

that it could be used as a in a similar form factor and use from boys in Android talking to the same yeah yeah okay I got your point yeah absolutely then it's the time of are you interface with the card and the api's with the cards then you're not using the contact that's interface but direct communication with the comp but yeah you could use the key card a pet within the seam of the phone if you're a telco and want to offer to your customers Hardware with it within the steam that's something you can do yeah okay but unleash your telco or if I'm myself from

the on the second sim set well then it's a question of your rights to win start an applet within your seam and you know if you within your own team within the phone the lights your same well this your same on the second seems okay it could work it's really a matter of how you can access this from the Android OS okay we can we can check that okay thank you yeah yeah yeah yeah yeah sorry yeah I think I think it will work so the

thing that you will be missing is that you will need to develop some kind of dummy probably sim application so that the baseband is happy but that maybe some things that could be contributed as open tools on it doesn't have to really connect to a network just has to be a fake sim and then you can use the Android API so I think they are deal from seek or something like this to communicate with it so yeah definitely doable in my opinion some are security questions when the key is generated inside welder first can i upload myself the applet in in a Jerrica I mean your yeah yeah you can

because if I want to compile it myself and yeah I mean well so status we are manufacturing some cards and there's a key I mean there's a stand-up called global platform and a key that allows you to change the applets within the card and the key here we made it public so if you get some status cards you're gonna be able to play with it the way you want and download any updates there okay and the secret key is it stored in a secure storage within the Java framework and yes it is within the applet yeah we yeah and it's part of the Java framework security okay thank you

Fred we're out of time okay thank you very much [Applause] that's what I'm wondering

yeah