Skip to content

Commit

Permalink
add a public key method
Browse files Browse the repository at this point in the history
  • Loading branch information
shrimalmadhur committed Dec 11, 2024
1 parent 577e26e commit c5ffb53
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
4 changes: 4 additions & 0 deletions signer/bls/cerberus/cerberus.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,7 @@ func (s Signer) GetOperatorId() (string, error) {
publicKey := pubkey.Deserialize(pkBytes)
return publicKey.GetOperatorID(), nil
}

func (s Signer) GetPublicKeyHex() string {
return s.pubKeyHex
}
5 changes: 5 additions & 0 deletions signer/bls/local/local.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package local

import (
"context"
"encoding/hex"

sdkBls "github.com/Layr-Labs/eigensdk-go/crypto/bls"
"github.com/Layr-Labs/eigensdk-go/signer/bls/types"
Expand Down Expand Up @@ -40,3 +41,7 @@ func (s Signer) Sign(ctx context.Context, msg []byte) ([]byte, error) {
func (s Signer) GetOperatorId() (string, error) {
return s.key.PubKey.GetOperatorID(), nil
}

func (s Signer) GetPublicKeyHex() string {
return hex.EncodeToString(s.key.PubKey.Serialize())
}
2 changes: 2 additions & 0 deletions signer/bls/signer.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ type Signer interface {
// GetOperatorId returns the operator ID of the signer.
// This is hash of the G1 public key of the signer
GetOperatorId() (string, error)

GetPublicKeyHex() string
}

// NewSigner creates a new Signer instance based on the provided configuration.
Expand Down

0 comments on commit c5ffb53

Please sign in to comment.