I'm currently working on a project (I'm a beginner in the world of cryptocurrencies) where we are using Raw Transactions, I want to know if in raw transactions there's a flag similar to subtractFeeFromAmount flag that exists in the sendToAddress method.

1 Answer 1


When you create a raw transaction, you must specify all inputs and outputs, and any leftover will go towards the fee (to the miner). The raw transaction does not do any fee calculation.

Example Transaction:

input1: .1BTC
input2: .2BTC

output1: .299BTC

The resulting fee would be:

fee: .001BTC

This amount gets added to the coinbase transaction (by the miner) of the block which includes this transaction.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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