3

How to get the fee of a transaction using the daemon RPC for non ring-ct transactions ?

For RingCT transactions, I can get the fee using the method /gettransactions and the field txnFee in the response, but there is no such field when version == 1. Example:

curl -X POST http://127.0.0.1:18081/gettransactions \
-d '{"txs_hashes" : ["5dcaf643eff22b7246d9707c99b974893b35eded63f1841442a88a0e951c6c1c"], "decode_as_json": true}' \
-H 'Content-Type: application/json'
3

The fee is the sum of inputs minus the sum of outputs. For ringct transactions, those are unknown, so the fee is stored separately, and added to the commitment check when verifying the transaction to ensure the fee is what was really used.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.