Skip to content

Commit

Permalink
keystore: Fix aptoskey public key encoding
Browse files Browse the repository at this point in the history
  • Loading branch information
archseer committed Jul 17, 2024
1 parent 75cab0f commit 116757b
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions core/services/keystore/keys/aptoskey/key.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ import (
crypto_rand "crypto/rand"
"fmt"
"io"

"github.com/mr-tron/base58"
)

// Raw represents the Aptos private key
Expand Down Expand Up @@ -77,9 +75,10 @@ func (key Key) GetPublic() ed25519.PublicKey {
return key.pubKey
}

// PublicKeyStr return base58 encoded public key
// PublicKeyStr returns hex encoded public key
// https://github.com/aptos-foundation/AIPs/blob/main/aips/aip-40.md#long
func (key Key) PublicKeyStr() string {
return base58.Encode(key.pubKey)
return fmt.Sprintf("0x%064x", key.pubKey)
}

// Raw returns the seed from private key
Expand Down

0 comments on commit 116757b

Please sign in to comment.