Bitcoin Forum

Bitcoin => Bitcoin Discussion => Topic started by: DrSeuss on January 19, 2017, 07:24:40 PM



Title: 4.50$ Fee for 0.09$ Transaction..?!
Post by: DrSeuss on January 19, 2017, 07:24:40 PM
What's up!  :)

I'm currently coding Bitcoin Transaction into my website via Bitcoinjs-lib.
A few minutes ago I made my first transaction but I seem to have messed it up  ;D
https://blockchain.info/tx/86191760fe7aefb2bbaa54742bb72c2ee256a5a62b1a92518b1a08f424156116

Can anyone maybe explain me why I encounter such a high miners fee?  ::)

Thanks  :D


Title: Re: 4.50$ Fee for 0.09$ Transaction..?!
Post by: franky1 on January 19, 2017, 07:28:56 PM
if you have    0.005
wanna spend 0.0001

you have to also tell the transaction where the other 0.0049 should go, otherwise the 0.0049 is treated as the fee
eg your
1GZF75yBKtDgwCyA5pavM2Xs1tkEwVCbjz (0.005 BTC - Output) ->   1G4o1ZAfCcZ812RYpXwKR9tv4mUUMR8pDE - (Unspent) 0.0001 BTC
fee=0.0049

should be
1GZF75yBKtDgwCyA5pavM2Xs1tkEwVCbjz (0.005 BTC - Output) ->   1G4o1ZAfCcZ812RYpXwKR9tv4mUUMR8pDE - (Unspent) 0.0001 BTC
                                                                                      ->   1GZF75yBKtDgwCyA5pavM2Xs1tkEwVCbjz   - (Unspent) 0.0049 BTC
fee=0

you then lower how much you want to get returned to you to establish the fee as the missing amount your not accounting for

such as
1GZF75yBKtDgwCyA5pavM2Xs1tkEwVCbjz (0.005 BTC - Output) ->   1G4o1ZAfCcZ812RYpXwKR9tv4mUUMR8pDE - (Unspent) 0.0001 BTC
                                                                                      ->   1GZF75yBKtDgwCyA5pavM2Xs1tkEwVCbjz   - (Unspent) 0.0048 BTC

fee=0.0001

your mistake is not adding a second destination to get your change back


Title: Re: 4.50$ Fee for 0.09$ Transaction..?!
Post by: RawDog on January 19, 2017, 07:31:39 PM
if you have    0.005
wanna spend 0.0001

you have to also tell the transaction where the other 0.0049 should go, otherwise the 0.0049 is treated as the fee
Write as many outputs as you like, but when they all add up, they should add up to an amount slightly less than the inputs.  The difference is the fee and goes to the miners.  So, send yourself an output too!  :)


Title: Re: 4.50$ Fee for 0.09$ Transaction..?!
Post by: DrSeuss on January 19, 2017, 07:33:09 PM
But how can I make smaller transactions then?
As stated in the demo source further to the bottom here :
https://bitcoinjs.org/

I need to enter an unspent transaction output, but who says I got a transaction as high as I want to transfer for myself now? lol
Something is wrong in my mind.  ::)


Title: Re: 4.50$ Fee for 0.09$ Transaction..?!
Post by: franky1 on January 19, 2017, 07:38:08 PM
But how can I make smaller transactions then?
As stated in the demo source further to the bottom here :
https://bitcoinjs.org/

I need to enter an unspent transaction output, but who says I got a transaction as high as I want to transfer for myself now? lol
Something is wrong in my mind.  ::)

if you have an unspent output of 0.005 (you did have but not anymore, this is a lesson in hindsight)
you set that 0.005 output as your new input for new tx

you set 0.0001 to the intended destination as one output
you send 0.0049 to an address you own as another output

thus you get the remainder back.

then by doing this. you can then spend the 0.0049 output funds by making a new tx where
if you have an unspent output of 0.0049 (you dont, this is a lesson in hindsight)
you set that 0.005 output as your new input for new tx

you set 0.0001 to the intended destination as one output
you send 0.0048 to an address you own as another output

thus you get the remainder back.

and so on..
only problem is you dont have the 0.0049 anymore. thats gone to the mining pool as fee


Title: Re: 4.50$ Fee for 0.09$ Transaction..?!
Post by: DrSeuss on January 19, 2017, 07:49:30 PM
I wanted to start another test but now I don't have any "unspent transaction" left over.
Only little 0.09$ Transactions but the fee is already higher.
Is there no way for me to send money now?  ???


Title: Re: 4.50$ Fee for 0.09$ Transaction..?!
Post by: RawDog on January 19, 2017, 08:01:39 PM
I wanted to start another test but now I don't have any "unspent transaction" left over.
Only little 0.09$ Transactions but the fee is already higher.
Is there no way for me to send money now?  ???
Sorry - you are out of money now.  Get some more.  :)  However, you should be very happy your lesson on change addresses only cost you .0049.  I can tell you I suffered more than 10 times as much damage learning about change address and I consider myself lucky in view of the mistakes others have made!!!  BIG time losses have occurred here.  You are the big winner if your lesson only cost .0049.


Title: Re: 4.50$ Fee for 0.09$ Transaction..?!
Post by: Velkro on January 19, 2017, 08:04:13 PM
if you have    0.005
wanna spend 0.0001

you have to also tell the transaction where the other 0.0049 should go, otherwise the 0.0049 is treated as the fee
eg your
1GZF75yBKtDgwCyA5pavM2Xs1tkEwVCbjz (0.005 BTC - Output) ->   1G4o1ZAfCcZ812RYpXwKR9tv4mUUMR8pDE - (Unspent) 0.0001 BTC
fee=0.0049

should be
1GZF75yBKtDgwCyA5pavM2Xs1tkEwVCbjz (0.005 BTC - Output) ->   1G4o1ZAfCcZ812RYpXwKR9tv4mUUMR8pDE - (Unspent) 0.0001 BTC
                                                                                      ->   1GZF75yBKtDgwCyA5pavM2Xs1tkEwVCbjz   - (Unspent) 0.0049 BTC
fee=0

you then lower how much you want to get returned to you to establish the fee as the missing amount your not accounting for

such as
1GZF75yBKtDgwCyA5pavM2Xs1tkEwVCbjz (0.005 BTC - Output) ->   1G4o1ZAfCcZ812RYpXwKR9tv4mUUMR8pDE - (Unspent) 0.0001 BTC
                                                                                      ->   1GZF75yBKtDgwCyA5pavM2Xs1tkEwVCbjz   - (Unspent) 0.0048 BTC

fee=0.0001

your mistake is not adding a second destination to get your change back
That is quite complicated, author could use some examples of code that do that.
Anyway bitcoin can be quite tricky beast when dealing at first.
Hope u will correct your code, gl man.


Title: Re: 4.50$ Fee for 0.09$ Transaction..?!
Post by: DrSeuss on January 19, 2017, 08:20:51 PM
I wanted to start another test but now I don't have any "unspent transaction" left over.
Only little 0.09$ Transactions but the fee is already higher.
Is there no way for me to send money now?  ???
Sorry - you are out of money now.  Get some more.  :)  However, you should be very happy your lesson on change addresses only cost you .0049.  I can tell you I suffered more than 10 times as much damage learning about change address and I consider myself lucky in view of the mistakes others have made!!!  BIG time losses have occurred here.  You are the big winner if your lesson only cost .0049.

But I still do have like 2$ on my Wallet  :o
I just need an unspent transaction output but I can't find one in my history, what should I do? :x
There must be a way or not? D:


Title: Re: 4.50$ Fee for 0.09$ Transaction..?!
Post by: franky1 on January 19, 2017, 08:32:59 PM
I wanted to start another test but now I don't have any "unspent transaction" left over.
Only little 0.09$ Transactions but the fee is already higher.
Is there no way for me to send money now?  ???
Sorry - you are out of money now.  Get some more.  :)  However, you should be very happy your lesson on change addresses only cost you .0049.  I can tell you I suffered more than 10 times as much damage learning about change address and I consider myself lucky in view of the mistakes others have made!!!  BIG time losses have occurred here.  You are the big winner if your lesson only cost .0049.

But I still do have like 2$ on my Wallet  :o
I just need an unspent transaction output but I can't find one in my history, what should I do? :x
There must be a way or not? D:

you spent the 0.005 from this
81bb5df4040f98793875591dcc9f93755b94425b9d1a6cc4c86871b246cc9185 (https://blockchain.info/tx/81bb5df4040f98793875591dcc9f93755b94425b9d1a6cc4c86871b246cc9185)

but you still have 0.00202562 - about $1.75 in this one
68a8fd9710594334cf960402fdca66dea88affa61d70baca1cff04230f7d3fe6 (http://68a8fd9710594334cf960402fdca66dea88affa61d70baca1cff04230f7d3fe6)

just be sure when you use the unspent output 68a8 blah blah blah as a new input.. you set 2 output. one to the destination and one back to yourself.


Title: Re: 4.50$ Fee for 0.09$ Transaction..?!
Post by: DrSeuss on January 19, 2017, 08:35:31 PM
I see, I guess I can have multiple inputs as well then?
But then the fee might increase due to a higher transaction size, am I right?  :)

Could there be any way to calculate how high the fees will be? So I don't have to guess?


Title: Re: 4.50$ Fee for 0.09$ Transaction..?!
Post by: franky1 on January 19, 2017, 08:45:32 PM
I see, I guess I can have multiple inputs as well then?
But then the fee might increase due to a higher transaction size, am I right?  :)

you can have multiple inputs. and multiple outputs.

easy guide calculation for approximate tx byte size

(148*in)+(34*out)=
this is an estimator as the answer can be +-10 different

eg
1 input if you only want to spend the $1.75(0.00202562)
2 output to go to one destination and the rest back to you

(148*1)+(34*2)=216
it actually results in 226byte when you actually build the tx


for instance if a 226byt tx costs 14cents
there is no point adding the other unspents (listed below) because
(148*2)+(34*2)= ~364byte = ~$0.23 tx fee
so why add in the 9cent unspent to just be eaten up in the extra fee by adding it.



you also have
0.00003 ($0.03) unspent a76f50b8ab76d2a0880be73306753423cc0cbea9a3aca20f13dfc51bdf3d4954 (https://blockchain.info/tx/a76f50b8ab76d2a0880be73306753423cc0cbea9a3aca20f13dfc51bdf3d4954)
0.0001 ($0.09) unspent 5b9044c61a5c3d68f5bef7b67093e4109264e4aba836204669da42d5caeb12a1 (https://blockchain.info/tx/5b9044c61a5c3d68f5bef7b67093e4109264e4aba836204669da42d5caeb12a1)



lastly remember when you spend X to the destination you want. calculate whats left. then work out a fee you want to pay. take that from whats left and then put the remainder back to yourself



Title: Re: 4.50$ Fee for 0.09$ Transaction..?!
Post by: DrSeuss on January 19, 2017, 08:52:40 PM
Is there some sort of fix price for X byte?  :D
Thank you very much, you helped me alot!
Are you actually familiar with bitcoinjs-lib?
Because I'm wondering how I could actually automate transaction on a website if I have to know what transaction ID's are unspent.
This Unspent Transaction stuff is a hurdle I didn't expect.  ;D


Title: Re: 4.50$ Fee for 0.09$ Transaction..?!
Post by: Decoded on January 19, 2017, 08:59:38 PM
Is there some sort of fix price for X byte?  :D
Thank you very much, you helped me alot!
Are you actually familiar with bitcoinjs-lib?
Because I'm wondering how I could actually automate transaction on a website if I have to know what transaction ID's are unspent.
This Unspent Transaction stuff is a hurdle I didn't expect.  ;D

I'm not totally sure with bitcoinjs-lib, but most Bitcoin libraries are kin in functionality. You should be able to simply pass a simple command to retrieve all transactions received to an address, and probably within that same command trim it down to 1 confirmation or more.


Title: Re: 4.50$ Fee for 0.09$ Transaction..?!
Post by: franky1 on January 19, 2017, 09:00:45 PM
Is there some sort of fix price for X byte?  :D

not fixed. it varies depending on demand.(its a bidding war concept.. like an auction)
https://bitcoinfees.21.co/  helps find a good estimate.

the green line tells you the biggest chance of getting into the next block. at the moment it is 70sats a byte
which if you are just doing a 1in 2out is ~15820sats fee

some people get lazy and just put a fixed amount of say 80sats a byte knowing it wil most of the time outbid everyone to get in the next block.. only problem is if everyone done that. you then have to increase it.. (its a bidding war concept)


Title: Re: 4.50$ Fee for 0.09$ Transaction..?!
Post by: franky1 on January 19, 2017, 09:12:02 PM
so now what you should be doing is

we know you have 0.00202562 from 68a8fd9710594334cf960402fdca66dea88affa61d70baca1cff04230f7d3fe6
say you wanted to spend 0.0001 to someone else
leaves you 0.00192562
take off the tx fee 0.00015820
leaves you 0.00176742

so the example would be:
in
using 68a8fd9710594334cf960402fdca66dea88affa61d70baca1cff04230f7d3fe6  -  0.00202562 unspent

out
destination - 0.001
address you own - 0.00176742

knowing the missing 0.00015820 is the fee


Title: Re: 4.50$ Fee for 0.09$ Transaction..?!
Post by: cengsuwuei on January 19, 2017, 11:14:28 PM
if sendi 4.5 dollar and fee 0.09 dollar is still standard sending fee

but i visit youre tx id transaction
you sending 0.005 bitcoin and fee can get 0.0049 bitcoin is very big sending fee
maybe you must setting , sending fee, because very big fee and not normal fee


Title: Re: 4.50$ Fee for 0.09$ Transaction..?!
Post by: Yakamoto on January 19, 2017, 11:45:55 PM
What's up!  :)

I'm currently coding Bitcoin Transaction into my website via Bitcoinjs-lib.
A few minutes ago I made my first transaction but I seem to have messed it up  ;D
https://blockchain.info/tx/86191760fe7aefb2bbaa54742bb72c2ee256a5a62b1a92518b1a08f424156116

Can anyone maybe explain me why I encounter such a high miners fee?  ::)

Thanks  :D
You probably ended up mixing the fee portion of the transaction add the trans-actable amount up, that's something a fair amount of people make and sadly isn't as rare as you might think it would be.

I wouldn't worry about it, you should be glad that this only cost you $5. That's something that's pretty easy to earn back and you can earn some of that quite easily.


Title: Re: 4.50$ Fee for 0.09$ Transaction..?!
Post by: MachineZero on January 19, 2017, 11:46:39 PM
I wanted to start another test but now I don't have any "unspent transaction" left over.
Only little 0.09$ Transactions but the fee is already higher.
Is there no way for me to send money now?  ???
Sorry - you are out of money now.  Get some more.  :)  However, you should be very happy your lesson on change addresses only cost you .0049.  I can tell you I suffered more than 10 times as much damage learning about change address and I consider myself lucky in view of the mistakes others have made!!!  BIG time losses have occurred here.  You are the big winner if your lesson only cost .0049.

Very cheap schooling. Wish my college was $4.50


Title: Re: 4.50$ Fee for 0.09$ Transaction..?!
Post by: DrSeuss on January 19, 2017, 11:51:55 PM
What's up!  :)

I'm currently coding Bitcoin Transaction into my website via Bitcoinjs-lib.
A few minutes ago I made my first transaction but I seem to have messed it up  ;D
https://blockchain.info/tx/86191760fe7aefb2bbaa54742bb72c2ee256a5a62b1a92518b1a08f424156116

Can anyone maybe explain me why I encounter such a high miners fee?  ::)

Thanks  :D
You probably ended up mixing the fee portion of the transaction add the trans-actable amount up, that's something a fair amount of people make and sadly isn't as rare as you might think it would be.

I wouldn't worry about it, you should be glad that this only cost you $5. That's something that's pretty easy to earn back and you can earn some of that quite easily.

I can imagine that people lost way more than 5$, it's really something you don't expect. :D
Sadly I have to do some work for university right now, but soon I will work further on my project. :)
I hope that if I'm done 5$ will be easily earned. ;)


Title: Re: 4.50$ Fee for 0.09$ Transaction..?!
Post by: franky1 on January 20, 2017, 12:00:38 AM
DrSeuss

if you have the answers to the topic it may be worth you locking the topic, otherwise you will get people with colourful signatures making random comments to spam the topic forever.