<p>I'm building a merchant system for a client that will accept payments in bitcoin and send all coins to a cold storage wallet once a week (or month). The system is using a deterministic wallet to create one wallet for each client and it is very unlikely that one "receiving" wallet will have more than 2 inputs.</p>

<p>This system will run on a vps and the client does not want a bitcoin client running so I will create and relay all transactions through <a href="http://btc.blockr.io/documentation/api" rel="nofollow noreferrer">Push TX at blockr.io</a></p>

<p>This should work fine, but I'm having some problems with the size of the transaction and the transaction fee.</p>

<ol>
<li><p>According to <a href="https://bitcoin.stackexchange.com/a/7691">this answer</a> if the value I'm trying to send is bigger than 1BTC I don't need a fee</p>

<blockquote>
  <ol>
  <li>A fee may not be required at all, if the priority of the transaction is high enough. Generally 1 BTC, one day old, is enough age and balance that you can send without a fee.</li>
  <li>If any of the individual payments are below 0.01 BTC, a minimum fee will always be required.</li>
  <li>The minimum fee, when required, is 0.0005 BTC per 1000 bytes of total transaction.</li>
  <li>The contribution of each input and each output to the total size is somewhat consistent, it only varies largely if there are compressed keys (standard for newly generated addresses on a recent client version)</li>
  </ol>
</blockquote></li>
<li><p>According to <a href="https://bitcoin.stackexchange.com/a/1824">this answer</a> the value will increase a lot based on the size of transaction</p>

<blockquote>
  <p>0.01 BTC fee per kilobyte of transaction, but: If the blocksize (size of all transactions currently waiting to be included in a block) is less than 27 kB, transactions are free. If the blocksize is more than 250 kB, transactions get increasingly more expensive as the blocksize approaches the limit of 500 kB. Sending a transaction when the blocksize is 400 kB will cost 5 times the normal amount; sending when it's 499 kB will cost 500x, etc.</p>
</blockquote></li>
<li><p>According to <a href="https://bitcoinfees.21.co/" rel="nofollow noreferrer">bitcoinfees.21.co</a> I should use their api to get the best transaction fee dynamically</p>

<pre><code>{ "fastestFee": 40, "halfHourFee": 20, "hourFee": 10 }
</code></pre></li>
</ol>

<p>So my questions here are:</p>

<ol>
<li>What is the best way to calculate the transaction fee? Given that I will be doing calculations by hand (<a href="http://www.dendeer.com/post/bitcoin/" rel="nofollow noreferrer">script</a>) and not using a bitcoin client</li>
<li>What is the maximum number of inputs that can I send on a transaction?</li>
<li>What can I do if the transaction gets stuck because of small transaction fee?</li>
</ol>

CC BY-SA 3.0
2017-05-27T17:23:57.340Z
1 and 2 are from very old answers which do not apply in the current market.  You will have to look at the real-time "going rate" for transactions as suggested in 3.
Nate Eldredge
CC BY-SA 3.0
2017-05-27T17:25:28.067Z
Also, you're asking three different questions at the end; Stack Exchange works best when you ask one question per post.  But the other two have already been asked and answered: see [maximum inputs/outputs](https://bitcoin.stackexchange.com/questions/35570/what-is-the-maximum-number-of-inputs-outputs-a-transaction-can-have?rq=1) and [unconfirmed transactions](https://bitcoin.stackexchange.com/questions/9046/why-is-my-transaction-not-getting-confirmed-and-what-can-i-do-about-it).
Nate Eldredge
CC BY-SA 3.0
2017-05-29T10:03:36.703Z
Number 2 just to see if you are interpreting it correctly, means if all pending transactions combined is less than 27kb then there are no fees. So it would be during least active times of day if at all.
marshal craft
<transaction-fees><raw-transaction>
transacton fees for raw transactions
Nicos Karalis
# transacton fees for raw transactions

(Asked by: username_0 on 2017-05-27)

I'm building a merchant system for a client that will accept payments in bitcoin and send all coins to a cold storage wallet once a week (or month). The system is using a deterministic wallet to create one wallet for each client and it is very unlikely that one "receiving" wallet will have more than 2 inputs.

This system will run on a vps and the client does not want a bitcoin client running so I will create and relay all transactions through [Push TX at blockr.io](http://btc.blockr.io/documentation/api)

This should work fine, but I'm having some problems with the size of the transaction and the transaction fee.

1. According to [this answer](https://bitcoin.stackexchange.com/a/7691) if the value I'm trying to send is bigger than 1BTC I don't need a fee

   > 1. A fee may not be required at all, if the priority of the transaction is high enough. Generally 1 BTC, one day old, is enough age and balance that you can send without a fee.
   > 2. If any of the individual payments are below 0.01 BTC, a minimum fee will always be required.
   > 3. The minimum fee, when required, is 0.0005 BTC per 1000 bytes of total transaction.
   > 4. The contribution of each input and each output to the total size is somewhat consistent, it only varies largely if there are compressed keys (standard for newly generated addresses on a recent client version)
2. According to [this answer](https://bitcoin.stackexchange.com/a/1824) the value will increase a lot based on the size of transaction

   > 0.01 BTC fee per kilobyte of transaction, but: If the blocksize (size of all transactions currently waiting to be included in a block) is less than 27 kB, transactions are free. If the blocksize is more than 250 kB, transactions get increasingly more expensive as the blocksize approaches the limit of 500 kB. Sending a transaction when the blocksize is 400 kB will cost 5 times the normal amount; sending when it's 499 kB will cost 500x, etc.
3. According to [bitcoinfees.21.co](https://bitcoinfees.21.co/) I should use their api to get the best transaction fee dynamically

   ```
   { "fastestFee": 40, "halfHourFee": 20, "hourFee": 10 }

   ```

So my questions here are:

1. What is the best way to calculate the transaction fee? Given that I will be doing calculations by hand ([script](http://www.dendeer.com/post/bitcoin/)) and not using a bitcoin client
2. What is the maximum number of inputs that can I send on a transaction?
3. What can I do if the transaction gets stuck because of small transaction fee?

**Tags:** transaction-fees, raw-transaction

> **Comments:**
> **username_1**: 1 and 2 are from very old answers which do not apply in the current market.  You will have to look at the real-time "going rate" for transactions as suggested in 3.  
> **username_1**: Also, you're asking three different questions at the end; Stack Exchange works best when you ask one question per post.  But the other two have already been asked and answered: see [maximum inputs/outputs](https://bitcoin.stackexchange.com/questions/35570/what-is-the-maximum-number-of-inputs-outputs-a-transaction-can-have?rq=1) and [unconfirmed transactions](https://bitcoin.stackexchange.com/questions/9046/why-is-my-transaction-not-getting-confirmed-and-what-can-i-do-about-it).  
> **username_2**: Number 2 just to see if you are interpreting it correctly, means if all pending transactions combined is less than 27kb then there are no fees. So it would be during least active times of day if at all.  

---

## 0 answers

