Author

Topic: Miners fee, coin age and customers withdrawals (Read 915 times)

legendary
Activity: 1008
Merit: 1007
September 13, 2013, 09:56:37 AM
#6
A flat rate, if high enough, should cover the fee on long term.

If you really want to tell the user the exact fee before transaction, you should do it this way:

1. User tells you the amount he wants to withdraw
2. You search your UTXO set, find suitable UTXOs, calculate the fee and you tell the user
3. You lock the chosen UTXOs for a few minutes (not to be used in other tx)
4. If the user accepts the fee, you will proceed

I think the former seems like the way to go - aim for something which covers fees on average.
legendary
Activity: 1792
Merit: 1122
September 13, 2013, 08:53:10 AM
#5
You can charge them a flat fee, say 0.0005BTC

But who's to say that will actually be enough to cover the miners fee? What about handling of this problem for alt-coin clients as well?

Is there no way to query what the client will generate as the miners fee in advance?

A flat rate, if high enough, should cover the fee on long term.

If you really want to tell the user the exact fee before transaction, you should do it this way:

1. User tells you the amount he wants to withdraw
2. You search your UTXO set, find suitable UTXOs, calculate the fee and you tell the user
3. You lock the chosen UTXOs for a few minutes (not to be used in other tx)
4. If the user accepts the fee, you will proceed
legendary
Activity: 3528
Merit: 4945
September 13, 2013, 08:19:13 AM
#4
You can generate raw transactions.

In that case you can make sure that you only use the oldest unspent outputs under your control (or the ones that contribute the most priority to the transaction).  You can calculate the priority and transaction size to make sure that a miner's fee isn't necessary, and you can toss in a 0.0001 BTC fee just to encourage fast confirmation.
legendary
Activity: 1008
Merit: 1007
September 13, 2013, 07:05:40 AM
#3
You can charge them a flat fee, say 0.0005BTC

But who's to say that will actually be enough to cover the miners fee? What about handling of this problem for alt-coin clients as well?

Is there no way to query what the client will generate as the miners fee in advance?
legendary
Activity: 1792
Merit: 1122
September 13, 2013, 06:32:37 AM
#2
You can charge them a flat fee, say 0.0005BTC
legendary
Activity: 1008
Merit: 1007
September 13, 2013, 05:26:51 AM
#1
Hi guys,

If you're running a service, like an exchange, which allows customers to deposit and withdraw coins, how do you handle miners fees for coins which are too young?

If you are using a hot-wallet + cold-storage solution, you can't use the accounts feature (sendfrom) because the coins may well be in cold storage, so the account total will be wrong.

Given this fact, (and using sendtoaddress instead) it could very well be possible that a customer doesn't actually have enough total funds to cover the withdrawal AND the miners fee, which would leave the exchange out of pocket. As far as I can work out, there is no way to determine what the miners fee will be in advance?

What's the best way to handle this?

Cheers, Paul.
Jump to: