Documentation
¶
Index ¶
- Constants
- Variables
- func EntropyFromMnemonic(mnemonic string) ([]byte, error)
- func GetWordList() []string
- func IsMnemonicValid(mnemonic string) bool
- func MnemonicToByteArray(mnemonic string, raw ...bool) ([]byte, error)
- func NewEntropy(bitSize int) ([]byte, error)
- func NewMnemonic(entropy []byte) (string, error)
- func NewSeed(mnemonic string, password string) []byte
- func NewSeedFromMnemonicSr25519(mnemonic string, password string) ([64]byte, error)
- func NewSeedWithErrorChecking(mnemonic string, password string) ([]byte, error)
- func SetWordList(list []string)
- type Key
- func B58Deserialize(data string) (*Key, error)
- func Deserialize(data []byte) (*Key, error)
- func NewMasterKey(seed []byte, version []byte) (*Key, error)
- func NewMasterKeyED25519(seed []byte) (*Key, error)
- func SeedToKeyForECDSA(seed []byte, path string) (*Key, error)
- func SeedToKeyForED25519(seed []byte, path string) (*Key, error)
- func (key *Key) B58Serialize() string
- func (key *Key) CompressedPublicKey() *Key
- func (key *Key) NewChildKey(childIdx uint32) (*Key, error)
- func (key *Key) NewChildKeyED25519(childIdx uint32) (*Key, error)
- func (key *Key) Serialize() ([]byte, error)
- func (key *Key) String() string
- func (key *Key) UncompressedPublicKey() *Key
Constants ¶
View Source
const ( FirstHardenedChild = uint32(0x80000000) PublicKeyCompressedLength = 33 )
Variables ¶
View Source
var (
PrivateWalletVersionDefault, _ = hex.DecodeString("0488ADE4")
PrivateWalletVersionForKaspa, _ = hex.DecodeString("038F2EF4")
PublicWalletVersionDefault, _ = hex.DecodeString("0488B21E")
ErrSerializedKeyWrongSize = errors.New("Serialized keys should by exactly 82 bytes")
ErrHardnedChildPublicKey = errors.New("Can't create hardened child for public key")
ErrInvalidChecksum = errors.New("Checksum doesn't match")
ErrInvalidPrivateKey = errors.New("Invalid private key")
ErrInvalidPublicKey = errors.New("Invalid public key")
)
View Source
var ( ErrInvalidMnemonic = errors.New("Invalid mnenomic") ErrEntropyLengthInvalid = errors.New("Entropy length must be [128, 256] and a multiple of 32") ErrValidatedSeedLengthMismatch = errors.New("Seed length does not match validated seed length") ErrChecksumIncorrect = errors.New("Checksum incorrect") )
View Source
var (
BitcoinBase58Encoding = basen.NewEncoding("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")
)
View Source
var English = strings.Split(strings.TrimSpace(english), "\n")
View Source
var ReverseWordMap = map[string]int{}
Functions ¶
func EntropyFromMnemonic ¶
func GetWordList ¶
func GetWordList() []string
func IsMnemonicValid ¶
func NewEntropy ¶
func NewMnemonic ¶
func SetWordList ¶
func SetWordList(list []string)
Types ¶
type Key ¶
type Key struct {
Key []byte
Version []byte
ChildNumber []byte
FingerPrint []byte
ChainCode []byte
Depth [1]byte
IsPrivate bool
}
func B58Deserialize ¶
func Deserialize ¶
func NewMasterKeyED25519 ¶
func (*Key) B58Serialize ¶
func (*Key) CompressedPublicKey ¶
func (*Key) UncompressedPublicKey ¶
Click to show internal directories.
Click to hide internal directories.