You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* BIP-85:
* Add new maintainer (author unreachable)
* Swap chain code and private key bytes in application 32' for consistentcy with BIP-32 (major change)
* Correct derived entropy for application 128169' test vector (major change)
* Clarify big endian serialization
* Add the Portuguese language (9') to application 39'
* Add dice application 89101'
* Clarify Testnet support for XPRV application 32'
* Minor grammar, format, clarity improvements
It is not possible to maintain one single (mnemonic) seed backup for all keychains used across various wallets because there are a variety of incompatible standards. Sharing of seeds across multiple wallets is not desirable for security reasons. Physical storage of multiple seeds is difficult depending on the security and redundancy required.
23
24
@@ -33,6 +34,9 @@ The terminology related to keychains used in the wild varies widely, for example
33
34
# '''BIP39 mnemonic''' is the mnemonic phrase that is calculated from the entropy used before hashing of the mnemonic in BIP39.
34
35
# '''BIP39 seed''' is the result of hashing the BIP39 mnemonic seed.
35
36
37
+
When in doubt, assume '''big endian''' byte serialization, such that the leftmost
38
+
byte is the most significant.
39
+
36
40
==Motivation==
37
41
38
42
Most wallets implement BIP32 which defines how a BIP32 root key can be used to derive keychains. As a consequence, a backup of just the BIP32 root key is sufficient to include all keys derived from it. BIP32 does not have a human friendly serialization of the BIP32 root key (or BIP32 extended keys in general) which makes paper backups or manually restoring the key more error-prone. BIP39 was designed to solve this problem but rather than serialize the BIP32 root key, it takes some entropy, encoded to a "seed mnemonic", which is then hashed to derive the BIP39 seed which can be turned into the BIP32 root key. Saving the BIP39 mnemonic is enough to reconstruct the entire BIP32 keychain, but a BIP32 root key cannot be reversed back to the BIP39 mnemonic.
@@ -51,6 +55,9 @@ For each application that requires its own wallet, a unique private key is deriv
51
55
52
56
The HMAC-SHA512 function is specified in [http://tools.ietf.org/html/rfc4231 RFC 4231].
53
57
58
+
Application codes may be arbitrary but should be semantic, such as a BIP number,
59
+
ASCII character code sequence, or similar.
60
+
54
61
===Test vectors===
55
62
56
63
====Test case 1====
@@ -78,7 +85,7 @@ BIP85-DRNG-SHAKE256 is a deterministic random number generator for cryptographic
78
85
RSA key generation is an example of a function that requires orders of magnitude more than 64 bytes of random input. Further, it is not possible to precalculate the amount of random input required until the function has completed.
The Application number defines how entropy will be used post processing. Some basic examples follow:
102
110
103
-
Derivation path uses the format <code>m/83696968'/{app_no}'/{index}'</code> where ''{app_no}'' is the path for the application, and ''{index}'' is the index.
111
+
Derivation path uses the format <code>m/83696968'/{app}'/{index}'</code> where ''{app}'' is the '''path''' for the application, and ''{index}'' is the index.
104
112
105
113
===BIP39===
106
114
Application number: 39'
@@ -143,6 +151,10 @@ Language Table
143
151
|-
144
152
| Czech
145
153
| 8'
154
+
|-
155
+
| Portuguese
156
+
| 9'
157
+
|-
146
158
|}
147
159
148
160
Words Table
@@ -207,7 +219,12 @@ OUTPUT:
207
219
===HD-Seed WIF===
208
220
Application number: 2'
209
221
210
-
Uses 256 bits[1] of entropy as the secret exponent to derive a private key and encode as a compressed WIF which will be used as the hdseed for Bitcoin Core wallets.
222
+
Uses the most significant 32 bytes<refname="curve-order">
223
+
There is a very small chance that you'll make an invalid
224
+
key that is zero or bigger than the order of the curve. If this occurs, software
225
+
should hard fail (forcing users to iterate to the next index).</ref>
226
+
of entropy as the secret exponent to derive a private key and encode as a compressed
227
+
WIF which will be used as the hdseed for Bitcoin Core wallets.
211
228
212
229
Path format is <code>m/83696968'/2'/{index}'</code>
213
230
@@ -222,17 +239,26 @@ OUTPUT
222
239
===XPRV===
223
240
Application number: 32'
224
241
225
-
Taking 64 bytes of the HMAC digest, the first 32 bytes are the chain code, and second 32 bytes[1] are the private key for BIP32 XPRV value. Child number, depth, and parent fingerprint are forced to zero.
242
+
Consistent with BIP32, use the first (leftmost) 32 bytes of the derived entropy as the
243
+
private key<refname="curve-order" />. Prepend an empty byte (<code>0x00</code>)
244
+
per BIP32 on master key serialization. Use the last (rightmost) 32 bytes as the chain code.
245
+
246
+
Child number, depth, and parent fingerprint are forced to zero, as with any root
247
+
private key.
248
+
226
249
227
250
Path format is <code>m/83696968'/32'/{index}'</code>
228
251
252
+
253
+
Applications may support Testnet by emitting TPRV keys if and only if the input root key is a Testnet key.
@@ -374,9 +434,21 @@ Many thanks to Peter Gray and Christopher Allen for their input, and to Peter fo
374
434
375
435
BIP32, BIP39
376
436
437
+
==Change Log==
438
+
439
+
* 1.0 (2020-07)
440
+
* 2.0.0 (2024-09-22)
441
+
* Swap chain code and private key bytes in application 32' for consistentcy with BIP-32 (major change)
442
+
* Correct derived entropy for application 128169' test vector (major change)
443
+
* Clarify big endian serialization
444
+
* Add the Portuguese language (9') to application 39'
445
+
* Add dice application 89101'
446
+
* Clarify Testnet support for XPRV application 32'
447
+
* Minor grammar, format, clarity improvements
448
+
377
449
==Footnotes==
378
450
379
-
[1] There is a very small chance that you'll make an invalid key that is zero or bigger than the order of the curve. If this occurs, software should hard fail (forcing users to iterate to the next index).
451
+
<references />
380
452
381
453
From BIP32:
382
454
In case parse<sub>256</sub>(I<sub>L</sub>) is 0 or ≥ n, the resulting key is invalid, and one should proceed with the next value for i. (Note: this has probability lower than 1 in 2<sup>127</sup>.)
0 commit comments