mirror of
https://github.com/muun/recovery.git
synced 2025-02-23 03:22:31 -05:00
21 lines
373 B
Go
21 lines
373 B
Go
package libwallet
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/btcsuite/btcd/btcec"
|
|
)
|
|
|
|
type PublicKey struct {
|
|
key *btcec.PublicKey
|
|
}
|
|
|
|
func NewPublicKeyFromBytes(bytes []byte) (*PublicKey, error) {
|
|
key, err := btcec.ParsePubKey(bytes, btcec.S256())
|
|
if err != nil {
|
|
return nil, fmt.Errorf("NewPublicKeyFromBytes: failed to parse pub key: %w", err)
|
|
}
|
|
|
|
return &PublicKey{key}, nil
|
|
}
|