-
Notifications
You must be signed in to change notification settings - Fork 217
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Got an error when trying to import PVT_K1 format private key #168
Comments
Could you provide a dummy private key that exhibits the problem? Do not post your own private keys! (Sorry for this over caution comment) |
The format I had issues with is like this: PVT_K1_ZZZZZZZZZZZ555555555555. |
@cream-cheeze The
And this pass. if I use
Would you have one that was is valid and was not working as expected? |
You are right, sorry for misleading you. I provided you with the wrong examples. Actually, I did not try to use a public key in my code - the key I've used and which was OK is of such format: 6YHa4...aRyt |
Try this one: PVT_K1_6AcEnhoMbeiCUa53Kkly79XvAgOPdNwWBuNY6qhhrb55EH1iUC - I've just modified some symbols of one of the existing PKs - the length is the same. Such PKs are used in the Proton chain. |
I should have been clearer about the "dummy" key, meant a valid one that is not working that can be publicly shared. I tried the provided I get that you cannot share the private key that you initially had problem with. How did you generate it do you remember? |
I've just created an account with Proton Wallet (WebAuth.com) - it generated PK for me. OK, I will generate a new one and will post it here in a while. |
Here you go: PVT_K1_3mP9KLWYvrZtreadWBGGV1ZGu8L6EJ1JryJjFoxzGPeP5AxCX - it is the real one not used anywhere. It is successfully reading with the Anchor wallet, for example. |
Ok so even with How it was generated, I would like to know to better find why the key is malformed according to the crypto lib we use. |
This is the problem - that the lib recognizes the key as malformed. It was created by WebAuth.com (Proton) mobile wallet. |
But is it a WebAuthn key? If it's a WebAuth key, then it's normal that it doesn't work, WebAuthn has not the same format and payload info as a K1 key. |
To be honest, I did not investigate the WebAuthn private key part, I did the public key portion but not the private key part. So I'm wondering if it's prefixed with Not clear. |
When I registered on WebAuth.com, I did get a |
But how does Anchor understand this key with no problem? There is a note on the protonscan.io about public keys: I assume the same is true for private keys. If so, it looks like it is just another format of writing a key. For example, for public keys I can see both versions: |
I've meant the WebAuth.com mobile wallet - I've created an account in there. |
So if I use their converter to convert from Now what I'm wondering is how to handle them. Our current code is simply removing the Two possibilities:
I think the first bullet makes more sense, but I'll need to perform extra testing. |
I checked with The I should be able to fix that. |
When I'm trying to import PVT_K1 format private key I got the error: "malformed private key".
With old PK format works fine.
The text was updated successfully, but these errors were encountered: