horcrux icon indicating copy to clipboard operation
horcrux copied to clipboard

reconstruct priv_validator_key.json

Open danbryan opened this issue 1 year ago • 2 comments

It would be nice if horcrux would allow you to reconstruct priv_validator_key.json from shards.

horcrux create-priv_validator_key --chain-id blah  --threshold 2 --shards 3

danbryan avatar Feb 05 '24 03:02 danbryan

this would be a great first story to ramp up on horcrux

akc2267 avatar Feb 12 '24 20:02 akc2267

@akc2267 and @danbryan.

AFAIK it its impossible to recreate the priv_validator_key.json (the 'seed') as it was before creating shards.

If you look at https://github.com/strangelove-ventures/horcrux/blob/54beead80f63c7c8407674d112363cb752a13c61/signer/cosigner_key_shares.go#L27

What actually is splited is not the seed, its the expanded key. Since the expanded key involves hashing (sha512 in this case) its impossible to convert the splitted keys to the seed.

However it should be fairly trivial to recover the expanded key.

nitronit avatar Feb 16 '24 10:02 nitronit