Given a parent extended key and an index idx
, it is possible to compute the corresponding
child extended key.
Given a parent extended key and an index idx
, it is possible to compute the corresponding
child extended key. The algorithm to do so depends on whether the child is a hardened key
or not (or, equivalently, whether idx ≥ 2^31
), and whether we're talking about private or
public keys.
implementations in derived classes
Description from https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki :
We extend both private and public keys first with an extra 256 bits of entropy. This extension, called the chain code, is identical for corresponding private and public keys and consists of 32 bytes. We represent an extended private key as (k, c), with k the normal private key, and c the chain code. An extended public key is represented as (K, c), with K = point(k) and c the chain code.
Each extended key has 231 normal child keys, and 231 hardened child keys. Each of these child keys has an index. The normal child keys use indices 0 through 231-1. The hardened child keys use indices 231 through
2^32-1
.