Help: Transaction UtxoFailure ValueNotConservedUTx

I’m new to stake pools, but I’m an experienced software engineer. I’m trying to register a stake key on my pool and having problems with the transaction failing. Documentation is very sketchy for mainnet and I don’t know what the problem is. Any help will be greatly appreciated and thanks in advance.

Software Versions used:
1 cardano-cli 1.27.0 - linux-x86_64 - ghc-8.10
git rev 8fe46140a52810b6ca456be01d652ca08fe730bf
2 cardano-node 1.27.0 - linux-x86_64 - ghc-8.10
git rev 8fe46140a52810b6ca456be01d652ca08fe730bf
3 GHC version 8.10.4
4 libsodium.so.23.3.0
5 cabal version 3.4.0.0

I generated the payment2.addr as so:

cardano-cli shelley stake-address key-gen
–verification-key-file stake.vkey
–signing-key-file stake.skey

cardano-cli shelley address key-gen
–verification-key-file payment2.vkey
–signing-key-file payment2.skey

cardano-cli shelley address build
–payment-verification-key-file payment2.vkey
–stake-verification-key-file stake.vkey
–mainnet
–out-file payment2.addr

The address to send to, paymentwithstakeNew.addr, was created as so:

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

cardano-cli address build
–payment-verification-key-file payment.vkey
–stake-verification-key-file stake.vkey
–mainnet
–out-file paymentwithstakeNew.addr

I funded the payment2.addr from my Yoroi Ledger Nano hard wallet and the funds are there:

cardano-cli query utxo --address $(cat ~/pool-keys/payment2.addr) --mainnet

                       TxHash                                 TxIx        Amount

TxHashValue1 0 500000000 lovelace
TxHashValue2 0 1000000 lovelace

where TxHashValueX denotes the actual hash value not displayed.

Creating the transaction to send all lovelace:
cardano-cli transaction build-raw
–shelley-era
–tx-in TxHashValue1#0
–tx-in TxHashValue2#0
–tx-out $(cat /home/ec2-user/pool-keys/paymentwithstakeNew.addr)+0
–invalid-hereafter 32799000
–fee 0
–certificate-file stake.cert
–out-file tx.raw

Calculate the fee:
cardano-cli transaction calculate-min-fee
–tx-body-file tx.raw
–tx-in-count 2
–tx-out-count 1
–witness-count 1
–byron-witness-count 0
–mainnet
–protocol-params-file protocol.json

FEE: 175973

Calculations:
to send all:
balance fee amount to send
expr 501000000 - 175973 = 500824027

Regenerate transaction:
cardano-cli transaction build-raw
–shelley-era
–tx-in TxHashValue1#0
–tx-in TxHashValue2#0
–tx-out $(cat /home/ec2-user/pool-keys/paymentwithstakeNew.addr)+500824027
–invalid-hereafter 32799000
–fee 175973
–certificate-file stake.cert
–out-file tx.raw

Check tip:

cardano-cli query tip --mainnet
{
“epoch”: 273,
“hash”: “21173adcf5d038f5fb67bf88edf8679384678484578862707bf8a95e816f11d9”,
“slot”: 32632621,
“block”: 5876091,
“era”: “Mary”
}

Sign transaction:
cardano-cli transaction sign
–tx-body-file tx.raw
–signing-key-file payment2.skey
–signing-key-file stake.skey
–mainnet
–out-file tx.signed

Sent transaction:
cardano-cli transaction submit
–tx-file tx.signed
–mainnet

Error Message:
Command failed: transaction submit Error: Error while submitting tx: ShelleyTxValidationError ShelleyBasedEraMary (ApplyTxError [UtxowFailure (UtxoFailure (ValueNotConservedUTxO (Value 501000000 (fromList )) (Value 503000000 (fromList ))))])

I haven’t found any documentation on what this error means or how to resolve the problem. Like where is the value 503000000 coming from when my payment2.addr contains only 501000000?

Also, since my pool is not registered yet, how can I transfer the funds back to my hardware wallet I need to? I get the same error trying to send all funds back to my Ledger Nano hardware wallet address.

Regards
Kevin

Search results for 'UtxoFailure ' - Cardano Forum(ValueNotConservedUTxO&skip_context=true

Hi!

The problem is that payment2 address should be listed on -tx-out - not paymentwithstakeNew.addr - that would be ADA transfer from payment2 to paymentwithstakeNew

also, utxo can’t be less than 1ada (1000000 lovelaces), so when you do tx, check that out is > 1ada

1 Like