<p>I suggest you use this code instead (Shelley address, not Byron):</p>
<pre><code>    const accountKey = rootKey
      .derive(harden(1852)) // purpose
      .derive(harden(1815)) // coin type
      .derive(harden(0)); // account #0
    
    const utxoPubKey = accountKey
      .derive(0) // external
      .derive(0)
      .to_public();
    
    const stakeKey = accountKey
      .derive(2) // chimeric
      .derive(0)
      .to_public();

const baseAddr = CardanoWasm.BaseAddress.new(
  CardanoWasm.NetworkInfo.mainnet().network_id(),
  CardanoWasm.StakeCredential.from_keyhash(utxoPubKey.to_raw_key().hash()),
  CardanoWasm.StakeCredential.from_keyhash(stakeKey.to_raw_key().hash()),
);

const address = baseAddress.to_address();
</code></pre>
<p>You can find more information about this <a href="https://github.com/Emurgo/cardano-serialization-lib/blob/master/doc/getting-started/generating-keys.md" rel="nofollow noreferrer">here</a>.</p>

CC BY-SA 4.0
2023-04-02T11:07:49.330Z
My address is Byron address, not Shelley address. So, I am using my above code. Do you see any issue?
Heindrick
CC BY-SA 4.0
2023-04-02T22:31:26.693Z
Yes, I think you are not deriving the `accountKey` in the right way. See my answer and try that derivation instead.
Falcon Stakepool
CC BY-SA 4.0
2023-04-03T00:47:00.790Z
I am sure, I am deriving account key correctly, because I got correct byron wallet address from private key.
Heindrick
CC BY-SA 4.0
2023-04-03T01:11:07.537Z
If I use your method, I get wrong address which has no balance.
Heindrick
CC BY-SA 4.0
2023-04-04T08:24:14.877Z
Do you have any idea? @Falcon Stakepool
Heindrick
CC BY-SA 4.0
2023-04-05T05:35:34.827Z
If you are getting the right wallet from your private key then it seems the problem is in the way you are signing your transaction. Can you please share the code for how you are building and signing your transaction?
Falcon Stakepool
CC BY-SA 4.0
2023-04-02T00:43:32.063Z
2023-04-02T00:43:32.063Z
Falcon Stakepool
<p>I am <code>@emurgo/cardano-serialization-lib-nodejs</code> to submit transaction in cardano.</p>
<p>I am getting following error.</p>
<pre><code>Transaction 5c98317bc6caf027b91e807ed1cdd78571b8f9a791202b5feff5b32fa5f71f1f rejected,
message: &quot;transaction submit error ShelleyTxValidationError ShelleyBasedEraBabbage
(ApplyTxError [UtxowFailure (FromAlonzoUtxowFail (WrappedShelleyEraFailure
(MissingVKeyWitnessesUTXOW (WitHashes (fromList [KeyHash
\&quot;7afb7e3bfc4a25c9b5387657e8f71ae0c2d5f3b26142b51592785972\&quot;])))))])&quot;
</code></pre>
<p>I checked <a href="https://forum.cardano.org/t/blockfrostservererror-transaction-submit-error-shelleytxvalidationerror-shelleybasederababbage-applytxerror-utxowfailure-fromalonzoutxowfail-wrappedshelleyerafailure-missingvkeywitnessesutxow-withashes-fromlist-keyhash-b5cfe7a19bd626bd0d26657e/114662" rel="nofollow noreferrer">https://forum.cardano.org/t/blockfrostservererror-transaction-submit-error-shelleytxvalidationerror-shelleybasederababbage-applytxerror-utxowfailure-fromalonzoutxowfail-wrappedshelleyerafailure-missingvkeywitnessesutxow-withashes-fromlist-keyhash-b5cfe7a19bd626bd0d26657e/114662</a> and I am using utxoKey as signKey, but I am still getting above error.</p>
<p>How can I fix it?</p>
<p>Following is my code snippet to get signKey and address.</p>
<pre><code>const accountKey = bipPrvKey
    .derive(harden(44)) // purpose
    .derive(harden(1815)) // coin type
    .derive(harden(0)); // account #

  const utxoKey = accountKey
    .derive(0) // external
    .derive(0);

  const utxoPubKey = utxoKey.to_public();

  const byronAddr = CardanoWasm.ByronAddress.icarus_from_key(
    utxoPubKey,
    CardanoWasm.NetworkInfo.mainnet().protocol_magic()
  );

  const address = byronAddr.to_base58();

  return { signKey: utxoKey.to_raw_key(), address: address };
</code></pre>

CC BY-SA 4.0
2023-03-31T23:16:58.653Z
You are missing a key when signing your transaction. Which kind of transaction are you trying to submit? Check that the key you are using is the right one and if it is a staking transaction for example, you need to sign it also with the staking key.
Falcon Stakepool
CC BY-SA 4.0
2023-04-01T09:22:14.987Z
I am trying to send transfer transaction. I am using utxoKey as ref url. But I am still getting error.
Heindrick
CC BY-SA 4.0
2023-04-01T09:32:54.743Z
I added my code snippet. Please check @Falcon Stakepool
Heindrick
CC BY-SA 4.0
2023-04-01T23:12:38.123Z
Why are you using Byron? Try using Shelley. Byron is and old type of address Cardano used until July 2020.
Falcon Stakepool
CC BY-SA 4.0
2023-04-02T11:08:44.637Z
Yes. I know, but I am using infinito wallet, and it is byron address. I am using above code.
Heindrick
<transaction><blockfrost><emurgo>
Transaction submit error MissingVKeyWitnessesUTXOW
# Transaction submit error MissingVKeyWitnessesUTXOW

(Asked by: username_0 on 2023-03-31)

I am @emurgo/cardano-serialization-lib-nodejs to submit transaction in cardano.
I am getting following error.
Transaction 5c98317bc6caf027b91e807ed1cdd78571b8f9a791202b5feff5b32fa5f71f1f rejected,
message: "transaction submit error ShelleyTxValidationError ShelleyBasedEraBabbage
(ApplyTxError [UtxowFailure (FromAlonzoUtxowFail (WrappedShelleyEraFailure
(MissingVKeyWitnessesUTXOW (WitHashes (fromList [KeyHash
\"7afb7e3bfc4a25c9b5387657e8f71ae0c2d5f3b26142b51592785972\"])))))])"

I checked https://forum.cardano.org/t/blockfrostservererror-transaction-submit-error-shelleytxvalidationerror-shelleybasederababbage-applytxerror-utxowfailure-fromalonzoutxowfail-wrappedshelleyerafailure-missingvkeywitnessesutxow-withashes-fromlist-keyhash-b5cfe7a19bd626bd0d26657e/114662 and I am using utxoKey as signKey, but I am still getting above error.
How can I fix it?
Following is my code snippet to get signKey and address.
const accountKey = bipPrvKey
    .derive(harden(44)) // purpose
    .derive(harden(1815)) // coin type
    .derive(harden(0)); // account #

  const utxoKey = accountKey
    .derive(0) // external
    .derive(0);

  const utxoPubKey = utxoKey.to_public();

  const byronAddr = CardanoWasm.ByronAddress.icarus_from_key(
    utxoPubKey,
    CardanoWasm.NetworkInfo.mainnet().protocol_magic()
  );

  const address = byronAddr.to_base58();

  return { signKey: utxoKey.to_raw_key(), address: address };

**Tags:** transaction, blockfrost, emurgo
> **Comments:**
> **username_1**: You are missing a key when signing your transaction. Which kind of transaction are you trying to submit? Check that the key you are using is the right one and if it is a staking transaction for example, you need to sign it also with the staking key.  
> **username_0**: I am trying to send transfer transaction. I am using utxoKey as ref url. But I am still getting error.  
> **username_0**: I added my code snippet. Please check @Falcon Stakepool  
> **username_1**: Why are you using Byron? Try using Shelley. Byron is and old type of address Cardano used until July 2020.  
> **username_0**: Yes. I know, but I am using infinito wallet, and it is byron address. I am using above code.  

---

## 1 answers

### Answer by username_1 on 2023-04-02. Score: 1

I suggest you use this code instead (Shelley address, not Byron):
    const accountKey = rootKey
      .derive(harden(1852)) // purpose
      .derive(harden(1815)) // coin type
      .derive(harden(0)); // account #0
    
    const utxoPubKey = accountKey
      .derive(0) // external
      .derive(0)
      .to_public();
    
    const stakeKey = accountKey
      .derive(2) // chimeric
      .derive(0)
      .to_public();

const baseAddr = CardanoWasm.BaseAddress.new(
  CardanoWasm.NetworkInfo.mainnet().network_id(),
  CardanoWasm.StakeCredential.from_keyhash(utxoPubKey.to_raw_key().hash()),
  CardanoWasm.StakeCredential.from_keyhash(stakeKey.to_raw_key().hash()),
);

const address = baseAddress.to_address();

You can find more information about this here.

> **Comments:**
> **username_0**: My address is Byron address, not Shelley address. So, I am using my above code. Do you see any issue?  
> **username_1**: Yes, I think you are not deriving the `accountKey` in the right way. See my answer and try that derivation instead.  
> **username_0**: I am sure, I am deriving account key correctly, because I got correct byron wallet address from private key.  
> **username_0**: If I use your method, I get wrong address which has no balance.  
> **username_0**: Do you have any idea? @Falcon Stakepool  
> **username_1**: If you are getting the right wallet from your private key then it seems the problem is in the way you are signing your transaction. Can you please share the code for how you are building and signing your transaction?  

---

