user5629: Ok, here we go.
First, the balance:
$ cardano-cli query utxo --address addr1vx9z6r6pv5g8aprprvjj2jhamsj4szr6j502fk7wkzq6a3sx0736n --mainnet
                           TxHash                                 TxIx        Amount
--------------------------------------------------------------------------------------
6adeb2bb5e294bcaf4b3aaf555b121e20cfb1c69631d2a8ba64c6b935201e9de     0        4579280 lovelace + TxOutDatumNone

checking that my vkey is the correct one:
$ cardano-cli address build --payment-verification-key-file payment.vkey --mainnet
addr1vx9z6r6pv5g8aprprvjj2jhamsj4szr6j502fk7wkzq6a3sx0736n

building transaction:
$ txin=6adeb2bb5e294bcaf4b3aaf555b121e20cfb1c69631d2a8ba64c6b935201e9de
$ txix=0
$ utxo=4579280
cardano-cli transaction build-raw --tx-in "$txin#$txix" --tx-out "$(cat ../coldwallet.addr)+0" --invalid-hereafter 0 --fee 0 --out-file test.draft

Calculating fee, expiry & rebuilding transaction:
$ fee=( $(cardano-cli transaction calculate-min-fee --tx-body-file test.draft --tx-in-count 1 --tx-out-count 1 --witness-count 1 --byron-witness-count 0 --mainnet --protocol-params-file ../protocol.json) )
$ slot=$(( $(cardano-cli query tip --mainnet | jq '.slot')+3600 ))
$ cardano-cli transaction build-raw --tx-in "$txin#$txix" --tx-out "$(cat ../coldwallet.addr)+$(($utxo-$fee))" --invalid-hereafter $slot --fee ${fee[0]} --out-file test.draft

signing, checking and submitting it:
$ cardano-cli transaction sign --tx-body-file test.draft --signing-key-file payment.skey --mainnet --out-file signed.tx
$ cardano-cli transaction view --tx-file signed.tx
auxiliary scripts: null
certificates: null
collateral inputs: []
era: Alonzo
fee: 171045 Lovelace
inputs:
- 6adeb2bb5e294bcaf4b3aaf555b121e20cfb1c69631d2a8ba64c6b935201e9de#0
metadata: null
mint: null
outputs:
- address: [REDACTED]
  address era: Shelley
  amount:
    lovelace: 4408235
  datum: null
  network: Mainnet
  payment credential:
    key hash: a63e72099726eddcb7b8022bbf11284ba4f6c1f022413b4e9725bd6e
  stake reference:
    key hash: 1e87128217ca8baadf5af504d50fb4f08e406aa979c62a75998e85c5
update proposal: null
validity range:
  lower bound: null
  upper bound: 71465269
withdrawals: null
$ cardano-cli transaction submit --tx-file signed.tx --mainnet
Command failed: transaction submit  Error: Error while submitting tx: ShelleyTxValidationError ShelleyBasedEraAlonzo (ApplyTxError [UtxowFailure (WrappedShelleyEraFailure (MissingVKeyWitnessesUTXOW (WitHashes (fromList [KeyHash "8a2d0f4165107e84611b25254afddc2558087a951ea4dbceb081aec6"]))))])

I've tried everything within my knowledge to fix that, but i couldn't.
I've tried to generate the vkey from my skey again, using:
$ cardano-cli key verification-key --signing-key-file key.skey --verification-key-file key.vkey

but it generates a different vkey, which gives me a different address.
Any ideas?

user5122: I'm going to answer you the same thing I answered on the cardano forum: if the last command gives you a different vkey. which gives you a different address, it means you have the signing key from a different address, not from the address where the ADA is.

5629: <p>Ok, here we go.
First, the balance:</p>
<pre><code>$ cardano-cli query utxo --address addr1vx9z6r6pv5g8aprprvjj2jhamsj4szr6j502fk7wkzq6a3sx0736n --mainnet
                           TxHash                                 TxIx        Amount
--------------------------------------------------------------------------------------
6adeb2bb5e294bcaf4b3aaf555b121e20cfb1c69631d2a8ba64c6b935201e9de     0        4579280 lovelace + TxOutDatumNone
</code></pre>
<p>checking that my vkey is the correct one:</p>
<pre><code>$ cardano-cli address build --payment-verification-key-file payment.vkey --mainnet
addr1vx9z6r6pv5g8aprprvjj2jhamsj4szr6j502fk7wkzq6a3sx0736n
</code></pre>
<p>building transaction:</p>
<pre><code>$ txin=6adeb2bb5e294bcaf4b3aaf555b121e20cfb1c69631d2a8ba64c6b935201e9de
$ txix=0
$ utxo=4579280
cardano-cli transaction build-raw --tx-in &quot;$txin#$txix&quot; --tx-out &quot;$(cat ../coldwallet.addr)+0&quot; --invalid-hereafter 0 --fee 0 --out-file test.draft
</code></pre>
<p>Calculating fee, expiry &amp; rebuilding transaction:</p>
<pre><code>$ fee=( $(cardano-cli transaction calculate-min-fee --tx-body-file test.draft --tx-in-count 1 --tx-out-count 1 --witness-count 1 --byron-witness-count 0 --mainnet --protocol-params-file ../protocol.json) )
$ slot=$(( $(cardano-cli query tip --mainnet | jq '.slot')+3600 ))
$ cardano-cli transaction build-raw --tx-in &quot;$txin#$txix&quot; --tx-out &quot;$(cat ../coldwallet.addr)+$(($utxo-$fee))&quot; --invalid-hereafter $slot --fee ${fee[0]} --out-file test.draft
</code></pre>
<p>signing, checking and submitting it:</p>
<pre><code>$ cardano-cli transaction sign --tx-body-file test.draft --signing-key-file payment.skey --mainnet --out-file signed.tx
$ cardano-cli transaction view --tx-file signed.tx
auxiliary scripts: null
certificates: null
collateral inputs: []
era: Alonzo
fee: 171045 Lovelace
inputs:
- 6adeb2bb5e294bcaf4b3aaf555b121e20cfb1c69631d2a8ba64c6b935201e9de#0
metadata: null
mint: null
outputs:
- address: [REDACTED]
  address era: Shelley
  amount:
    lovelace: 4408235
  datum: null
  network: Mainnet
  payment credential:
    key hash: a63e72099726eddcb7b8022bbf11284ba4f6c1f022413b4e9725bd6e
  stake reference:
    key hash: 1e87128217ca8baadf5af504d50fb4f08e406aa979c62a75998e85c5
update proposal: null
validity range:
  lower bound: null
  upper bound: 71465269
withdrawals: null
$ cardano-cli transaction submit --tx-file signed.tx --mainnet
Command failed: transaction submit  Error: Error while submitting tx: ShelleyTxValidationError ShelleyBasedEraAlonzo (ApplyTxError [UtxowFailure (WrappedShelleyEraFailure (MissingVKeyWitnessesUTXOW (WitHashes (fromList [KeyHash &quot;8a2d0f4165107e84611b25254afddc2558087a951ea4dbceb081aec6&quot;]))))])
</code></pre>
<p>I've tried everything within my knowledge to fix that, but i couldn't.
I've tried to generate the vkey from my skey again, using:</p>
<pre><code>$ cardano-cli key verification-key --signing-key-file key.skey --verification-key-file key.vkey
</code></pre>
<p>but it generates a different vkey, which gives me a different address.</p>
<p>Any ideas?</p>
 5122: <p>I'm going to answer you the same thing I answered on the cardano forum: if the last command gives you a different vkey. which gives you a different address, it means you have the signing key from a different address, not from the address where the ADA is.</p>
