# Can't make transaction for registering stake address (BadInputsUTxO)

**URL:** <https://forum.cardano.org/t/cant-make-transaction-for-registering-stake-address-badinputsutxo/56837>\
**Category:** Setup a Stake Pool\
**Tags:** cardano\
**Created:** [9 April 2021 05:58 UTC](https://forum.cardano.org/t/cant-make-transaction-for-registering-stake-address-badinputsutxo/56837 "2021-04-09T05:58:02Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![LeMonsieurF](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/lemonsieurf/32/33124_2.png) [@LeMonsieurF](https://forum.cardano.org/u/LeMonsieurF)\
**Post date:** [9 April 2021 05:58 UTC](https://forum.cardano.org/t/cant-make-transaction-for-registering-stake-address-badinputsutxo/56837/1 "2021-04-09T05:58:02Z")

</div>

Hello everyone, I’m very new to Cardano but I’m an experienced Linux Administrator and very excited to be part of this community.  
I’m using more or less official and up to date documentation for the setup of my pool:

- [https://docs.cardano.org/projects/cardano-node/en/latest/stake-pool-operations/register\_key.html](https://docs.cardano.org/projects/cardano-node/en/latest/stake-pool-operations/register_key.html)
- [https://cardano-foundation.gitbook.io/stake-pool-course/stake-pool-guide/stake-key/register\_key](https://cardano-foundation.gitbook.io/stake-pool-course/stake-pool-guide/stake-key/register_key)

I’m using last version I build yesterday

```
cardano-node --version
cardano-node 1.26.1 - linux-x86_64 - ghc-8.10

```

I made this little script which is handy as I’m stuck at the submit phase :

```
cardano-cli transaction build-raw --tx-in b64ae44e1195b04663ab863b62337e626c65b0c9855a9fbb9ef4458f81a6f5ee#1 --tx-out $(cat paymentwithstake.addr)+0 --invalid-hereafter 0 --fee 0 --out-file /tmp/tx.raw --certificate-file stake.cert
ttl=$(expr $(cardano-cli query tip --mainnet|jq .slot) + 400)
fee=$(cardano-cli transaction calculate-min-fee --tx-body-file /tmp/tx.raw --tx-in-count 1 --tx-out-count 1 --witness-count 2 --byron-witness-count 0 --mainnet --protocol-params-file conf/protocol.json|awk '{print $1}')
change=$(expr 505000000 - 2000000 - $fee)
cardano-cli transaction build-raw --tx-in b64ae44e1195b04663ab863b62337e626c65b0c9855a9fbb9ef4458f81a6f5ee#1 --tx-out $(cat paymentwithstake.addr)+$change --invalid-hereafter $ttl --fee $fee --out-file /tmp/tx.raw --certificate-file stake.cert
cardano-cli transaction sign --tx-body-file /tmp/tx.raw --signing-key-file ../common/keys/payment.skey --signing-key-file ../common/keys/stake.skey --mainnet --out-file /tmp/tx.signed
cardano-cli transaction submit --tx-file /tmp/tx.signed --mainnet

```

Error is :

> Command failed: transaction submit Error: Error while submitting tx: ShelleyTxValidationError ShelleyBasedEraMary (ApplyTxError [LedgerFailure (UtxowFailure (UtxoFailure (BadInputsUTxO (fromList [TxInCompact (TxId {\_unTxId = SafeHash “b64ae44e1195b04663ab863b62337e626c65b0c9855a9fbb9ef4458f81a6f5ee”}) 1])))),LedgerFailure (UtxowFailure (UtxoFailure (ValueNotConservedUTxO (Value 0 (fromList )) (Value 505000000 (fromList )))))])

IOHK zendesk tells that these errors are related to a bad calculation of values, but I can’t find the error here, all values look correct (I’ve been searching for several hours with no luck). For instance in my payment address I have 505000000 lovelace, which gives around 178525 fee and I do (505000000 - 2000000 - 178525) as value to append to the --tx-out payment address.

Can anybody kindly help ? 🙂  
Thanks in advance,

---

<div class="post-metadata">

**Author:** ![bwbush](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/bwbush/32/29827_2.png) [@bwbush](https://forum.cardano.org/u/bwbush)\
**Post date:** [9 April 2021 11:33 UTC](https://forum.cardano.org/t/cant-make-transaction-for-registering-stake-address-badinputsutxo/56837/2 "2021-04-09T11:33:55Z")

</div>

It looks like the `--tx-in` does not exist on the blockchain, so you might want to check that transaction ID: [https://explorer.cardano.org/en/no-search-results?query=b64ae44e1195b04663ab863b62337e626c65b0c9855a9fbb9ef4458f81a6f5ee](https://explorer.cardano.org/en/no-search-results?query=b64ae44e1195b04663ab863b62337e626c65b0c9855a9fbb9ef4458f81a6f5ee)

You can use `cardano-cli query utxo` to list the unspent transactions at an address.

---

<div class="post-metadata">

**Author:** ![Markus-VITAL](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/markus-vital/32/31295_2.png) [@Markus-VITAL](https://forum.cardano.org/u/Markus-VITAL)\
**Post date:** [9 April 2021 12:17 UTC](https://forum.cardano.org/t/cant-make-transaction-for-registering-stake-address-badinputsutxo/56837/3 "2021-04-09T12:17:01Z")

</div>

A reason for the TX not existing could be that you are not fully synced.  
So the TX may exist but your local server just doesn’t know about it. Make sure your TIP is in sync whith the most recent from the network.

---

<div class="post-metadata">

**Author:** ![LeMonsieurF](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/lemonsieurf/32/33124_2.png) [@LeMonsieurF](https://forum.cardano.org/u/LeMonsieurF)\
**Post date:** [9 April 2021 22:24 UTC](https://forum.cardano.org/t/cant-make-transaction-for-registering-stake-address-badinputsutxo/56837/4 "2021-04-09T22:24:49Z")

</div>

Ok my understanding of --tx-in and --tx-out values was completely wrong. Here the reason in case noobs like me find this thread : 🙂  
–tx-in has to be the Hash ID of your payment account, as returned by command “cardano-cli query uxto”. So both tx-in and tx-out refer to the same address.  
Thank you for your answers 😌
