user4797: I'm trying to new Cardano.Bip32PrivateKey from string cborHex which in file skey generate by cardano-cli
import * as Cardano from "@emurgo/cardano-serialization-lib-nodejs";

function genAccountKey(cborHex: string) {
    return Cardano.Bip32PrivateKey.from_bytes(Buffer.from(cborHex, "hex"))
        .derive(harden(1852)) // purpose
        .derive(harden(1815)) // coin type
        .derive(harden(0)); // account #0

}
genAccountKey("58204022747367deee69f601900e15ddc04fc8024753b6a1539ee2a8bed29832f420");

but I got this err (node:87994) UnhandledPromiseRejectionWarning: Invalid Secret Key size

user4587: You can derive a private key from skey CBOR using:
    // Sign with the backend wallet
    const signingKeyHexCBOR = 'THISISYUURKEYCBOR'
    const signingKey = this.S.PrivateKey.from_normal_bytes(Buffer.from(signingKeyHexCBOR,'hex'));

    const vkeyWitness2 = this.S.make_vkey_witness(txHash, signingKey);
    vkeysWitnesses.add(vkeyWitness);
    ```


user252: The CLI key you generate is not the same as Bip32PrivateKey associated with HD Wallet, the Root key you're considering is green box below - while the CLI key is red one. You can derive from parent key to child, but not the other way round.


4797: <p>I'm trying to new <code>Cardano.Bip32PrivateKey</code> from string cborHex which in file <code>skey</code> generate by cardano-cli</p>
<pre><code>import * as Cardano from &quot;@emurgo/cardano-serialization-lib-nodejs&quot;;

function genAccountKey(cborHex: string) {
    return Cardano.Bip32PrivateKey.from_bytes(Buffer.from(cborHex, &quot;hex&quot;))
        .derive(harden(1852)) // purpose
        .derive(harden(1815)) // coin type
        .derive(harden(0)); // account #0

}
genAccountKey(&quot;58204022747367deee69f601900e15ddc04fc8024753b6a1539ee2a8bed29832f420&quot;);
</code></pre>
<p>but I got this err <code>(node:87994) UnhandledPromiseRejectionWarning: Invalid Secret Key size</code></p>
 4587: <p>You can derive a private key from skey CBOR using:</p>
<pre><code>    // Sign with the backend wallet
    const signingKeyHexCBOR = 'THISISYUURKEYCBOR'
    const signingKey = this.S.PrivateKey.from_normal_bytes(Buffer.from(signingKeyHexCBOR,'hex'));

    const vkeyWitness2 = this.S.make_vkey_witness(txHash, signingKey);
    vkeysWitnesses.add(vkeyWitness);
    ```
</code></pre>
 252: <p>The CLI key you generate is not the same as Bip32PrivateKey associated with HD Wallet, the Root key you're considering is green box below - while the CLI key is red one. You can derive from parent key to child, but not the other way round.</p>
<p><a href="https://i.stack.imgur.com/KjJQv.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/KjJQv.png" alt="enter image description here" /></a></p>
