mirror of
https://github.com/muun/recovery.git
synced 2025-11-11 22:40:16 -05:00
Update project structure and build process
This commit is contained in:
20
libwallet/publickey.go
Executable file
20
libwallet/publickey.go
Executable file
@@ -0,0 +1,20 @@
|
||||
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
|
||||
}
|
||||
Reference in New Issue
Block a user