Documentation ¶
Index ¶
- func DeriveMaster(seed []byte) (*curve.Secp256k1Scalar, []byte, error)
- func DeriveScalar(public *curve.Secp256k1Point, chaining []byte, i uint32) (*curve.Secp256k1Scalar, []byte, error)
- func DeriveScalarForPath(public *curve.Secp256k1Point, chaining []byte, path Path) (*curve.Secp256k1Scalar, []byte, error)
- type Path
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeriveMaster ¶
func DeriveMaster(seed []byte) (*curve.Secp256k1Scalar, []byte, error)
DeriveMaster uses a secret seed to derive a scalar and chaining value.
This scalar serves as the master secret key. Together with the chaining value, it forms the extended master secret key.
If an error is returned, this means that this seed is not useable, and a new seed should be generated instead.
func DeriveScalar ¶
func DeriveScalar(public *curve.Secp256k1Point, chaining []byte, i uint32) (*curve.Secp256k1Scalar, []byte, error)
DeriveScalar uses a public point, chaining value, and index, to derive a scalar and chaining value.
This scalar should be added to the secret key.
If an error is returned, this means that this index will not be useable, and another index should be used instead.
This function will panic if an index for a hardened key is used.
See: https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki
func DeriveScalarForPath ¶
func DeriveScalarForPath(public *curve.Secp256k1Point, chaining []byte, path Path) (*curve.Secp256k1Scalar, []byte, error)
DeriveScalarForPath uses a public point, chaining value, and path to derive a scalar and chaining value.
This scalar should be added to the secret key underlying the public point.
If an error is returned, this means that an index in this path will not be useable, and another path should be used instead.
This function will panic if an index for a hardened key is used.