Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
128 changes: 126 additions & 2 deletions bip-0085.mediawiki
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
Type: Informational
Assigned: 2020-03-20
License: BSD-2-Clause OR OPUBL-1.0
Version: 2.1.0
Version: 2.2.0
</pre>

==Abstract==
Expand Down Expand Up @@ -223,6 +223,124 @@ OUTPUT:
* DERIVED ENTROPY=ae131e2312cdc61331542efe0d1077bac5ea803adf24b313a4f0e48e9c51f37f
* 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

===BIP93===
Application number: 93'

Generates canonical initial codex32 strings.

The derivation path format is:

<code>m/83696968'/93'/{profile}'/{payload_len}'/{index}'</code>

<code>{profile}</code> selects the secret-payload construction and human-readable part.
Profile <code>0</code> uses the human-readable part <code>ms</code>.
An unassigned <code>{profile}</code> has no application-93 output.

<code>{payload_len}</code> is the number of bech32 characters in the payload and MUST be valid for the selected <code>{profile}</code>.

For application 93, <code>{index}</code> is the 30-bit integer serialization
of the six-character codex32 header.

Let <code>u5(c)</code> be the 5-bit value of <code>c</code>
in the bech32 character table from BIP173.

<pre>
header_chars = threshold_char || identifier || share_idx

index =
u5(threshold_char) << 25 |
u5(identifier[0]) << 20 |
u5(identifier[1]) << 15 |
u5(identifier[2]) << 10 |
u5(identifier[3]) << 5 |
u5(share_idx)
</pre>

<code>{index}</code> MUST be less than <code>2^30</code>
and decode to a valid codex32 header.

At threshold <code>0</code>, the canonical initial basis consists of
<code>share_idx = s</code>.
Otherwise, for threshold <code>k</code>, the canonical initial basis consists of
the first <code>k</code> share indices in the sequence <code>a</code>,
<code>c</code>, <code>d</code>, <code>e</code>, <code>f</code>,
<code>g</code>, <code>h</code>, <code>j</code>, <code>k</code>.

A path whose header is outside the canonical initial basis
has no application-93 output.

For a fixed BIP85 root key, each valid fully specified path MUST produce exactly one
canonical initial codex32 string.
Each resulting string MUST correspond to exactly one valid fully specified path.

To generate a canonical initial codex32 string,
create a BIP85 DRNG whose seed is the derived entropy.
The constructions below produce exactly <code>5 * payload_len</code> payload bits.
Re-arrange these bits into groups of 5 and translate them to characters
using the bech32 character table from BIP173.
Assemble the output from the human-readable part selected by <code>{profile}</code>,
the header encoded by <code>{index}</code>, and the payload.
Generate the checksum as specified by BIP93.
The application-93 output MUST be lowercase.

====Master seed====

Profile <code>0</code> encodes a BIP32 HD master seed
using the BIP93 master seed format.

Let <code>byte_len = floor(5 * payload_len / 8)</code>
and <code>pad_len = (5 * payload_len) mod 8</code>.

Read <code>byte_len</code> bytes from the DRNG
and append <code>pad_len</code> zero bits.

INPUT:
* MASTER BIP32 ROOT KEY: xprv9s21ZrQH143K2LBWUUQRFXhucrQqBpKdRRxNVq2zBqsx8HVqFk2uYo8kmbaLLHRdqtQpUm98uKfu3vca1LqdGhUtyoFnCNkfmXRyPXLjbKb
* HEADER: 0secrs
* INDEX: 520937584
* PATH: m/83696968'/93'/0'/26'/520937584'

OUTPUT:
* DERIVED ENTROPY=a95e647c44382b2c6f7aa9f6f57461a42a2f77af83f0b23ca305f5c3076ca518c237cd41e56e9d8c7e7e8e0dd6c22d4deae2dda8931c18ffbe6cc2e097cf6116
* DERIVED MASTER SEED=cba51fa2f647f538872fbfbb9271e420
* DERIVED CODEX32 SECRET=ms10secrsewj3lghkgl6n3pe0h7aeyu0yyqlws7qlpv4takg

Here <code>payload_len = 26</code>, <code>byte_len = 16</code>,
and <code>pad_len = 2</code>.

====Shares====

For a share in the canonical initial basis,
read <code>ceil(5 * payload_len / 8)</code> bytes from the DRNG
and keep the first <code>5 * payload_len</code> bits, most significant bit first.

Additional shares are obtained by BIP93 interpolation.
A canonical initial basis can be generated from one or multiple BIP85 root keys.

The following outputs form a threshold-2 initial basis.

INPUT:
* MASTER BIP32 ROOT KEY: xprv9s21ZrQH143K2LBWUUQRFXhucrQqBpKdRRxNVq2zBqsx8HVqFk2uYo8kmbaLLHRdqtQpUm98uKfu3vca1LqdGhUtyoFnCNkfmXRyPXLjbKb
* PAYLOAD LENGTH: 26
* HEADER: 2shara
* INDEX: 353105021
* PATH: m/83696968'/93'/0'/26'/353105021'

OUTPUT:
* DERIVED ENTROPY=c95df7678fd370b68c419e694c04ed65a86df7368c0371bf3310cc9f5ed474ae02a8eeab8f5c64e7fadbccde17cfd68275570a88039c242c6b2053b13aa764f2
* DERIVED CODEX32 SHARE=ms12sharan26hdftg98lnz68h3p2c796vyvc3w06df5kav9m

INPUT:
* MASTER BIP32 ROOT KEY: xprv9s21ZrQH143K2LBWUUQRFXhucrQqBpKdRRxNVq2zBqsx8HVqFk2uYo8kmbaLLHRdqtQpUm98uKfu3vca1LqdGhUtyoFnCNkfmXRyPXLjbKb
* PAYLOAD LENGTH: 26
* HEADER: 2sharc
* INDEX: 353105016
* PATH: m/83696968'/93'/0'/26'/353105016'

OUTPUT:
* DERIVED ENTROPY=be19028ae7a81c558c9fe9f461ceddda629318a6eb1ff309cd408b0e3cd4a031788117f50d551ff38200e96afb5d14c443b7bb91e05e190b360751cb81bd6750
* DERIVED CODEX32 SHARE=ms12sharcjlku4rmnudpgw7h8yup99c8yjk6qe7fnm4nlla4

===HD-Seed WIF===
Application number: 2'

Expand Down Expand Up @@ -481,7 +599,7 @@ This specification relies on BIP32 but is agnostic to how the BIP32 root key is

==References==

BIP32, BIP39,
BIP32, BIP39, BIP93, BIP173,
[https://github.com/nostr-protocol/nips/blob/master/01.md NIP-01],
[https://github.com/nostr-protocol/nips/blob/master/06.md NIP-06],
[https://github.com/nostr-protocol/nips/blob/master/19.md NIP-19]
Expand All @@ -492,6 +610,12 @@ BIP32, BIP39,

==Changelog==

===2.2.0 (2026-08-20)===

====Added====

* codex32 application 93'

===2.1.0 (2026-08-02)===

====Added====
Expand Down