Support ECDSA(secp256k1) keys #221
tinker-michaelj
started this conversation in
Ideas
Replies: 1 comment
-
Ed25519 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Overview
At present, the only kind of cryptographic public key that may appear in a Hedera key structure is an Ed25519 public key. It follows that users can only secure their transactions using Ed25519 signatures.
Some users, however, might prefer to use ECDSA(secp256k1) keys as on the Bitcoin network.
This idea is to enable support for ECDSA(secp256k1) by,
Protobuf changes
Only two protobuf changes are required. To the
Key
message type, we need to extend theoneof key
with a new choice:To the
SignaturePair
message type, we need to extend theoneof signature
with a new choice:Protobuf field usage
When a user is creating or updating a Hedera key structure to include a ECDSA(secp256k1) public key, they should set the bytes of the
Key.ECDSA_secp256k1
field to the compressed form of the public key. (That is, the first byte should be0x02
if they
-coordinate of the key is even, and0x03
if they
-coordinate is odd; and the following 32 bytes should be thex
-coordinate as an unsigned 256-bit integer.)For example, if the user's key pair has,
Then the hex-encoded bytes of the
Key.ECDSA_secp256k1
field should be,While if the key pair has,
Then the hex-encoded bytes of the
Key.ECDSA_secp256k1
field should be,When a user is providing an ECDSA(secp256k1) signature in a
SignaturePair. ECDSA_secp256k1
field, it should be the full result of signing theSignedTransaction.bodyBytes
from the top-levelTransaction
with the relevant ECDSA(secp256k1) private key.Node software enhancement
The implementation is relatively straightforward, with the main possible concern being a performance impact relative to verification of Ed25519 signatures.
If this impact proves significant, it would be necessary to throttle transactions with ECDSA(secp256k1) signatures to a somewhat lower TPS than for Ed25519.
Beta Was this translation helpful? Give feedback.
All reactions