Description
Summary
The PubKey refactor that has been going on for 0.40 left some follow-up work to be cleaned up.
Problem Definition
#6886 (comment) was the fastest way to get Any PubKeys working for 0.40. However, there are some clean-ups tasks to be done.
Proposal
This are small bits that we discussed in issues, PRs, offline chats. Putting them here so we're able to track them.
-
Remove the old
message PublicKey
proto oneof (@blushi) Remove the old message PublicKey proto oneof #7390- The type shouldn't be used anywhere anymore, so it should be as simple as removing the proto file, and moving some files around.
-
Decouple the SDK from Tendermint's
PubKey
interface. Replacetmcrypto.PubKey
by our owncryptotypes.PubKey
(@blushi) Replace tmcrypto.PubKey by our own cryptotypes.PubKey #7419The scope of this item is to not use
tmcrypto.PubKey
throughout the codebase (except when we interface with TM methods), and use our owncryptotypes.PubKey
everywhere. Note:cryptotypes.PubKey
may or may not itself extendtmcrypto.PubKey
, see next point. -
Rethink our own
PubKey
interface. e.g.VerifySignature
right now doesn't make sense .
There is only one place where we don't agree with thetendermint.PubKey
interface: theVerifySingature
method. This is the Tendermint definition:VerifySignature(msg []byte, sig []byte) bool
The
msg []bytes
is serialized with a specific serialization method. Unfortunately, we don't have a single serialization in Cosmos-SDK. We relay on both legacy amino and the protobuf serialization. Hence we need to know what serialization was used when the signature was created, and only then we can serialize the message to validate the signature. -
Remove bech32 PubKey support #7447 Remove Bech32 encoding of PubKeys.
-
Should MarshalYAML return
[]byte
instead ofstring
? -
Shoud
PrivKeyLedgerSecp256k1
be a proto message? In order to remove theLedgerPrivKey
interface. Replace tmcrypto.PubKey by our own cryptotypes.PubKey #7419 (comment) -
wrapper.GetPubKeys silently ignore unpacked keys wrapper.GetPubKeys silently ignore unpacked keys #8129
cc @blushi Feel free to add more items that you can think of.
For Admin Use
- Not duplicate issue
- Appropriate labels applied
- Appropriate contributors tagged
- Contributor assigned/self-assigned