<hr />
<p>The process of converting a seed phrase (also known as a mnemonic seed phrase) into a private key involves a few steps that are based on cryptographic functions. Below is a general overview of the steps typically used in the Bitcoin protocol (BIP39 and BIP32 standards):</p>
<ul>
<li>
<pre><code>  Mnemonic Seed Phrase Generation:
</code></pre>
<ul>
<li>A mnemonic seed phrase is usually generated from a random number let’s call it (EN for entropy).</li>
<li>The EN is often 128, 160, 192, 224, or 256 bits long.</li>
<li>A checksum is added to the EN. The checksum length is equal to the EN length divided by 32.</li>
<li>The combined EN and checksum bits are then divided into groups of 11 bits, each corresponding to a word from a predefined list of 2048 words.</li>
</ul>
</li>
</ul>
<p>(Example: My EN generated is a 128 bit length of randomly generated ones and zeros.  Divide 128 into 32 you get 4. Add 4 to 128 is 132.  Then 132 divided by 11 results in 12.  These 12 bits are compared with the established 2048 words giving us the mnemonic 12 word phrase.)</p>
<ul>
<li>
<pre><code>  Seed Derivation from Mnemonic:
</code></pre>
<ul>
<li>Once you have the mnemonic phrase, it is converted into a seed by using what’s called a key-stretching function. The standard used is PBKDF2.</li>
<li>The mnemonic phrase is combined with a salt that is prefixed with the string &quot;mnemonic&quot; and optionally can be followed by a passphrase provided by the user (for added security).</li>
<li>The PBKDF2 function uses HMAC-SHA512 as its cryptographic hash function. The typical iteration count is 2048, and this process outputs a 512-bit seed.</li>
</ul>
</li>
</ul>
<p>( An example applying such function can be viewed by using the calculator found at <a href="https://8gwifi.org/pbkdf.jsp" rel="nofollow noreferrer">https://8gwifi.org/pbkdf.jsp</a>)</p>
<ul>
<li>
<pre><code>  Generating the Master Private Key and Chain Code:
</code></pre>
<ul>
<li>The seed derived from the mnemonic is then used to generate the master private key and a master chain code.</li>
<li>This is done using the HMAC-SHA512 algorithm. The seed is used as the input, and the key is set as the string &quot;Bitcoin seed&quot;.</li>
<li>The left 256 bits of the HMAC output are used as the master private key, and the right 256 bits are used as the master chain code.
(This can be generated using the compiler such as the one at <a href="https://tools.onecompiler.com/hmac-sha512" rel="nofollow noreferrer">https://tools.onecompiler.com/hmac-sha512</a>)</li>
</ul>
</li>
<li>
<pre><code>  Deriving Further Keys:
</code></pre>
<ul>
<li>The Extended Key uses the master private key and chain code, and through a process defined in  BIP32 (Hierarchical Deterministic Wallets), it allows generating multiple child keys.</li>
<li>Each child key can further derive its own child keys, creating a tree-like structure of keys. This allows for easy management and backup of multiple addresses and accounts from a single seed.
( you can apply the generator on <a href="http://bip32.org" rel="nofollow noreferrer">http://bip32.org</a>)</li>
</ul>
</li>
<li>
<pre><code>  Public Keys or Address Generation:
</code></pre>
<ul>
<li>Private keys derived in the above manner can be further processed to generate public keys using elliptic curve multiplication (specifically on the secp256k1 curve in Bitcoin).</li>
<li>Public keys are then hashed and encoded to form cryptocurrency addresses, which are used in transactions.</li>
</ul>
</li>
</ul>
<p>( This process is a bit more involved for an example.  There is a calculator introduced by Mr Maxwell but I have not ventured to install: <a href="https://github.com/MrMaxweII/Secp256k1-Calculator/blob/master/README.md" rel="nofollow noreferrer">https://github.com/MrMaxweII/Secp256k1-Calculator/blob/master/README.md</a>. For a discussion on applying the calculations I found this article useful: <a href="https://steemit.com/ellipticcurve/@sso/calculate-bitcoin-publickey" rel="nofollow noreferrer">https://steemit.com/ellipticcurve/@sso/calculate-bitcoin-publickey</a> )</p>

CC BY-SA 4.0
2024-04-22T21:40:55.827Z
I see the information you've provided but I don't understand how that applied.  And example like would help showing how the bits represent each word
Ritzy Dev
CC BY-SA 4.0
2024-04-14T16:03:03.390Z
2024-04-15T09:31:26.293Z
2024-04-15T09:31:26.293Z
Jake Stanton
<p>I'm interested in how an actual seed phrase is converted into a private key.</p>
<p>I think it's a long the lines of.</p>
<ol>
<li>Generate 11 word seed phrase</li>
<li>Convert the numbers into binary</li>
<li>Add up the binary numbers modulo something to get the checksum.</li>
<li>Convert the 12 words into hex?</li>
</ol>
<p>If someone could outline and show a simple example that would be awesome</p>

CC BY-SA 4.0
2024-04-14T06:10:12.697Z
https://learnmeabitcoin.com/technical/keys/hd-wallets/mnemonic-seed/ has a good step-by-step graphical explanation.
bordalix
<private-key><mnemonic-seed>
What's the raw logic for converting a seed phrase to private key
Ritzy Dev
# What's the raw logic for converting a seed phrase to private key

(Asked by: username_0 on 2024-04-14)

I'm interested in how an actual seed phrase is converted into a private key.

I think it's a long the lines of.

1. Generate 11 word seed phrase
2. Convert the numbers into binary
3. Add up the binary numbers modulo something to get the checksum.
4. Convert the 12 words into hex?

If someone could outline and show a simple example that would be awesome

**Tags:** private-key, mnemonic-seed

> **Comments:**
> **username_1**: https://learnmeabitcoin.com/technical/keys/hd-wallets/mnemonic-seed/ has a good step-by-step graphical explanation.  

---

## 1 answers

### Answer by username_2 on 2024-04-14. Score: 1

---

The process of converting a seed phrase (also known as a mnemonic seed phrase) into a private key involves a few steps that are based on cryptographic functions. Below is a general overview of the steps typically used in the Bitcoin protocol (BIP39 and BIP32 standards):

* ```
    Mnemonic Seed Phrase Generation:

  ```

  + A mnemonic seed phrase is usually generated from a random number let’s call it (EN for entropy).
  + The EN is often 128, 160, 192, 224, or 256 bits long.
  + A checksum is added to the EN. The checksum length is equal to the EN length divided by 32.
  + The combined EN and checksum bits are then divided into groups of 11 bits, each corresponding to a word from a predefined list of 2048 words.

(Example: My EN generated is a 128 bit length of randomly generated ones and zeros. Divide 128 into 32 you get 4. Add 4 to 128 is 132. Then 132 divided by 11 results in 12. These 12 bits are compared with the established 2048 words giving us the mnemonic 12 word phrase.)

* ```
    Seed Derivation from Mnemonic:

  ```

  + Once you have the mnemonic phrase, it is converted into a seed by using what’s called a key-stretching function. The standard used is PBKDF2.
  + The mnemonic phrase is combined with a salt that is prefixed with the string "mnemonic" and optionally can be followed by a passphrase provided by the user (for added security).
  + The PBKDF2 function uses HMAC-SHA512 as its cryptographic hash function. The typical iteration count is 2048, and this process outputs a 512-bit seed.

( An example applying such function can be viewed by using the calculator found at <https://8gwifi.org/pbkdf.jsp>)

* ```
    Generating the Master Private Key and Chain Code:

  ```

  + The seed derived from the mnemonic is then used to generate the master private key and a master chain code.
  + This is done using the HMAC-SHA512 algorithm. The seed is used as the input, and the key is set as the string "Bitcoin seed".
  + The left 256 bits of the HMAC output are used as the master private key, and the right 256 bits are used as the master chain code.
    (This can be generated using the compiler such as the one at <https://tools.onecompiler.com/hmac-sha512>)
* ```
    Deriving Further Keys:

  ```

  + The Extended Key uses the master private key and chain code, and through a process defined in BIP32 (Hierarchical Deterministic Wallets), it allows generating multiple child keys.
  + Each child key can further derive its own child keys, creating a tree-like structure of keys. This allows for easy management and backup of multiple addresses and accounts from a single seed.
    ( you can apply the generator on <http://bip32.org>)
* ```
    Public Keys or Address Generation:

  ```

  + Private keys derived in the above manner can be further processed to generate public keys using elliptic curve multiplication (specifically on the secp256k1 curve in Bitcoin).
  + Public keys are then hashed and encoded to form cryptocurrency addresses, which are used in transactions.

( This process is a bit more involved for an example. There is a calculator introduced by Mr Maxwell but I have not ventured to install: <https://github.com/MrMaxweII/Secp256k1-Calculator/blob/master/README.md>. For a discussion on applying the calculations I found this article useful: <https://steemit.com/ellipticcurve/@sso/calculate-bitcoin-publickey> )

> **Comments:**
> **username_0**: I see the information you've provided but I don't understand how that applied.  And example like would help showing how the bits represent each word  

---

