Documentation ¶
Index ¶
- Variables
- func DecodeWIF(wif string) (*ecdsa.PrivateKey, error)
- func EncodeWIF(privateKey *ecdsa.PrivateKey) (string, error)
- func FromWIF(wif string, curve elliptic.Curve) (*ecdsa.PrivateKey, error)
- func PrivateToAddress(privateKey *ecdsa.PrivateKey) (string, error)
- func PrivateToScriptHash(privateKey *ecdsa.PrivateKey) ([]byte, error)
- func ScriptHashToAddress(scriptHash []byte) string
- func WriteLightScryptKeyStore(key *Key, password string) ([]byte, error)
- func WriteScryptKeyStore(key *Key, password string) ([]byte, error)
- type Key
- type ScriptHash
Constants ¶
This section is empty.
Variables ¶
View Source
var ( StandardScryptN = 1 << 18 StandardScryptP = 1 LightScryptN = 1 << 12 LightScryptP = 6 )
const variables
Functions ¶
func FromWIF ¶
FromWIF converts a Wallet Import Format string to a Bitcoin private key and derives the corresponding Bitcoin public key.
func PrivateToAddress ¶
func PrivateToAddress(privateKey *ecdsa.PrivateKey) (string, error)
PrivateToAddress .
func PrivateToScriptHash ¶
func PrivateToScriptHash(privateKey *ecdsa.PrivateKey) ([]byte, error)
PrivateToScriptHash .
func ScriptHashToAddress ¶
ScriptHashToAddress script hash to address
func WriteLightScryptKeyStore ¶
WriteLightScryptKeyStore write keystore with Scrypt format
Types ¶
type Key ¶
type Key struct { ID uuid.UUID // Key ID Address string // address PrivateKey *ecdsa.PrivateKey // btc private key }
Key wallet wallet key
func KeyFromPrivateKey ¶
KeyFromPrivateKey wallet key from private key bytes
func ReadKeyStore ¶
ReadKeyStore read key from keystore
type ScriptHash ¶
type ScriptHash []byte
ScriptHash .
func AddressToScriptHash ¶
func AddressToScriptHash(address string) (ScriptHash, error)
AddressToScriptHash convert address to script hash
func (ScriptHash) String ¶
func (hash ScriptHash) String() string
Click to show internal directories.
Click to hide internal directories.