Bitcoin Forum

Bitcoin => Bitcoin Technical Support => Topic started by: dannon on February 08, 2017, 11:58:24 AM



Title: Cheapest way to sweep bitcoins
Post by: dannon on February 08, 2017, 11:58:24 AM
Hi!

My goal is reduce total transaction fees. I have many inputs transactions and few outputs. Is it cheaper to send individual transactions for all the inputs or make 1 big transaction for everything.

I want only those who know Bitcoin protocol to respond. I know fee is based on KB size of transaction data. Is there overhead kb in every transaction?

Example:

Inputs
A, B, C, D
Outputs
A + B -> E
C + D -> F

Is one big transaction cheaper?
A + B + C + D -> E + F

Two transaction same price as 1 transaction?
A + B -> E
C + D -> F

4 transaction same price as 1 transaction?
A -> E
B -> E
C -> F
D -> F

Thank you


Title: Re: Cheapest way to sweep bitcoins
Post by: DannyHamilton on February 08, 2017, 12:23:21 PM
- snip -
Is there overhead kb in every transaction?
- snip -

There is overhead, but it is bytes, not kilobytes. (of course if you create enough transactions those bytes will add up to kilobytes eventually).

Every transaction has 10 bytes of overhead.
Every output will require another 34 bytes. Since you are consolidating, I assume each transaction will have only 1 output?

Combined, that's 44 bytes per transaction.

Then every input will require between 147 and 149 bytes.

You may find that it is cheaper to just use the inputs in transactions without consolidating them.  You are going to have to pay for that overhead when you spend the bitcoins. Why pay it twice? (Once when you consolidate, and again when you spend.) It will only be beneficial if you can pay a significantly lower fee per byte during consolidation, so that you'll have less bytes to pay for later when the fee per byte is higher.


Title: Re: Cheapest way to sweep bitcoins
Post by: dannon on February 09, 2017, 11:38:41 AM
Okay thanks. That makes sense.


Title: Re: Cheapest way to sweep bitcoins
Post by: jackg on February 09, 2017, 11:38:36 PM
Danny was accurate.
However, if there is an input function, then it can be read here (https://99bitcoins.com/know-more-private-key-import-vs-sweep-difference/) that you can impor tthe private keys directly to your wallet and therefore just ge tthe addreses associated with those keys loaded into your wallet rather than getting those bitcoins sent to an address in your wallet (thus meaning no transaction is broadcast so no fee is paid). Check beforehand that this definitely works for your wallet and the "import" function on your wallet doesn't mean "sweep" instead (if you're using something like bitcoin core or electrum then it should be able to import the addresses by default from the private keys so they can be added to your account).


Title: Re: Cheapest way to sweep bitcoins
Post by: DannyHamilton on February 10, 2017, 01:01:06 AM
- snip -
you can import the private keys directly to your wallet and therefore just get the addresses associated with those keys loaded into your wallet rather than getting those bitcoins sent to an address in your wallet (thus meaning no transaction is broadcast so no fee is paid).
- snip -

If you do this, then the entity (person, business, service) that gives you the private key can take back the bitcoins any time they want until you send them somewhere in a transaction (and pay the transaction fee).  Additionally, if you ever have any other bitcoins sent to that same address, that entity can steal all of those bitcoins as well.


Title: Re: Cheapest way to sweep bitcoins
Post by: thebatletbet on February 10, 2017, 09:08:14 PM
sweep bitcoins fee is same sending fee
so if you want reduce fee in sending with the way sweep bitcoin you can't reduce
but youre fee can incraese, because charge sweep bitcoin fee


Title: Re: Cheapest way to sweep bitcoins
Post by: jackg on February 10, 2017, 11:04:28 PM
- snip -
you can import the private keys directly to your wallet and therefore just get the addresses associated with those keys loaded into your wallet rather than getting those bitcoins sent to an address in your wallet (thus meaning no transaction is broadcast so no fee is paid).
- snip -

If you do this, then the entity (person, business, service) that gives you the private key can take back the bitcoins any time they want until you send them somewhere in a transaction (and pay the transaction fee).  Additionally, if you ever have any other bitcoins sent to that same address, that entity can steal all of those bitcoins as well.

Yes, but they'd also be able to gain access to the input and output scripts you were suggesting and could manipulate that couldn't they?
Guarenteed, the safest way to store these coins is just to sweep them directly into your wallet. But, that requires a fee and if you're just making cold storage and printing out the paper wallet by yourself then it would be fairly safe to use the mechanism of importing private keys.