Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeNpub ¶
DecodeNpub decodes a Bech32 encoded npub to its corresponding pubkey
func DecodeNsec ¶ added in v0.4.12
DecodeNsec decodes a Bech32 encoded nsec to its corresponding hex private key
func DerivePublicKey ¶
DerivePublicKey derives a public key from a private key
func EncodePrivateKey ¶
EncodePrivateKey encodes a hex private key into a Bech32 nsec
func EncodePubkey ¶
EncodePubkey encodes a hex public key into a Bech32 npub
Types ¶
type KeyPair ¶
type KeyPair struct {
PrivateKey string `json:"private_key"` // hex format
PublicKey string `json:"public_key"` // hex format
Nsec string `json:"nsec"` // bech32 format
Npub string `json:"npub"` // bech32 format
}
KeyPair represents a Nostr key pair
func GenerateKeyPair ¶
GenerateKeyPair generates a new random Nostr key pair
Click to show internal directories.
Click to hide internal directories.