Help with Taking rewards issue

I don’t understand how to create successfully the transaction rewards. Can you assist me? I’m trying to follow the official guide but its for no avail.

It always ends with the same error
(ValueNotConservedUTxO (Value 690381863 (fromList )) (Value 737223564 (fromList )))

I’m sharing with you the commands and values I’m experiencing on my server.

Create protocol.json

cardano-cli query protocol-parameters
–mainnet
–out-file protocol.json

Query stake address

cardano-cli query stake-address-info
–mainnet
–address $(cat poolOwner.staking.addr)

[
{
“address”: “stake1…55l”,
“rewardAccountBalance”: 690381863,
“delegation”: “poolId”
}
]

Query payment

cardano-cli query utxo --mainnet --address $(cat payment.addr)
TxHash TxIx Amount

tx-in 0 46841701 lovelace

cardano-cli transaction build-raw
–mary-era
–tx-in tx-in#1
–tx-out $(cat payment.addr)+0
–withdrawal $(cat staking.addr)+0
–invalid-hereafter 0
–fee 0
–out-file withdraw_rewards.draft

Calculate min fee

cardano-cli transaction calculate-min-fee
–tx-body-file withdraw_rewards.draft
–tx-in-count 1
–tx-out-count 1
–witness-count 1
–mainnet
–protocol-params-file protocol.json

172365

Calculate min fees

expr 46841701 - 172365 + 690381863
737051199

Cardano build raw

cardano-cli transaction build-raw
–mary-era
–tx-in txwin#1
–tx-out $(cat payment.addr)+737051199
–withdrawal $(cat poolOwner.staking.addr)+690381863
–invalid-hereafter 12345678
–fee 172365
–out-file withdraw_rewards.raw

Sign transaction

cardano-cli transaction sign
–tx-body-file withdraw_rewards.raw
–signing-key-file payment.skey
–signing-key-file poolOwner.staking.skey
–mainnet
–out-file withdraw_rewards.signed

Submit

cardano-cli transaction submit
–tx-file withdraw_rewards.signed
–mainnet

The error is always the same
(ValueNotConservedUTxO (Value 690381863 (fromList )) (Value 737223564 (fromList )))

Hi!

What happens when you add 737223564 to txout

ValueNotConservedUTxO (Value 690381863 (fromList )) (Value 737395929 (fromList ))))

so is it really txin#1 contains 46841701?

TxHash TxIx Amount

TUXIN 0 46841701 lovelace

but you provided #1 during transaction build, so lets change it to #0

like this?

cardano-cli transaction build-raw
–mary-era
–tx-in txin#0
–tx-out $(cat payment.addr)+737045127
–withdrawal $(cat poolOwner.staking.addr)+690381863
–invalid-hereafter 12345678
–fee 178437
–out-file withdraw_rewards.raw

Command failed: transaction submit Error: Error while submitting tx: ShelleyTxValidationError ShelleyBasedEraMary (ApplyTxError [UtxowFailure (UtxoFailure (OutsideValidityIntervalUTxO (ValidityInterval {invalidBefore = SNothing, invalidHereafter = SJust (SlotNo 12345678)}) (SlotNo 30042462)))])

the invalide-hereafter should be more then 30042462, like 31000000
the official documentation about withdraw rewards:
https://docs.cardano.org/projects/cardano-node/en/latest/stake-pool-operations/withdraw-rewards.html

Transaction successfully submitted.
thanks!

1 Like