I am working on an automated system that on one side accepts payments in BTC, and on the other side, sends payments in BTC out. The incoming and outgoing amounts would rather be small (from 0.001 BTC up to 0.1 BTC). I have successfully implemented RPC shaking with BTC client, but I have few questions about fees;
1. I would like to start my service completely out of my own fees. Is this even possible, since the sending of BTC I perform requires fees to be paid for BTC network. The ridicolous scenario is when I receive 0.001 BTC and I should forward 0.001 BTC. Fee for such amount is usually 0.0001 BTC. So, that is effectively massive 10%!!!
Yes, the main client software that generally has such fee requirements hasn't been updated in a while to keep in touch with the BTC/fiat exchange rate (which would predict how small payments are reasonable for common use). Thus indeed you can have quite high fees. For a cup of tea/coffee/beer you could end up with 3-6% network transaction fee.
You can send your payment without any fee, just much smaller percentage of miners will accept it into their block, so you'll have to wait longer to be confirmed.
2. Can I call certain API to determine what would be the fee of outgoing transaction, so I can deduct this fee from the outgoing amount?
There's a general algorithm, of how to have a good estimate of the required fees:
http://bitcoinfees.com/ The size of the transaction in bytes is "148 * number_of_inputs + 34 * number_of_outputs + 10", and every 1000 bytes have 0.00001 BTC fee normally.
3. I was previously using blockchain.info API (
https://blockchain.info/api/api_receive). I have noticed that they do forward payments and ALL payments were going on with 0 fee. So, if they do it, could I do it somehow too?
They also say: Receiving transactions is completely free,
any network fees will be paid by us.