<p>Let's say your extended signing key is named <code>payment.xkey</code>, in the following format:</p>
<pre><code>{
    &quot;type&quot;: &quot;PaymentExtendedSigningKeyShelley_ed25519_bip32&quot;,
    &quot;description&quot;: &quot;&quot;,
    &quot;cborHex&quot;: &quot;5880687fda2ea05211f09e1544efd4e2da4f5c607dddd06051e6471a754a7efe02411ca42fca7e8e17821485144ba42a12a9814279caf665cb9026faaaf85dffeceb8f206b4eaec7ee07722deab4f17e8705afa7fce7d58b347e1e24ff4f031cdc8ce0c1e06e4934512cc678314402f6c04a7cb999d4efdb324f03a416dfcbda498f&quot;
}
</code></pre>
<p>Run the following command:</p>
<p><code>cat payment.xkey | cardano-address key inspect</code></p>
<p>It will output a 64 byte chain code, and a 128 byte extended signing key. <strong>The first 64 bytes of this extended key is what you are looking for</strong>. You can manually create the non-extended signing key by copy-pasting these first 64 bytes (exactly half) of the &quot;extended_key&quot; section into an appropriately formatted normal signing-key file. For example, if I run the above command and I get the following:</p>
<pre><code>{
    &quot;chain_code&quot;: &quot;e0c1e06e4934512cc678314402f6c04a7cb999d4efdb324f03a416dfcbda498f&quot;,
    &quot;extended_key&quot;: &quot;687fda2ea05211f09e1544efd4e2da4f5c607dddd06051e6471a754a7efe02411ca42fca7e8e17821485144ba42a12a9814279caf665cb9026faaaf85dffeceb&quot;,
    &quot;key_type&quot;: &quot;private&quot;
}
</code></pre>
<p>The string you're looking for would be: <code>687fda2ea05211f09e1544efd4e2da4f5c607dddd06051e6471a754a7efe0241</code></p>
<p>Now, use cardano-cli to generate a random, normal signing key file:</p>
<p><code>cardano-cli address key-gen --signing-key-file payment.skey --verification-key-file payment.vkey</code></p>
<p>Now, discard the vkey (it is irrelevant), open the <code>payment.skey</code> in an editor, and delete everything in the cborHex field <em><strong>following</strong></em> the <code>5820</code>, replacing it with the first 64 bytes of the xprv above. This is your non-extended signing key. Final result should look like:</p>
<pre><code>{
    &quot;type&quot;: &quot;PaymentSigningKeyShelley_ed25519&quot;,
    &quot;description&quot;: &quot;Payment Signing Key&quot;,
    &quot;cborHex&quot;: &quot;5820687fda2ea05211f09e1544efd4e2da4f5c607dddd06051e6471a754a7efe0241&quot;
}
</code></pre>
<p>Repeat the same process for stake-keys, as well as for any other key indexes that are needed.</p>

CC BY-SA 4.0
2022-10-19T01:17:22.310Z
Thanks for this. However, what worked for me was to pass my root private key (the value starting with "root_") to `cardano-address key inspect` and not the extended key file you make reference to in `payment.xkey`.  In other words:

`cat root.prv | cardano-address key inspect`. This is the command that gave me the JSON with "chain_code", "extended_key" and "key_type".
caike
CC BY-SA 4.0
2022-02-28T02:25:29.027Z
2022-02-28T18:08:53.777Z
2022-02-28T18:08:53.777Z
zhekson
<p>See title. I've tried using <a href="https://github.com/input-output-hk/cardano-addresses" rel="nofollow noreferrer">https://github.com/input-output-hk/cardano-addresses</a> to derive the skey, but it only gives an extended version that I'm unable to sign transactions with using the CLI.</p>
<p>Trying to figure out how to get the standard non-extended signing key.</p>

<cardano-cli><cardano-address>
How to derive non-extended skey from mnemonic phrase?
# How to derive non-extended skey from mnemonic phrase?

(Asked by: username_0 on 2022-02-27)

See title. I've tried using <https://github.com/input-output-hk/cardano-addresses> to derive the skey, but it only gives an extended version that I'm unable to sign transactions with using the CLI.

Trying to figure out how to get the standard non-extended signing key.

**Tags:** cardano-cli, cardano-address


---

## 1 answers

### Answer by username_1 on 2022-02-28. Score: 6 | Accepted answer

Let's say your extended signing key is named `payment.xkey`, in the following format:

```
{
    "type": "PaymentExtendedSigningKeyShelley_ed25519_bip32",
    "description": "",
    "cborHex": "5880687fda2ea05211f09e1544efd4e2da4f5c607dddd06051e6471a754a7efe02411ca42fca7e8e17821485144ba42a12a9814279caf665cb9026faaaf85dffeceb8f206b4eaec7ee07722deab4f17e8705afa7fce7d58b347e1e24ff4f031cdc8ce0c1e06e4934512cc678314402f6c04a7cb999d4efdb324f03a416dfcbda498f"
}

```

Run the following command:

`cat payment.xkey | cardano-address key inspect`

It will output a 64 byte chain code, and a 128 byte extended signing key. **The first 64 bytes of this extended key is what you are looking for**. You can manually create the non-extended signing key by copy-pasting these first 64 bytes (exactly half) of the "extended\_key" section into an appropriately formatted normal signing-key file. For example, if I run the above command and I get the following:

```
{
    "chain_code": "e0c1e06e4934512cc678314402f6c04a7cb999d4efdb324f03a416dfcbda498f",
    "extended_key": "687fda2ea05211f09e1544efd4e2da4f5c607dddd06051e6471a754a7efe02411ca42fca7e8e17821485144ba42a12a9814279caf665cb9026faaaf85dffeceb",
    "key_type": "private"
}

```

The string you're looking for would be: `687fda2ea05211f09e1544efd4e2da4f5c607dddd06051e6471a754a7efe0241`

Now, use cardano-cli to generate a random, normal signing key file:

`cardano-cli address key-gen --signing-key-file payment.skey --verification-key-file payment.vkey`

Now, discard the vkey (it is irrelevant), open the `payment.skey` in an editor, and delete everything in the cborHex field ***following*** the `5820`, replacing it with the first 64 bytes of the xprv above. This is your non-extended signing key. Final result should look like:

```
{
    "type": "PaymentSigningKeyShelley_ed25519",
    "description": "Payment Signing Key",
    "cborHex": "5820687fda2ea05211f09e1544efd4e2da4f5c607dddd06051e6471a754a7efe0241"
}

```

Repeat the same process for stake-keys, as well as for any other key indexes that are needed.

> **Comments:**
> **username_2**: Thanks for this. However, what worked for me was to pass my root private key (the value starting with "root_") to `cardano-address key inspect` and not the extended key file you make reference to in `payment.xkey`.  In other words:  `cat root.prv | cardano-address key inspect`. This is the command that gave me the JSON with "chain_code", "extended_key" and "key_type".  

---

