Documentation
¶
Index ¶
- Constants
- Variables
- func ByronLegacyFromSeed(entropy []byte) (crypto.XPrvKey, error)
- func CborIndefiniteLenArrayEncoder(path []uint32) ([]byte, error)
- func ChaCha20Poly1305EncodePath(hdPath []byte, path []uint32) ([]byte, error)
- func HashRepeatedly(key []byte, itrNum int) ([]byte, []byte)
- func HdPathKey(rootXpub []byte) []byte
- func TweakMasterKeyBits(key []byte) []byte
- type ByronAddress
- func (b *ByronAddress) Bech32() string
- func (b *ByronAddress) Bytes() (bytes []byte)
- func (a *ByronAddress) MarshalCBOR() ([]byte, error)
- func (b *ByronAddress) NetworkInfo() byte
- func (b *ByronAddress) Prefix() string
- func (b *ByronAddress) String() (str string)
- func (a *ByronAddress) UnmarshalCBOR(data []byte) error
- type ByronAddressAttributes
Constants ¶
View Source
const ( XPubSize = 64 ByronPubKeyTag uint64 = 0 ByronTag uint64 = 24 Hash28Size = 28 )
View Source
const ( // HMAC message format HMAC_MESSAGE_FORMAT = "Root Seed Chain %d" TWEAK_BIT1 uint8 = 0x07 TWEAK_BIT2 uint8 = 0x80 INDEF_LEN_ARRAY_START byte = 0x9F INDEF_LEN_ARRAY_END byte = 0xFF HD_PATH_KEY_PBKDF2_SALT string = "address-hashing" //PBKDF2 rounds used for deriving the HD path key HD_PATH_KEY_PBKDF2_ROUNDS int = 500 //PBKDF2 output byte length used for deriving the HD path key HD_PATH_KEY_PBKDF2_OUT_BYTE_LEN int = 32 )
Variables ¶
View Source
var ( ErrInvalidByronAddress = errors.New("invalid byron address") ErrInvalidByronChecksum = errors.New("invalid byron checksum") )
View Source
var ( // ChaCha20-Poly1305 associated data for HD path decryption/encryption CHACHA20_POLY1305_ASSOC_DATA []byte = []byte("") // ChaCha20-Poly1305 nonce for HD path decryption/encryption CHACHA20_POLY1305_NONCE []byte = []byte("serokellfore") )
Functions ¶
func TweakMasterKeyBits ¶
Types ¶
type ByronAddress ¶
type ByronAddress struct {
Hash []byte
Attributes ByronAddressAttributes
Tag uint64
}
func NewSimpleLegacyAddress ¶
func NewSimpleLegacyAddress(xpub []byte, hdPath []byte) (*ByronAddress, error)
func (*ByronAddress) Bech32 ¶
func (b *ByronAddress) Bech32() string
func (*ByronAddress) Bytes ¶
func (b *ByronAddress) Bytes() (bytes []byte)
Bytes returns byte slice represantation of the Address.
func (*ByronAddress) MarshalCBOR ¶
func (a *ByronAddress) MarshalCBOR() ([]byte, error)
func (*ByronAddress) NetworkInfo ¶
func (b *ByronAddress) NetworkInfo() byte
NetworkInfo returns NetworkInfo{ProtocolMagigic and NetworkId}.
func (*ByronAddress) Prefix ¶
func (b *ByronAddress) Prefix() string
Pref returns the string prefix for the base address. "" for byron address since it has no prefix.
func (*ByronAddress) String ¶
func (b *ByronAddress) String() (str string)
String returns base58 encoded byron address.
func (*ByronAddress) UnmarshalCBOR ¶
func (a *ByronAddress) UnmarshalCBOR(data []byte) error
type ByronAddressAttributes ¶
type ByronAddressAttributes struct {
Payload []byte `cbor:"1,keyasint,omitempty"`
Network *uint32 `cbor:"2,keyasint,omitempty"`
}
func (ByronAddressAttributes) MarshalCBOR ¶
func (a ByronAddressAttributes) MarshalCBOR() ([]byte, error)
func (*ByronAddressAttributes) UnmarshalCBOR ¶
func (a *ByronAddressAttributes) UnmarshalCBOR(data []byte) error
Click to show internal directories.
Click to hide internal directories.