eos icon indicating copy to clipboard operation
eos copied to clipboard

Can't create K1 type key with YubiHSM 2.1

Open jingzhehu opened this issue 7 years ago • 2 comments

When executing cleos wallet create_key K1 -n YubiHSM, a R1 key is produced instead of a K1 key expected. Example output:

$ cleos wallet create_key K1 -n YubiHSM Created new private key with a public key of: "PUB_R1_6c1yXZCyTuGSUr2oD8rQvXkdZ4Ntb6nipyFmExmBkARuQ3FviZ"

hardware: YubiHSM 2.1 cleos v1.8.0-rc2 yubihsm2-sdk-2019-03-darwin-amd64

@spoonincode Could you help me out ?

jingzhehu avatar May 17 '19 01:05 jingzhehu

Currently the yubihsm wallet does not support K1 keys. That it doesn't error out on this command is a defect that needs to be fixed.

The reason K1 isn't supported at the moment is due to #6699. If we were to sign with k1 on YubiHSM we would need to potentially sign multiple times so that we get a signature that satisfies eosio's arbitrary constraints on r & s values. The YubiHSM takes somewhere on the order of 75ms to sign. That means depending on how unlucky you are it could take the YubiHSM over a second to sign a single transaction as we may have to ask it to sign 15+ times. Additionally, if a key was marked as having a touch requirement for signing, the user may have to touch the device multiple times for signing a single transaction.

Is there a particular reason you really want a k1 key when using the yubihsm?

My long term plan was that once #6699 is fixed (and is activated on most public chains) to add k1 support to yubihsm wallet at that point.

spoonincode avatar May 21 '19 14:05 spoonincode

Thank you for the detailed explanation !

At the moment, I don't have to use K1 keys and can make the switch to R1 keys relatively easily. Will close the issue for now.

jingzhehu avatar May 22 '19 22:05 jingzhehu