Hello. Guys.
I am a SPO and I have never claim rewards yet.
Anyone can kindly teach me how to claim stake pool rewards?
destinationAddress=$(cat payment.addr)
echo destinationAddress: $destinationAddress
Hello. Guys.
I am a SPO and I have never claim rewards yet.
Anyone can kindly teach me how to claim stake pool rewards?
destinationAddress=$(cat payment.addr)
echo destinationAddress: $destinationAddress
Hi,
cntools or coincashew?
Cheers,
coincashew . thanks.
destinationAddress=$(cat payment.addr)
echo destinationAddress: $destinationAddress
Where my private address (receive, for example, Nami) should be written?
When u registered the pool u also registered a wallet for rewards… the wallet has 1 stake address (for rewards) and payment address (amount which can be spent)
Now u must move the rewards from stake address to payment address
PS: if the wallet was imported via mnemonic u can withdraw the rewards from wallet app
It seems the Coincashew script is not 100% correct in terms of destinationAddress
being the address which is where you're moving your reward to
, as throughout the script they are using the payment.addr
.
You need to check that in more detail and update commands where required. Let us know if you are not sure what to do.
Assuming your stake pool’s ticker is MEOW, you don’t have any rewards to withdraw. There are 2 reasons:
For the moment when you will want to withdraw the rewards, you will need to do the following steps:
STAKE_ADDRESS=stake1uxmzszyq0amup32al34yqnkhrrv27mq5mkghgp7kjuchytgnsep6p
ADDRESS=addr1q9qjtu9ntz7esnr5c4seqks835avnd97z2853ljzyfssvl9k9qygqlmhcrz4mlr2gp8dwxxc4akpfhv3wsrad9e3wgksyd7ezx
cardano-cli query stake-address-info --mainnet --address $STAKE_ADDRESS
[
{
"delegation": "pool1llwfa6erdh7k87j06y2z9999jcc84cnezwhg9e2sulrgwzrsug4",
"address": "stake1uxmzszyq0amup32al34yqnkhrrv27mq5mkghgp7kjuchytgnsep6p",
"rewardAccountBalance": 0
}
]
REWARDS_AMOUNT=0
Assuming the “rewardAccountBalance”: is 340000000 (the fixed fee), you would write:
REWARDS_AMOUNT=340000000
cardano-cli query utxo --mainnet --address ${ADDRESS}
TxHash TxIx Amount
--------------------------------------------------------------------------------------
1b979f12835310a58c1150e134c7863d9dafce58255d7f2e7ba5bd1dd2cdf894 0 4613866 lovelace + TxOutDatumNone
You will be able to use the UTxO above, which has the index 0. You define the following variable:
TXIN="1b979f12835310a58c1150e134c7863d9dafce58255d7f2e7ba5bd1dd2cdf894#0"
stake.skey
, your payment signing key is payment.skey
, and they are both in the current folder.cardano-cli transaction build \
--mainnet \
--alonzo-era \
--witness-override 2 \
--tx-in ${TXIN} \
--withdrawal "${STAKE_ADDRESS}+${REWARDS_AMOUNT}" \
--change-address ${ADDRESS} \
--out-file tx.raw
Running this will display the transaction fees:
Estimated transaction fee: Lovelace 171265
In case you want to send the rewards to a different address and the change back to the original address, you can do change the transaction like this:
DSTADDRESS=adddr1........
(this is where you will send the rewards).
cardano-cli transaction build \
--mainnet \
--alonzo-era \
--witness-override 2 \
--tx-in ${TXIN} \
--withdrawal "${STAKE_ADDRESS}+${REWARDS_AMOUNT}" \
--tx-out "${DST_ADDRESS}+${REWARDS_AMOUNT}" \
--change-address ${ADDRESS} \
--out-file tx.raw
You can also send a different amount to the new address, not exactly the rewards amount, and in this case you will need to write a different amount in the line:
--tx-out "${DST_ADDRESS}+${REWARDS_AMOUNT}" \
cardano-cli transaction sign \
--tx-body-file tx.raw \
--signing-key-file stake.skey \
--signing-key-file payment.skey \
--mainnet \
--out-file tx.signed
cardano-cli transaction submit \
--tx-file tx.signed \
--mainnet
Before signing and submitting the transaction, you can also check it to be sure it is 100% ok.
cardano-cli transaction view --tx-body-file tx.raw
The result will be:
auxiliary scripts: null
certificates: null
collateral inputs: []
era: Alonzo
fee: 171265 Lovelace
inputs:
- 1b979f12835310a58c1150e134c7863d9dafce58255d7f2e7ba5bd1dd2cdf894#0
metadata: null
mint: null
outputs:
- address: addr1q9qjtu9ntz7esnr5c4seqks835avnd97z2853ljzyfssvl9k9qygqlmhcrz4mlr2gp8dwxxc4akpfhv3wsrad9e3wgksyd7ezx
address era: Shelley
amount:
lovelace: 4442601
datum: null
network: Mainnet
payment credential:
key hash: 4125f0b358bd984c74c561905a078d3ac9b4be128f48fe422261067c
stake reference:
key hash: b62808807f77c0c55dfc6a404ed718d8af6c14dd917407d69731722d
update proposal: null
validity range:
lower bound: null
upper bound: null
withdrawals:
- address: stake1uxmzszyq0amup32al34yqnkhrrv27mq5mkghgp7kjuchytgnsep6p
amount: 0 Lovelace
credential:
key hash: b62808807f77c0c55dfc6a404ed718d8af6c14dd917407d69731722d
network: Mainnet
If you are happy with the output, sign it and submit it.
I hope this will also help other people to create a simple transaction for withdrawing the rewards.