Bitcoin Forum
May 24, 2024, 06:17:23 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: BTC fees in automated system  (Read 1018 times)
djeZo (OP)
Hero Member
*****
Offline Offline

Activity: 588
Merit: 520


View Profile
January 21, 2014, 09:12:18 PM
 #1

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%!!!

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?

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?

empoweoqwj
Hero Member
*****
Offline Offline

Activity: 518
Merit: 500


View Profile
January 22, 2014, 04:12:57 AM
 #2

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%!!!

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?

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?

Yes you can send payments  without fees. Just don't rely on them all turning up on time Smiley
imrehg
Newbie
*
Offline Offline

Activity: 23
Merit: 0


View Profile WWW
January 22, 2014, 09:19:10 AM
 #3

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.

Quote
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.

Quote
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.
coinrevo
Member
**
Offline Offline

Activity: 70
Merit: 10


View Profile
January 22, 2014, 11:10:59 AM
 #4

Yeah, fees are now too high. I don't think there is a way around this. You have to look at the historic tables and estimate probability of : fees -> time to verify. 0 fees don't go through anymore AFAIK, on most pools. luke-jr mentioned something about that his pool relays them, perhaps blockchain uses his pool only for this.

For microtransactions currently the solution would be to use a different alt-coin or look at the microtransaction channel stuff.
djeZo (OP)
Hero Member
*****
Offline Offline

Activity: 588
Merit: 520


View Profile
January 22, 2014, 11:19:59 AM
 #5

Thank you for your answers.

Now the only thing I need to figure out is - how can I calculate network fee, before I call sendfrom ?

OnkelPaul
Legendary
*
Offline Offline

Activity: 1039
Merit: 1004



View Profile
January 22, 2014, 11:28:39 AM
 #6

One other thing that you should consider is to batch multiple payments into one transaction. Since the number of inputs won't grow in most cases, each additional output only incurs a cost for 34 bytes, which means you can often just slip it in without adding to the fee at all.
However, that approach would mean additional payout delays. Whether this is a problem depends entirely on your application and the response time expected by users.

Onkel Paul

djeZo (OP)
Hero Member
*****
Offline Offline

Activity: 588
Merit: 520


View Profile
January 22, 2014, 11:38:24 AM
 #7

There are not going to be many payments, maybe one each few hours. I will settle with fixed 0.0001 network fee for now until I get to know what method to use to calculate network fee (it could really API for that...  Roll Eyes or another sendfrom RPC command that subtracts fee from sending amount).

Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!