Documentation ¶
Index ¶
- Constants
- func ParseCompact(b []byte) point
- func ParseUncompressed(d []byte) (*big.Int, *big.Int, error)
- func RIPEMD160Hash(data []byte) []byte
- func SerializeCompact(p point) []byte
- func SerializeUncompressed(p point) []byte
- type Key
- func (k *Key) Chain(chain string) (*Key, error)
- func (k *Key) Child(i uint32) (*Key, error)
- func (k *Key) ChildOrDie(i uint32) *Key
- func (k *Key) ExportWIF() (string, error)
- func (k *Key) Fingerprint() []byte
- func (k *Key) IsPublic() bool
- func (k Key) Public() *Key
- func (k *Key) PublicKey() []byte
- func (k *Key) PublicKeyHash() []byte
- func (k *Key) PublicKeyHashEncode() string
- func (k *Key) PublicKeyHashUncompressed() string
- func (k *Key) Serialize() []byte
- func (k *Key) SerializeEncode() string
- func (k *Key) Sign(data []byte) (*big.Int, *big.Int)
- func (k Key) String() string
Constants ¶
const ( BitcoinExtendedPublicKeyVersion = 0x0488b21e BitcoinExtendedPrivateKeyVersion = 0x0488ade4 BitcoinTestnetExtendedPublicKeyVersion = 0x043587cf BitcoinTestnetExtendedPrivateKeyVersion = 0x04358394 )
Variables ¶
This section is empty.
Functions ¶
func ParseCompact ¶
func ParseCompact(b []byte) point
func ParseUncompressed ¶
ParseUncompressed parses a 65 bytes uncompressed public address into a (X,Y) point on the curve.
func RIPEMD160Hash ¶
func SerializeCompact ¶
func SerializeCompact(p point) []byte
func SerializeUncompressed ¶
func SerializeUncompressed(p point) []byte
SerializeUncompressed serializes a point on the curve into a 65 byte long byte array.
Types ¶
type Key ¶
type Key struct {
// contains filtered or unexported fields
}
func NewMasterKey ¶
func NewMasterKeyRawData ¶
func ParseEncoded ¶
ParseEncoded parses a base58 encoded HD Key.
func (*Key) Chain ¶
Chain performs all the child derivations necessary to end up with the key described with BIP32 notations, eg. m/44'/0'/1'/0/3.
func (*Key) Child ¶
Child returns the child key with index i. Private keys will return private childs, public keys will return public childs.
func (*Key) ChildOrDie ¶
func (*Key) Fingerprint ¶
func (Key) Public ¶
Public returns the public version of the Key that can't be used to create signatures.
func (*Key) PublicKey ¶
PublicKey returns the compressed serialized public key corresponding to Key.
func (*Key) PublicKeyHash ¶
func (*Key) PublicKeyHashEncode ¶
func (*Key) PublicKeyHashUncompressed ¶
func (*Key) SerializeEncode ¶
SerializeEncode serializes and base58 encodes Key.