-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add bls key types into keyring management tool (#73)
* keyring: add eth bls key types * fix: keys/codec_test
- Loading branch information
Showing
16 changed files
with
1,032 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package bls | ||
|
||
import ( | ||
"github.com/cosmos/cosmos-sdk/codec" | ||
codectypes "github.com/cosmos/cosmos-sdk/codec/types" | ||
cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" | ||
) | ||
|
||
const ( | ||
// KeyType is the string constant for the BLS algorithm | ||
KeyType = "eth_bls" | ||
) | ||
|
||
// Amino encoding names | ||
const ( | ||
// PrivKeyName defines the amino encoding name for the EthBLS private key | ||
PrivKeyName = "ethereum/PrivKeyEthBLS" | ||
// PubKeyName defines the amino encoding name for the EthBLS public key | ||
PubKeyName = "ethereum/PubKeyEthBLS" | ||
) | ||
|
||
// ---------------------------------------------------------------------------- | ||
// secp256k1 Public Key | ||
|
||
var ( | ||
_ cryptotypes.PubKey = &PubKey{} | ||
_ codec.AminoMarshaler = &PubKey{} | ||
) | ||
|
||
// RegisterInterfaces adds BLS PubKey to pubkey registry | ||
func RegisterInterfaces(registry codectypes.InterfaceRegistry) { | ||
registry.RegisterImplementations((*cryptotypes.PubKey)(nil), &PubKey{}) | ||
} |
Oops, something went wrong.