The Keycard hardware wallet smartcard explained

Keycard is a smartcard that comes with two pre-installed applications, the one you use as a hardware wallet paired with your devices and authenticated with a PIN, and the Cash applet, which can be used straight away without any other device.

Keycard is a smartcard, not to be confused with other NFC tags or cards used only for storage or authentication. It works like other hardware wallets, meaning that it’s able to generate a private key that never leaves the card and can compute an ECDSA signature internally.

Smartcards are known for their very high level of hardware security, leveraging all the work done in the banking/telecom/access control world for years, allowing us to store wallet keys safely since they never leave the card. The Keycard software is a completely open source Java Card applet, and can be installed on any smartcard/Java Card that meets these requirements. It allows deriving keys and signing transactions for any cryptocurrency using the Secp256k1 curve and a 256-bit hash.

About Keycard

Some months ago we started distributing Keycards to developers, and in October we had a workshop at Devcon 5.

Some teams and developers already integrated Keycard in their projects, like Status (available after V1 is released), Geth, Walleth, Gnosis Safe, Grid+, and others.

Keycard is dual-interface: contactless (NFC) and contact. You can interact with it by selecting one of the two applets and sending APDU commands. If you don’t want to send raw APDU commands, you can use our Java/Android, Swift/iOS, and Go SDKs.

If you want to know more about the available commands, you can check the Keycard API documentation.

When you buy a Keycard from our website, you receive it with the Keycard and Cash applets pre-installed, but you can use the keycard CLI to re-install them or to install them on a different smartcard. You can also use the CLI to send custom Keycard or standard GlobalPlatform commands.

The Keycard Applet

The main purpose of the Keycard is to be used as a hardware wallet with the Keycard applet, which implements a full hierarchical deterministic wallet.

When you receive the card the applet is installed but not initialized. This means that it doesn’t contain any key, and it needs to be initialized to be able to sign transactions. During the initialization process we generate some secrets that we’ll need later to use the card:

  • a pairing password needed to pair the card to a device.
  • a PIN needed to sign data and transactions (and for other commands).
  • a PUK needed to reset the PIN.

After initialization the card is ready to be paired with a device using the pairing password. Pairing generates a pairing token, which is then used to open a secure channel for each session to prevent MITM: all sensitive data exchanged between the card and the client, like authentication credentials, is sent over this encrypted channel.

Once initialized, we can generate a new key with the GENERATE KEY command. In other cases, it’s also possible to import a normal key, an extended key, or a seed derived from a mnemonic phrase following BIP39.

The master key never leaves the card. Now that we have it, we can derive a key with any valid derivation path and sign any 32 bytes of data with it, after authenticating with the PIN generated during initialization.

The Cash Applet

We recently added a secondary applet, the Cash applet, a simplified version of the Keycard applet. At installation time a normal (not extended) key is generated, and it remains on the card. It doesn’t need to be paired with another device and can be used straight away to sign data, without setting up a secure channel. This allows the owner to use the card without requiring a phone, for example with a merchant point of sale or in any other creative way…

…or just with a phone that a merchant wants to use as a point of sale: