Skip to content
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

Nimbus cannot import a keystore exported from Prysm #4107

Closed
yorickdowne opened this issue Sep 10, 2022 · 5 comments
Closed

Nimbus cannot import a keystore exported from Prysm #4107

yorickdowne opened this issue Sep 10, 2022 · 5 comments

Comments

@yorickdowne
Copy link

Describe the bug

The pubkey was formatted wrong. Error: Invalid keystore objects found

Possibly because of pbkdf2 instead of scrypt?

{
        "crypto": {
                "checksum": {
                        "function": "sha256",
                        "message": "54fc80f6d0676bdae7c968e0d462f90a4e3a028fc7669ef8527e2f74386c9b36",
                        "params": {}
                },
                "cipher": {
                        "function": "aes-128-ctr",
                        "message": "3c2540f69cbe7e66c0c4a6e416e99bf0d1056399c21b4c45552561da920871fa",
                        "params": {
                                "iv": "98a15bd46d258aceecaeeab25bddf5e2"
                        }
                },
                "kdf": {
                        "function": "pbkdf2",
                        "message": "",
                        "params": {
                                "c": 262144,
                                "dklen": 32,
                                "prf": "hmac-sha256",
                                "salt": "c0abbbbda36e588824865a71b5b34d5a95335fe1077c286d4e9c844f7193c62b"
                        }
                }
        },
        "uuid": "39796eb1-2e43-4353-9f13-5211c7ddc58c",
        "pubkey": "8ed78a5495b54d5b6cc8bf170534ecb633b9694fba121ca680744fa9633f1b67cc77c045f88a6f97be781fe6c2867646",
        "version": 4,
        "description": "keystore",
        "path": ""
}
@mratsim
Copy link
Contributor

mratsim commented Sep 10, 2022

That's really curious, we test that exact keystore following #3884

prysmKeystore = """
{
"crypto": {
"checksum": {
"function": "sha256",
"message": "54fc80f6d0676bdae7c968e0d462f90a4e3a028fc7669ef8527e2f74386c9b36",
"params": {}
},
"cipher": {
"function": "aes-128-ctr",
"message": "3c2540f69cbe7e66c0c4a6e416e99bf0d1056399c21b4c45552561da920871fa",
"params": {
"iv": "98a15bd46d258aceecaeeab25bddf5e2"
}
},
"kdf": {
"function": "pbkdf2",
"message": "",
"params": {
"c": 262144,
"dklen": 32,
"prf": "hmac-sha256",
"salt": "c0abbbbda36e588824865a71b5b34d5a95335fe1077c286d4e9c844f7193c62b"
}
}
},
"uuid": "39796eb1-2e43-4353-9f13-5211c7ddc58c",
"pubkey": "8ed78a5495b54d5b6cc8bf170534ecb633b9694fba121ca680744fa9633f1b67cc77c045f88a6f97be781fe6c2867646",
"version": 4,
"name": "keystore",
"path": ""
}
"""

@yorickdowne
Copy link
Author

Yep I keep testing with that same keystore. Testing once more: Confirmed Nimbus is current, version=v22.9.0-667c3c-stateofus. And confirmed I cannot import it via keymanager API, Error: Invalid keystore objects found.

OK this is a bit more helpful. That actually is correct, Prysm is to blame:

WRN 2022-09-12 12:58:28.226+00:00 Invalid keystore                           err="/val_keys/keystore-0.json(29, 2) Unexpected field 'name' while deserializing Keystore"

If I change that to description then it imports correctly via CLI, but still fails on keymanager API with Error: Invalid keystore objects found

If you can guide me towards a way of seeing which objects the keymanager API thinks are invalid, I'll get you that information.

@yorickdowne
Copy link
Author

Prysm name issue tracked here: prysmaticlabs/prysm#11437

Note that manually correcting this does not allow import via keymanager API. I'll dig some more to see why that might be

@yorickdowne
Copy link
Author

Found the culprit.

"path": "" fails, "path":"m/12381/3600/6/0/0" works. It looks like keymanager API cannot handle an empty path.

@yorickdowne
Copy link
Author

Jim would prefer that you accept name during import, see https://discord.com/channels/631913675179163659/681452240904650753/1018913193642438716 (attestant discord)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants