Documentation
¶
Index ¶
- Constants
- func Base58CheckDecode(s string) (ver uint8, b []byte, err error)
- func Base58CheckEncode(ver uint8, b []byte) (s string)
- func Base58Decode(s string) (b []byte, err error)
- func Base58Encode(b []byte) (s string)
- func CheckWIF(wif string) (valid bool, err error)
- func IntToHex(num int64) []byte
- func ReverseBytes(data []byte)
- type PrivateKey
- func (key *PrivateKey) FromBytes(b []byte) (err error)
- func (key *PrivateKey) FromWIFC(wif string) (err error)
- func (key *PrivateKey) Sign(data []byte) (r, s *big.Int, err error)
- func (key *PrivateKey) ToAddress() (address string)
- func (key *PrivateKey) ToPrivateBytes() []byte
- func (key *PrivateKey) ToPublicBytes() (b []byte)
- func (key *PrivateKey) ToWIFC() string
- type PublicKey
Constants ¶
const BASE58TABLE = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"
BASE58TABLE -
Variables ¶
This section is empty.
Functions ¶
func Base58CheckDecode ¶
Base58CheckDecode - decodes base-58 check encoded string s into a version ver and byte slice b.
func Base58CheckEncode ¶
Base58CheckEncode - encodes version ver and byte slice b into a base-58 check encoded string.
func Base58Decode ¶
Base58Decode - decodes a base-58 encoded string into a byte slice b.
func Base58Encode ¶
Base58Encode - encodes a byte slice b into a base-58 encoded string.
Types ¶
type PrivateKey ¶
type PrivateKey struct {
// contains filtered or unexported fields
}
PrivateKey -
func (*PrivateKey) FromBytes ¶
func (key *PrivateKey) FromBytes(b []byte) (err error)
FromBytes - converts a 32-byte byte slice to a Bitcoin private key and derives the corresponding Bitcoin public key.
func (*PrivateKey) FromWIFC ¶
func (key *PrivateKey) FromWIFC(wif string) (err error)
FromWIFC converts a Wallet Import Format string to a Bitcoin private key and derives the corresponding Bitcoin public key.
func (*PrivateKey) Sign ¶
func (key *PrivateKey) Sign(data []byte) (r, s *big.Int, err error)
Sign -
func (*PrivateKey) ToAddress ¶
func (key *PrivateKey) ToAddress() (address string)
ToAddress - converts a Bitcoin public key to a compressed Bitcoin address string.
func (*PrivateKey) ToPublicBytes ¶
func (key *PrivateKey) ToPublicBytes() (b []byte)
ToPublicBytes - converts a Bitcoin public key to a 33-byte byte slice with point compression.
type PublicKey ¶
type PublicKey struct {
// contains filtered or unexported fields
}
PublicKey -
func (*PublicKey) FromBytes ¶
FromBytes - converts a byte slice (either with or without point compression) to a Bitcoin public key.
func (*PublicKey) ToAddress ¶
ToAddress - converts a Bitcoin public key to a compressed Bitcoin address string.