Skip to content

Commit b39b409

Browse files
committed
Add simpler explanations where I got confused originally reading this.
Essentially I added the simple explanation for some things next to the more complex ones originally used. If I had these in there when I first came upon this document, I would have had a much easier time digesting it. Hopefully these changes help the next peson who reads it.
1 parent 58e7376 commit b39b409

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

bip-0032.mediawiki

+7-2
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,11 @@ Addition (+) of two coordinate pair is defined as application of the EC group op
5151
Concatenation (||) is the operation of appending one byte sequence onto another.
5252

5353
As standard conversion functions, we assume:
54-
* point(p): returns the coordinate pair resulting from EC point multiplication (repeated application of the EC group operation) of the secp256k1 base point with the integer p.
54+
* point(p): returns the coordinate pair resulting from EC point multiplication (repeated application of the EC group operation) of the secp256k1 base point with the integer p (similar to making public key).
5555
* ser<sub>32</sub>(i): serialize a 32-bit unsigned integer i as a 4-byte sequence, most significant byte first.
5656
* ser<sub>256</sub>(p): serializes the integer p as a 32-byte sequence, most significant byte first.
57-
* ser<sub>P</sub>(P): serializes the coordinate pair P = (x,y) as a byte sequence using SEC1's compressed form: (0x02 or 0x03) || ser<sub>256</sub>(x), where the header byte depends on the parity of the omitted y coordinate.
57+
* ser<sub>P</sub>(P): serializes the coordinate pair P = (x,y) (aka. the public key) as a byte sequence using [https://github.com/bitcoin-core/secp256k1/blob/master/include/secp256k1.h#L177 SEC1]'s compressed form: (0x02 or 0x03) || ser<sub>256</sub>(x), where the header byte depends on the parity of the omitted y coordinate.
58+
** [https://github.com/bitcoin-core/secp256k1 Libsecp256k1]'s pubkey_serialize and pubkey_parse functions implement this format.
5859
* parse<sub>256</sub>(p): interprets a 32-byte sequence as a 256-bit number, most significant byte first.
5960
6061

@@ -64,6 +65,8 @@ In what follows, we will define a function that derives a number of child keys f
6465

6566
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.
6667

68+
When deriving child keys, a 'hardened' child key can only be generated using a private key. This provides security advantages and prevents adversarial public key tracing. It is typically used to separate 'accounts' from one another.
69+
6770
Each extended key has 2<sup>31</sup> normal child keys, and 2<sup>31</sup> hardened child keys. Each of these child keys has an index. The normal child keys use indices 0 through 2<sup>31</sup>-1. The hardened child keys use indices 2<sup>31</sup> through 2<sup>32</sup>-1. To ease notation for hardened key indices, a number i<sub>H</sub> represents i+2<sup>31</sup>.
6871

6972
===Child key derivation (CKD) functions===
@@ -105,6 +108,8 @@ To compute the public child key of a parent private key:
105108
* CKDpub(N(k<sub>par</sub>, c<sub>par</sub>), i) (works only for non-hardened child keys).
106109
The fact that they are equivalent is what makes non-hardened keys useful (one can derive child public keys of a given parent key without knowing any private key), and also what distinguishes them from hardened keys. The reason for not always using non-hardened keys (which are more useful) is security; see further for more information.
107110

111+
The non-hardened result is typically used by a server to continually generate receive addresses without the ability to spend funds.
112+
108113
====Public parent key &rarr; private child key====
109114

110115
This is not possible.

0 commit comments

Comments
 (0)