Skip to content

Commit 4423f56

Browse files
committed
remove rebase artifacts
1 parent 23a47fa commit 4423f56

File tree

1 file changed

+0
-264
lines changed

1 file changed

+0
-264
lines changed

bip-0085.mediawiki

Lines changed: 0 additions & 264 deletions
Original file line numberDiff line numberDiff line change
@@ -225,12 +225,9 @@ OUTPUT:
225225
* DERIVED ENTROPY=ae131e2312cdc61331542efe0d1077bac5ea803adf24b313a4f0e48e9c51f37f
226226
* DERIVED BIP39 MNEMONIC=puppy ocean match cereal symbol another shed magic wrap hammer bulb intact gadget divorce twin tonight reason outdoor destroy simple truth cigar social volcano
227227
228-
229228
===BIP93 (codex32)===
230229
Application Number: 93'
231230

232-
<<<<<<< HEAD
233-
<<<<<<< HEAD
234231
The derivation path format is: <code>m/83696968'/93'/{hrp}'/{threshold}'/{n}'/{byte_length}'/{id0}'/{id1}'/{id2}'/{id3}'/{index}'</code>
235232

236233
Use this application to generate fresh codex32 strings (as defined in BIP-0093) for Shamir's Secret Sharing backups of BIP-0032 HD master seeds. Each codex32 string encodes a share or secret with a human-readable prefix (hrp), and a data part consisting of a threshold, identifier, share index, payload, and checksum.
@@ -243,20 +240,6 @@ Repeat until all required data characters are validly chosen.
243240

244241
Example: a codex32 secret with <code>hrp = "ms"</code> (first index), <code>threshold = "0"</code>, <code>n = 1</code>, <code>byte_length = 16</code>, identifier <code>"c0??"</code> would have the path <code>m/83696968'/93'/0'/0'/1'/16'/24'/15'/32'/32'/0'</code>, the next secret would be <code>m/83696968'/93'/0'/0'/1'/16'/24'/15'/32'/32'/1'</code> (identifier <code>"c0zc"</code>) etc.
245242

246-
=======
247-
The derivation path format is: <code>m/83696968'/93'/<hrp>'/<threshold>'/<n>'/<byte_length>'/<id0>'/<id1>'/<id2>'/<id3>'</code>
248-
=======
249-
The derivation path format is: <code>m/83696968'/93'/{hrp}'/{threshold}'/{n}'/{byte_length}'/{id0}'/{id1}'/{id2}'/{id3}'</code>
250-
>>>>>>> 8a14663 (Finish polishing of bip-0085.mediawiki)
251-
252-
Use this application to generate fresh codex32 strings (as defined in BIP-0093) for Shamir's Secret Sharing backups of BIP-0032 HD master seeds. Each codex32 string encodes a share or secret with a human-readable prefix (`hrp`), and a data part consisting of a threshold, identifier, share index, payload, and checksum.
253-
254-
Create a BIP85 DRNG whose seed is the derived entropy. Read 1 byte from the DRNG and trim to the 5 most significant bits to obtain an integer (0–31), representing a bech32 character. Repeat until all required data characters are validly chosen.
255-
256-
Example: a codex32 secret with <code>hrp = "ms"</code> (first index), <code>threshold = "0"</code>, <code>n = 1</code>, <code>byte_length = 16</code>, identifier <code>"c00l"</code> would have the path <code>m/83696968'/93'/0'/0'/1'/16'/24'/15'/15'/31'</code>, the next secret would be <code>m/83696968'/93'/0'/0'/1'/16'/24'/15'/15'/32'</code> (identifier <code>"c00?"</code>) etc.
257-
258-
259-
>>>>>>> 8b99481 (Update bip-0085.mediawiki)
260243
Human-readable Prefix Table
261244

262245
{|
@@ -274,11 +257,7 @@ Human-readable Prefix Table
274257
Threshold Table
275258

276259
{|
277-
<<<<<<< HEAD
278260
!Threshold
279-
=======
280-
!threshold
281-
>>>>>>> 8b99481 (Update bip-0085.mediawiki)
282261
!Code
283262
|-
284263
| "0"
@@ -313,8 +292,6 @@ Threshold Table
313292
Share Count Table
314293

315294
{|
316-
<<<<<<< HEAD
317-
<<<<<<< HEAD
318295
!Threshold code
319296
!Number of Shares
320297
!Code
@@ -326,27 +303,12 @@ Share Count Table
326303
| not 0'
327304
| n (from 1 to 31)
328305
| n'
329-
=======
330-
! Number of Shares to Generate
331-
=======
332-
! Number of Shares
333-
>>>>>>> 8a14663 (Finish polishing of bip-0085.mediawiki)
334-
!Code
335-
|-
336-
| n (from 1 to 31)
337-
| n'
338-
|-
339-
>>>>>>> 8b99481 (Update bip-0085.mediawiki)
340306
|}
341-
Notes: If <code>threshold == "0"</code>, <code>n</code> must be ''1''.
342-
343307

344308
Bytes Length Table
345309

346310
{|
347311
! Bytes
348-
<<<<<<< HEAD
349-
<<<<<<< HEAD
350312
! Data Length (Characters)
351313
!Code
352314
|-
@@ -418,7 +380,6 @@ Otherwise, for each initial share needed:
418380
* Recover secret at "s", if needed, for the default identifier.
419381
3. Prepend the <code>threshold</code> and identifier.
420382

421-
<<<<<<< HEAD
422383
4. Compute and append the codex32 checksum.
423384

424385
5. Translate the data part to characters using the table from BIP-0173 and prepend <code>hrp</code>1.
@@ -474,150 +435,6 @@ Examples:
474435
Generate 2 codex32 shares, 16-byte existing master seed, threshold 3, identifier <code>"g0??"</code>.
475436

476437
Note: The share indices are alphabetized. The default identifier is the fingerprint of payload bytes of "s" had the <code>threshold</code been <code>n</code> (2 in this example).
477-
=======
478-
* Fresh Seeds (n >= t)
479-
* Generate ''t'' shares with random payloads using the BIP85 DRNG:
480-
* For each share, take the next available letter from the bech32 alphabet, in alphabetical order, as <code>a</code>, <code>c</code>, <code>d</code>, ..., to be the share index.
481-
* Generate the payload as ceil(''byte_length * 8 / 5'') random symbols (5-bit values mapped to Bech32 chars).
482-
* Note: The exact number of symbols depends on the byte_length.
483-
* If ''n'' >= ''t'', use the DRNG to deterministically select additional unique indices.
484-
* For additional shares ''n'' - ''t'', compute their payloads by interpolating using BIP-93 SSS rules from the initial ''t'' shares.
485-
* Encode each share as a codex32 string per BIP-93.
486-
* The secret can be recovered by interpolating any ''t'' shares at index "s".
487-
488-
* Existing Master Seeds (n = t - 1)
489-
* Generate ''n'' = ''t'' - 1 shares with random payloads using the DRNG, as above.
490-
* Assign indices in fixed alphabetical order (<code>a</code>, <code>c</code>, <code>d</code>, ...).
491-
* The existing master seed is treated as the ''t''-th share (encoded as codex32 secret with index "s").
492-
* To generate additional shares, interpolate using the ''t'' points (''t''-1 generated shares + secret).
493-
* Encode the generated shares as codex32 strings.
494-
* To recover, combine any ''t'' shares to interpolate the secret at "s".
495-
Note: For existing seeds, the software must know the master seed to compute additional shares or verify, but the derived entropy ensures deterministic randomness.
496-
=======
497-
! Data length
498-
=======
499-
! Data Length (Characters)
500-
>>>>>>> 8a14663 (Finish polishing of bip-0085.mediawiki)
501-
!Code
502-
|-
503-
| 16
504-
| 45
505-
| 16'
506-
|-
507-
| 32
508-
| 71
509-
| 32'
510-
|-
511-
| 64
512-
| 124
513-
| 64'
514-
|}
515-
Note: Other lengths between 16 and 64 are valid but not recommended, using corresponding hardened indices.
516-
517-
Identifer Table
518-
519-
{|
520-
! Identifier
521-
!Code
522-
|-
523-
| id0, id1, id2, id3
524-
| id0'/id1'/id2'/id3'
525-
|-
526-
| Default (BIP-0032 fingerprint)
527-
| 32'/32'/32'/32'
528-
|}
529-
The identifier is four bech32 characters converted to four integers using the bech32 character table from BIP-0173. The default is the 20 most significant bits of the BIP-0032 fingerprint of the master seed converted to bech32. Values >= ''32'' use the default. This affects the derived entropy and resulting fingerprint allowing ''96 ^ 4'' independent default identifier codex32 backups to be generated by incrementing the hardened identifier indices.
530-
531-
Rationale: This default assists users in locating the correct codex32 backup for their wallets, should be distinct for every master seed users may need to disambiguate and, since it is widely stored, improves overall error correction.
532-
533-
====Unshared Secret====
534-
535-
When <code>threshold == "0" and n == 1</code>, the output is a codex32 secret. The payload in a codex32 secret is a direct encoding of a BIP-0032 HD master seed.
536-
537-
Note: <code>threshold == "0" and n > 1</code> is invalid.
538-
539-
Examples:
540-
541-
Generate a "cl" prefixed Core Lightning HSM secret, 32-bytes with identifier "cln2".
542-
543-
INPUT:
544-
* MASTER BIP32 ROOT KEY: xprv9s21ZrQH143K2LBWUUQRFXhucrQqBpKdRRxNVq2zBqsx8HVqFk2uYo8kmbaLLHRdqtQpUm98uKfu3vca1LqdGhUtyoFnCNkfmXRyPXLjbKb
545-
* PATH: m/83696968'/93'/1'/0'/1'/32'/24'/31'/19'/10'
546-
OUTPUT:
547-
* DERIVED ENTROPY=
548-
* DERIVED BIP93 codex32=cl10cln2s...
549-
550-
====Share Generation====
551-
552-
If we already have a valid set of ''t'' initial codex32 strings, use BIP-0093 to derive ''n'' shares. The BIP85 dice application may be used to randomly select ''n'' share indices.
553-
554-
Otherwise, for each initial share needed to reach ''t'':
555-
556-
1. Take the next available letter from the bech32 alphabet, in alphabetical order, as <code>a</code>, <code>c</code>, <code>d</code>, ..., to be the share index.
557-
* Valid share index characters are the bech32 charset excluding "s" sorted alphabetically as ''acdefghjklmnpqrtuvwxyz023456789'' (31 share index characters).
558-
2. Generate ceil(''<code>byte_length</code> * 8 / 5'') random payload characters using the BIP85 DRNG.
559-
* Recover secret, if needed, for the default identifier.
560-
3. Prepend the <code>threshold</code> and identifier.
561-
562-
4. Compute and append the codex32 checksum.
563-
564-
5. Translate the data part to characters using the table from BIP-0173 and prepend <code>hrp</code>1.
565-
566-
{|
567-
! Fresh master seeds
568-
!Existing master seeds
569-
|-
570-
| ''n'' >= ''t''
571-
| ''n'' < ''t''
572-
|}
573-
574-
There are two ways to create an initial set of ''t'' valid codex32 strings, depending on whether the user already has an existing master seed.
575-
576-
=====For a fresh master seed=====
577-
578-
Generate ''t'' initial random shares as above, then:
579-
* Derive the remaining 31 - ''t'' possible shares by interpolating from these initial ''t'' shares.
580-
* Use the DRNG to deterministically select ''n'' unique indices (excluding "s").
581-
* Output the shares with these indices.
582-
* The secret can be recovered by interpolating any ''t'' shares at index "s".
583-
>>>>>>> 8b99481 (Update bip-0085.mediawiki)
584-
585-
<<<<<<< HEAD
586-
* Constraints
587-
* Index "s" is reserved for the secret (''t'' = 0').
588-
* If ''n'' < ''t'' and ''n'' != ''t'' - 1, invalid.
589-
* Payloads are generated as random symbols; final encoding includes checksums per BIP-93.
590-
* For identifier omitted, compute as 4 bech32 characters of the BIP32 fingerprint of the seed (payload bytes of "s") or for ''n'' = ''t'' - 1 the BIP32 fingerprint of the share payload(s) bytes.
591-
592-
* Rationale:
593-
- Aligns with the BIP-85 convention of using the BIP number as the
594-
application number where appropriate.
595-
- Enables deterministic generation of Codex32-compatible master seeds
596-
from a single root xprv, consistent with other BIP-85 applications.
597-
598-
<<<<<<< HEAD
599-
<<<<<<< HEAD
600-
=====Examples=====
601-
Generates 5 "ms" prefixed codex32 shares of 32 bytes each, threshold 3, identifier "qsqp" (assuming charset mapping for 0,16,0,1).
602-
>>>>>>> 304e622 (reduce Table of Contents entries)
603-
=======
604-
====Examples====
605-
=======
606-
=====For an existing master seed=====
607-
608-
Existing Master Seeds (n = t - 1)
609-
* Generate ''n'' = ''t'' - 1 shares with random payloads using the DRNG, as above.
610-
* The existing master seed is treated as the ''t''-th share (encoded as codex32 secret with index "s").
611-
* To generate additional shares, interpolate using the ''t'' points (''t''-1 generated shares + secret).
612-
* Encode the generated shares as codex32 strings.
613-
* To recover, combine any ''t'' shares to interpolate the secret at "s".
614-
Note: For existing seeds, the software must know the master seed to compute additional shares or verify, but the derived entropy ensures deterministic randomness.
615-
616-
Examples:
617-
618-
>>>>>>> 8b99481 (Update bip-0085.mediawiki)
619-
Generates 5 "ms" prefixed codex32 shares for a 32 byte seed, threshold 3, identifier "qsqp" (assuming charset mapping for 0,16,0,1).
620-
>>>>>>> f02a449 (Described examples and bumped them up a TOC level)
621438
622439
INPUT:
623440
* MASTER BIP32 ROOT KEY: xprv9s21ZrQH143K2LBWUUQRFXhucrQqBpKdRRxNVq2zBqsx8HVqFk2uYo8kmbaLLHRdqtQpUm98uKfu3vca1LqdGhUtyoFnCNkfmXRyPXLjbKb
@@ -631,91 +448,14 @@ Generate 1 codex32 share for a 64-byte existing master seed, threshold 2, identi
631448
632449
Note: Indices will be alphabetical. The default identifier is the fingerprint of payload bytes of share "a".
633450
634-
<<<<<<< HEAD
635-
Generates 16-byte codex32 secret with identifier "test".
636-
637451
INPUT:
638452
* MASTER BIP32 ROOT KEY: xprv9s21ZrQH143K2LBWUUQRFXhucrQqBpKdRRxNVq2zBqsx8HVqFk2uYo8kmbaLLHRdqtQpUm98uKfu3vca1LqdGhUtyoFnCNkfmXRyPXLjbKb
639453
* PATH: m/83696968'/93'/0'/2'/1'/64'/32'/29'/19'/19'/0'
640454
OUTPUT:
641-
<<<<<<< HEAD
642455
* DERIVED ENTROPY=bb4fb0e144930d545836177820d173cc250b9084ac50ce3aa6816efaed2dc750cc687b71c9c95a372009427ced155e78622a81defed03321aea49f4d4fdb688b
643456
* DERIVED BIP93 identifier=mann
644457
* DERIVED BIP93 codex32=ms12mannaczq4kkph3gtppqu5ehjes6fvsyh09m0tk3ag5z3tkq5p5menyjpukyy2dvddk4yu979949g08jlfdt4w946we8dynamcu22c0tr6s2rndpnrmqac6z23nd
645-
=======
646-
* DERIVED ENTROPY=
647-
* DERIVED BIP93 codex32=ms10tests...
648-
649-
=======
650-
>>>>>>> 8b99481 (Update bip-0085.mediawiki)
651-
Generates 3 codex32 shares, 16 bytes seed, threshold 2, identifier "name".
652-
=======
653-
Examples:
654-
655-
Generate 3 codex32 shares for a 32 byte seed, threshold 2, default identifier.
656-
657-
INPUT:
658-
* MASTER BIP32 ROOT KEY: xprv9s21ZrQH143K2LBWUUQRFXhucrQqBpKdRRxNVq2zBqsx8HVqFk2uYo8kmbaLLHRdqtQpUm98uKfu3vca1LqdGhUtyoFnCNkfmXRyPXLjbKb
659-
* PATH: m/83696968'/93'/0'/2'/3'/16'/32'/32'/32'/32'
660-
OUTPUT:
661-
* DERIVED ENTROPY=
662-
* DERIVED BIP93 codex32=ms12?????... ms12?????... ms12?????...
663-
664-
Generate 10 codex32 shares for a 16 byte seed, threshold 3, identifier <code>"name"</code>.
665-
>>>>>>> 8a14663 (Finish polishing of bip-0085.mediawiki)
666-
667-
INPUT:
668-
* MASTER BIP32 ROOT KEY: xprv9s21ZrQH143K2LBWUUQRFXhucrQqBpKdRRxNVq2zBqsx8HVqFk2uYo8kmbaLLHRdqtQpUm98uKfu3vca1LqdGhUtyoFnCNkfmXRyPXLjbKb
669-
* PATH: m/83696968'/93'/0'/3'/10'/16'/19'/29'/27'/25'
670-
OUTPUT:
671-
* DERIVED ENTROPY=
672-
* DERIVED BIP93 codex32=ms13name... ms13name... ms13name... ms13name... ms13name...
673-
674-
675-
=====For an existing master seed=====
676-
677-
Generate ''n'' = ''t'' - 1 initial random shares as above, then:
678-
* Output these shares with the alphabetized indices.
679-
* The existing master seed is treated as the ''t''-th share (encoded as codex32 secret with index "s").
680-
* To generate additional shares, interpolate using the ''t'' points (''t''-1 generated shares + secret).
681-
682-
Examples:
683-
684-
Generate 2 codex32 shares, 16 bytes seed, threshold 3, identifier "g0??".
685-
686-
Note: The share indices are alphabetized. The default identifier is the fingerprint of payload bytes of "s" had the <code>threshold</code been <code>n</code> (2 in this example).
687-
688-
INPUT:
689-
* MASTER BIP32 ROOT KEY: xprv9s21ZrQH143K2LBWUUQRFXhucrQqBpKdRRxNVq2zBqsx8HVqFk2uYo8kmbaLLHRdqtQpUm98uKfu3vca1LqdGhUtyoFnCNkfmXRyPXLjbKb
690-
* PATH: m/83696968'/93'/0'/3'/2'/16'/8'/15'/32'/32'/0'
691-
OUTPUT:
692-
* DERIVED ENTROPY=
693-
* DERIVED BIP93 codex32=ms13g0??a... ms13g0??c...
694-
695-
Generate 1 shares for a 16-byte existing master seed, threshold 2, default identifier.
696-
697-
Note: Indices will be alphabetical. The default identifier is the fingerprint of payload bytes of share "a".
698-
699-
INPUT:
700-
* MASTER BIP32 ROOT KEY: xprv9s21ZrQH143K2LBWUUQRFXhucrQqBpKdRRxNVq2zBqsx8HVqFk2uYo8kmbaLLHRdqtQpUm98uKfu3vca1LqdGhUtyoFnCNkfmXRyPXLjbKb
701-
* PATH: m/83696968'/93'/0'/3'/2'/16'/32'/32'/32'/32'
702-
OUTPUT:
703-
* DERIVED ENTROPY=
704-
* DERIVED BIP93 codex32=ms12????a...
705-
706-
<<<<<<< HEAD
707-
Generate 1 "cl" prefixed Core Lightning HSM secret, 32-bytes, identifier "cln2".
708-
709-
INPUT:
710-
* MASTER BIP32 ROOT KEY: xprv9s21ZrQH143K2LBWUUQRFXhucrQqBpKdRRxNVq2zBqsx8HVqFk2uYo8kmbaLLHRdqtQpUm98uKfu3vca1LqdGhUtyoFnCNkfmXRyPXLjbKb
711-
* PATH: m/83696968'/93'/1'/0'/1'/32'/24'/31'/19'/10'
712-
OUTPUT:
713-
* DERIVED ENTROPY=
714-
* DERIVED BIP93 codex32=cl10cln2s...
715-
>>>>>>> f02a449 (Described examples and bumped them up a TOC level)
716458
717-
=======
718-
>>>>>>> 8b99481 (Update bip-0085.mediawiki)
719459
===HD-Seed WIF===
720460
Application number: 2'
721461
@@ -920,11 +660,7 @@ OUTPUT
920660
921661
This specification is not backwards compatible with any other existing specification.
922662
923-
<<<<<<< HEAD
924663
This specification relies on BIP32 but is agnostic to how the BIP32 root key is derived. As such, this standard is able to derive wallets with initialization schemes like BIP39, codex32 or Electrum wallet style mnemonics.
925-
=======
926-
This specification relies on BIP32 but is agnostic to how the BIP32 root key is derived. As such, this standard is able to derive wallets with initialization schemes like Codex32 backups or BIP39 or Electrum wallet style mnemonics.
927-
>>>>>>> 8a14663 (Finish polishing of bip-0085.mediawiki)
928664
929665
==References==
930666

0 commit comments

Comments
 (0)