Documentation ¶
Index ¶
- Variables
- func GenerateSeed() ([]byte, error)
- type ExtendedKey
- func DeserializeExtendedKey(extKeyString string) (*ExtendedKey, error)
- func NewMaster(seed []byte, version [4]byte) (*ExtendedKey, error)
- func NewMasterWithPath(seed []byte, version [4]byte, pathString string) (*ExtendedKey, error)
- func NewPublicMasterWithPath(seed []byte, version [4]byte, pathString string) (*ExtendedKey, error)
- func (extKey *ExtendedKey) Child(i uint32) (*ExtendedKey, error)
- func (extKey *ExtendedKey) DeriveFromPath(pathString string) (*ExtendedKey, error)
- func (extKey *ExtendedKey) IsPrivate() bool
- func (extKey *ExtendedKey) PrivateKey() *secp256k1.ECDSAPrivateKey
- func (extKey *ExtendedKey) Public() (*ExtendedKey, error)
- func (extKey *ExtendedKey) PublicKey() (*secp256k1.ECDSAPublicKey, error)
- func (extKey *ExtendedKey) String() string
Constants ¶
This section is empty.
Variables ¶
var BitcoinMainnetPrivate = [4]byte{
0x04,
0x88,
0xad,
0xe4,
}
BitcoinMainnetPrivate is the version that is used for bitcoin mainnet bip32 private extended keys. Ecnodes to xprv in base58.
var BitcoinMainnetPublic = [4]byte{
0x04,
0x88,
0xb2,
0x1e,
}
BitcoinMainnetPublic is the version that is used for bitcoin mainnet bip32 public extended keys. Ecnodes to xpub in base58.
var DmgcoinDevnetPrivate = [4]byte{
0x02,
0xf9,
0xb0,
0x2e,
}
DmgcoinDevnetPrivate is the version that is used for Dmgcoin devnet bip32 public extended keys. Ecnodes to ddpr in base58.
var DmgcoinDevnetPublic = [4]byte{
0x02,
0xf9,
0xaf,
0xc5,
}
DmgcoinDevnetPublic is the version that is used for Dmgcoin devnet bip32 public extended keys. Ecnodes to ddpb in base58.
var DmgcoinMainnetPrivate = [4]byte{
0x02,
0xfc,
0x8e,
0x54,
}
DmgcoinMainnetPrivate is the version that is used for Dmgcoin mainnet bip32 private extended keys. Ecnodes to dmpr in base58.
var DmgcoinMainnetPublic = [4]byte{
0x02,
0xfc,
0x8d,
0xeb,
}
DmgcoinMainnetPublic is the version that is used for Dmgcoin mainnet bip32 public extended keys. Ecnodes to dmpb in base58.
var DmgcoinSimnetPrivate = [4]byte{
0x02,
0xfe,
0xb4,
0xf0,
}
DmgcoinSimnetPrivate is the version that is used for Dmgcoin simnet bip32 public extended keys. Ecnodes to dspr in base58.
var DmgcoinSimnetPublic = [4]byte{
0x02,
0xfe,
0xb4,
0x88,
}
DmgcoinSimnetPublic is the version that is used for Dmgcoin simnet bip32 public extended keys. Ecnodes to dspb in base58.
var DmgcoinTestnetPrivate = [4]byte{
0x64,
0x74,
0x70,
0x72,
}
DmgcoinTestnetPrivate is the version that is used for Dmgcoin testnet bip32 public extended keys. Ecnodes to dtpr in base58.
var DmgcoinTestnetPublic = [4]byte{
0x64,
0x74,
0x70,
0x62,
}
DmgcoinTestnetPublic is the version that is used for Dmgcoin testnet bip32 public extended keys. Ecnodes to dtpb in base58.
Functions ¶
func GenerateSeed ¶
GenerateSeed generates seed that can be used to initialize a master key.
Types ¶
type ExtendedKey ¶
type ExtendedKey struct { Version [4]byte Depth uint8 ParentFingerprint [4]byte ChildNumber uint32 ChainCode [32]byte // contains filtered or unexported fields }
ExtendedKey is a bip32 extended key
func DeserializeExtendedKey ¶
func DeserializeExtendedKey(extKeyString string) (*ExtendedKey, error)
DeserializeExtendedKey deserialized the given base58 string and returns an extended key
func NewMaster ¶
func NewMaster(seed []byte, version [4]byte) (*ExtendedKey, error)
NewMaster returns a new extended private key based on the given seed and version
func NewMasterWithPath ¶
func NewMasterWithPath(seed []byte, version [4]byte, pathString string) (*ExtendedKey, error)
NewMasterWithPath returns a new master key based on the given seed and version, with a derivation to the given path.
func NewPublicMasterWithPath ¶
func NewPublicMasterWithPath(seed []byte, version [4]byte, pathString string) (*ExtendedKey, error)
NewPublicMasterWithPath returns a new public master key based on the given seed and version, with a derivation to the given path.
func (*ExtendedKey) Child ¶
func (extKey *ExtendedKey) Child(i uint32) (*ExtendedKey, error)
Child return the i'th derived child of extKey.
func (*ExtendedKey) DeriveFromPath ¶
func (extKey *ExtendedKey) DeriveFromPath(pathString string) (*ExtendedKey, error)
DeriveFromPath returns the extended key derived from the given path
func (*ExtendedKey) IsPrivate ¶
func (extKey *ExtendedKey) IsPrivate() bool
IsPrivate returns whether the extended key is private
func (*ExtendedKey) PrivateKey ¶
func (extKey *ExtendedKey) PrivateKey() *secp256k1.ECDSAPrivateKey
PrivateKey returns the ECDSA private key associated with the extended key
func (*ExtendedKey) Public ¶
func (extKey *ExtendedKey) Public() (*ExtendedKey, error)
Public returns public version of the extended key
func (*ExtendedKey) PublicKey ¶
func (extKey *ExtendedKey) PublicKey() (*secp256k1.ECDSAPublicKey, error)
PublicKey returns the ECDSA public key associated with the extended key
func (*ExtendedKey) String ¶
func (extKey *ExtendedKey) String() string