Hardware wallet and method to securely sign a transaction with a hardware wallet
A method and hardware wallet to securely signing a transaction. This includes the hardware wallet receiving, from a host application of a host device, an unsigned transaction and a coin seed associated with a cryptocurrency coin of the unsigned transaction. The hardware wallet generates a private key based on: a root seed stored in the storage medium of the hardware wallet; and the received coin seed. The hardware wallet cryptographically signs the unsigned transaction with the generated private key to generate a signed transaction and sends the signed transaction to the host device.
1 . A method of securely signing a transaction at a hardware wallet, the method comprising:
receiving, from a host application of a host device, a request to sign an unsigned transaction, wherein the request comprises the unsigned transaction and a coin seed associated with a cryptocurrency coin of the unsigned transaction;
generating, at the hardware wallet and responsive to receiving the coin seed, a private key based on:
a root seed stored in a storage medium of the hardware wallet; and
the coin seed;
cryptographically signing the unsigned transaction with the private key to generate a signed transaction; and
sending the signed transaction to the host device, wherein:
the private key has a corresponding public key in a cryptographic private-public key pair; and
the signed transaction is associated with a wallet address derived from the public key.
2 . The method according to claim 1 , wherein generating the private key comprises hierarchical deterministic key generation based on a first cryptographic hash function applied to the coin seed appended, or prepended, with the root seed.
3 . The method according to claim 2 , wherein a cryptographic output of the first cryptographic hash function includes:
a first portion to form the private key; and
a second portion to form a chain key.
4 . The method according to claim 1 , further comprising
receiving, from the host application of the host device, a second request for a second unsigned transaction, wherein the second request comprises the second unsigned transaction and an alternative coin seed associated with a different cryptocurrency coin for the second unsigned transaction; and
generating, at the hardware wallet and responsive to the alternative coin seed, a second private key based on the root seed and the alternative coin seed.
5 . The method according to claim 1 , wherein the coin seed received in the request to sign the unsigned transaction is in hexadecimal format.
6 . The method according to claim 1 , further comprising, in an initialization mode:
generating a mnemonic phrase comprising a plurality of mnemonic words;
generating the root seed based on the mnemonic phrase; and
storing the root seed in the storage medium.
7 . The method according to claim 6 , wherein the step of generating the root seed is based on a password based key derivation function applied to the plurality of mnemonic words in the mnemonic phrase.
8 . The method according to claim 1 , further comprising, in an initialization mode:
receiving, from the host device, a mnemonic phrase to generate the root seed;
generating the root seed based on the mnemonic phrase; and
storing the root seed in the storage medium.
9 . The method according to claim 1 , wherein:
receiving the request to sign the unsigned transaction comprises receiving the unsigned transaction from a card acceptance device associated with the host device; and
sending the signed transaction comprises sending the signed transaction to the card acceptance device associated with the host device.
10 . The method according to claim 1 , wherein the hardware wallet comprises a Java Card enabled smart card configured to operate a Java-based application to perform the method.
11 . A hardware wallet comprising:
a storage medium configured to store a root seed;
one or more processors configured, individually or in combination, to:
receive, from a host application of a host device, a request to sign an unsigned transaction, wherein the request comprises the unsigned transaction and a coin seed associated with a cryptocurrency coin of the unsigned transaction;
generate, responsive to receiving the coin seed, a private key based on:
the root seed; and
the coin seed;
cryptographically sign the unsigned transaction with the private key to generate a signed transaction; and
send the signed transaction to the host device, wherein:
the private key has a corresponding public key in a cryptographic private-public key pair; and
the signed transaction is associated with a wallet address derived from the public key.
12 . The hardware wallet according to claim 11 , wherein the one or more processors are further configured, individually or in combination, to generate the private key with hierarchical deterministic key generation based on a first cryptographic hash function applied to the coin seed appended, or prepended, with the root seed.
13 . The hardware wallet according to claim 12 , wherein the one or more processors are further configured, individually or in combination, to generate a cryptographic output of the first cryptographic hash function that includes:
a first portion to form the private key; and
a second portion to form a chain key.
14 . The hardware wallet according to claim 11 , wherein the one or more processors are further configured, individually or in combination, to;
receive, from the host application of the host device, a second request for a second unsigned transaction, wherein the second request comprises the second unsigned transaction and an alternative coin seed associated with a different cryptocurrency coin for the second unsigned transaction; and
generate, responsive to the alternative coin seed, a second private key based on the root seed and the alternative coin seed.
15 . The hardware wallet according to claim 11 , wherein, in an initialization mode, the one or more processors are further configured, individually or in combination, to:
generate a mnemonic phrase comprising a plurality of mnemonic words;
generate the root seed based on the mnemonic phrase; and
store the root seed in the storage medium.
16 . The hardware wallet according to claim 15 , wherein the one or more processors are further configured, individually or in combination, to generate the root seed based on a password based key derivation function applied to the plurality of mnemonic words in the mnemonic phrase.
17 . The hardware wallet according to claim 11 , wherein, in an initialization mode, the one or more processors are further configured, individually or in combination, to:
receive, from the host device, a mnemonic phrase to generate the root seed;
generate the root seed based on the mnemonic phrase; and
store the root seed in the storage medium.
18 . The hardware wallet according to claim 11 , further comprising:
a communication interface configured to communicate with a card acceptance device associated with the host device, wherein the one or more processors are further configured, individually or in combination, to:
receive the unsigned transaction via the communication interface and the card acceptance device; and
send the signed transaction via the communication interface and the card acceptance device.
19 . The hardware wallet according to claim 11 , further comprising:
a Java Card enabled smart card configured to operate a Java-based application using the one or more processors.
20 . A data storage device comprising:
means for storing data to store a root seed;
means for receiving, from a host application of a host device, a request to sign an unsigned transaction, wherein the request comprises the unsigned transaction and a coin seed associated with a cryptocurrency coin of the unsigned transaction;
means for generating, responsive to receiving the coin seed, a private key based on:
the root seed; and
the coin seed;
means for cryptographically signing the unsigned transaction with the private key to generate a signed transaction; and
means for sending the signed transaction to the host device, wherein the private key has a corresponding public key in a cryptographic private-public key pair and the signed transaction is associated with a wallet address derived from the public key.