gnolang / gno

Gno: An interpreted, stack-based Go virtual machine to build succinct and composable apps + Gno.land: a blockchain for timeless code and fair open-source
https://gno.land/
Other
841 stars 342 forks source link

Encoding error of `priv_validator_key.json` when sharding for Horcrux #2460

Open mazzy89 opened 2 days ago

mazzy89 commented 2 days ago

Description

In order to increase the security of validator keys, Horcrux comes into help and allow to shard a private validator key making sure blocks can be signed only a set number of shards keys are retrieved. This increase not only the security but also the fault-tolerance of a validator.

Horcrux uses the a package from ComeBFT to encode/decode private key while we use Amino. This makes the creation of the shards from the ED25519 private key failing with an error like:

Error: encoding/hex: invalid byte: U+0067 'g'

when the command is executed.

$ horcrux create-ed25519-shards --chain-id cosmoshub-4 --key-file /path/to/cosmoshub/priv_validator_key.json --threshold 2 --shards 3

How could we have Horcrux setup for a Gnolang chain?

cc @r3v4s @albttx @sw360cab @zivkovicmilos