-
Notifications
You must be signed in to change notification settings - Fork 28
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
Investigate Ed25519 Key Format Compatibility between Tendermint and libsodium #2
Comments
Tendermint and libsodium use the same Ed25519 key-pair format. Both are RFC 8032 compliant.
The function Thus, by using SHA-256 applied secret as libsodium seed, var secret [SEEDBYTES]byte
tsk := ed25519.GenPrivKeyFromSecret(secret[:])
tpk, _ := tsk.PubKey().(ed25519.PubKeyEd25519)
var seed [SEEDBYTES]byte
hashedSecret := sha256.Sum256(secret[:])
copy(seed[:], hashedSecret[:])
var spk, ssk = KeyPairFromSeed(seed) I've seen that Tendermint and libsodium generate exactly identical key-pairs.
In conclusion, the Ed25519 key-pair of Tendermint and libsodium is binary compatible. |
Since the VRF API added in #1 is the same specification as libsodium, we need to change the private and public keys on them to |
Tendermint and libsodium generate different keys for 32-bytes fixed zeros seed.
Ed25519 is specified in RFC 8032, and its parameters are considered to be compatible. We need to convert them if we use the ED25519 key-pair of Tendermint. If it's not possible, another key must be used for the leader election.
The text was updated successfully, but these errors were encountered: