Bitcoin Forum
April 20, 2024, 02:32:09 AM *
News: Latest Bitcoin Core release: 26.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Question about fees and transaction size  (Read 488 times)
qardpeet (OP)
Newbie
*
Offline Offline

Activity: 3
Merit: 0


View Profile
November 30, 2017, 05:31:46 PM
Last edit: November 30, 2017, 05:50:44 PM by qardpeet
 #1

Alright, so today I was writing a piece of code integrating BTC into my "Business" and I realized a huge flaw with use of BTC economically. Please prove me wrong.

Let us take a small business named Juice4Days that sells cups of orange juice to customers. Each cup is worth 2$ according to BTC/USD exchange rate. Let us also estimate that Juice4Days sells 20 cups of orange juice each day (using only BTC of course). If we assume that BTC/USD exchange rate stays the same, Juice4Days accumulates $14600 in one year on their single BTC address. In one year, the owner of Juice4Days, Chad, decides to send total revenue to his other address for safe keeping. This is where Chad stumbles upon a huge problem:

If we assume that each cup sold was added to Juice4Days BTC address as an input carrying approximately 180bytes of data, we get that the overall size of Chads transaction to his safe keeping address will be 180Bytes x 7300Cups = 1314000 Bytes. According to bitcoinfees.earn.com "The fastest and cheapest transaction fee is currently 0.0000023 BTC/byte", this means that Chad will have to pay 1314000 x 0.0000023 = 3.0222BTC for his transaction.

Chad will have to pay more in transaction Fees than he has made selling his amazing orange juice.

Where did Chad go wrong?  Roll Eyes

Please explain to me, I really want to know how Chad could have improved his system to minimize transaction fees.

P.S Even if Chad pays the lowest possible transaction fee per byte he still has to pay 1236.00 US Dollars. Add to that the possibility that his transaction may never get confirmed.
1713580329
Hero Member
*
Offline Offline

Posts: 1713580329

View Profile Personal Message (Offline)

Ignore
1713580329
Reply with quote  #2

1713580329
Report to moderator
1713580329
Hero Member
*
Offline Offline

Posts: 1713580329

View Profile Personal Message (Offline)

Ignore
1713580329
Reply with quote  #2

1713580329
Report to moderator
"Bitcoin: mining our own business since 2009" -- Pieter Wuille
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1713580329
Hero Member
*
Offline Offline

Posts: 1713580329

View Profile Personal Message (Offline)

Ignore
1713580329
Reply with quote  #2

1713580329
Report to moderator
1713580329
Hero Member
*
Offline Offline

Posts: 1713580329

View Profile Personal Message (Offline)

Ignore
1713580329
Reply with quote  #2

1713580329
Report to moderator
1713580329
Hero Member
*
Offline Offline

Posts: 1713580329

View Profile Personal Message (Offline)

Ignore
1713580329
Reply with quote  #2

1713580329
Report to moderator
achow101
Moderator
Legendary
*
expert
Offline Offline

Activity: 3374
Merit: 6511


Just writing some code


View Profile WWW
November 30, 2017, 06:59:14 PM
Merited by ABCbits (2)
 #2

Alright, so today I was writing a piece of code integrating BTC into my "Business" and I realized a huge flaw with use of BTC economically. Please prove me wrong.

Let us take a small business named Juice4Days that sells cups of orange juice to customers. Each cup is worth 2$ according to BTC/USD exchange rate. Let us also estimate that Juice4Days sells 20 cups of orange juice each day (using only BTC of course). If we assume that BTC/USD exchange rate stays the same, Juice4Days accumulates $14600 in one year on their single BTC address. In one year, the owner of Juice4Days, Chad, decides to send total revenue to his other address for safe keeping. This is where Chad stumbles upon a huge problem:

If we assume that each cup sold was added to Juice4Days BTC address as an input carrying approximately 180bytes of data, we get that the overall size of Chads transaction to his safe keeping address will be 180Bytes x 7300Cups = 1314000 Bytes. According to bitcoinfees.earn.com "The fastest and cheapest transaction fee is currently 0.0000023 BTC/byte", this means that Chad will have to pay 1314000 x 0.0000023 = 3.0222BTC for his transaction.

Chad will have to pay more in transaction Fees than he has made selling his amazing orange juice.

Where did Chad go wrong?  Roll Eyes

Please explain to me, I really want to know how Chad could have improved his system to minimize transaction fees.

P.S Even if Chad pays the lowest possible transaction fee per byte he still has to pay 1236.00 US Dollars. Add to that the possibility that his transaction may never get confirmed.

Chad went wrong by doing two things. First of all, he is using an uncompressed public key. Secondly, he is not using Segwit.

Using a compressed public key itself will reduce the size of each input to 148 bytes.

Using segwit will reduce that even further. A normal P2PKH input with compressed pubkey will be 592 Weight units. With P2SH nested segwit, the input will only be 243 weight units. So with your fee rate of 58 satoshis per weight unit (230 sat/byte is 57.5 sat/weight unit), Chad would only have to pay 1773900*58=102886200 satoshis = 1.02886200 BTC, one third of what you calculated earlier. At the current market rate, he would still be making a profit.

Furthermore, Chad could also wait for the Lightning network to be deployed. If the majority of his customers used the Lightning network and were repeat buyers or routed payments through other lightning network nodes so overall he would have to make very few and small transactions.

Alternatively Chad could also pay a very low fee rate and just wait a long time. If he does not need the money urgently and instead consolidates outputs periodically at a very low fee rate, he would have to pay way less in fees.

qardpeet (OP)
Newbie
*
Offline Offline

Activity: 3
Merit: 0


View Profile
November 30, 2017, 07:21:27 PM
 #3


Chad went wrong by doing two things. First of all, he is using an uncompressed public key. Secondly, he is not using Segwit.

Using a compressed public key itself will reduce the size of each input to 148 bytes.

Using segwit will reduce that even further. A normal P2PKH input with compressed pubkey will be 592 Weight units. With P2SH nested segwit, the input will only be 243 weight units. So with your fee rate of 58 satoshis per weight unit (230 sat/byte is 57.5 sat/weight unit), Chad would only have to pay 1773900*58=102886200 satoshis = 1.02886200 BTC, one third of what you calculated earlier. At the current market rate, he would still be making a profit.

Furthermore, Chad could also wait for the Lightning network to be deployed. If the majority of his customers used the Lightning network and were repeat buyers or routed payments through other lightning network nodes so overall he would have to make very few and small transactions.

Alternatively Chad could also pay a very low fee rate and just wait a long time. If he does not need the money urgently and instead consolidates outputs periodically at a very low fee rate, he would have to pay way less in fees.

Chad wouldn't be making profit, that is just his revenue on the OJ cups. Keep in mind Revenue != Profit. Chad will need his revenue right away to pay his employees, pay for oranges, cups, rent and etc. His revenue would just be 14600 - 10041 = $4559 This number is much lower than what he would have earned if he sold for USD instead of BTC. This means that without lightning network, chad shouldn't be incorporating BTC into his business to sell OJ.

Lets say it costs Chad $1 to sell each cup of OJ. To sell 20 cups of OJ per day for a year, it will cost chad $7300. His revenue is only $4559, this means that his profit = $4559 - $7300 = $-2741. Chad is still losing money.
achow101
Moderator
Legendary
*
expert
Offline Offline

Activity: 3374
Merit: 6511


Just writing some code


View Profile WWW
November 30, 2017, 07:35:17 PM
Merited by ABCbits (1)
 #4

This means that without lightning network, chad shouldn't be incorporating BTC into his business to sell OJ.
No, he shouldn't. Bitcoin is not good for microtransactions and never really has been.

qardpeet (OP)
Newbie
*
Offline Offline

Activity: 3
Merit: 0


View Profile
November 30, 2017, 07:48:52 PM
 #5

No, he shouldn't. Bitcoin is not good for microtransactions and never really has been.

Makes sense, so why do people vouch for BTC as the universal currency? Because most businesses are built on microtransactions. Not only would it not work with microtransactions, it would not work for businesses who receive money in high frequencies. 
DannyHamilton
Legendary
*
Offline Offline

Activity: 3360
Merit: 4570



View Profile
December 01, 2017, 12:06:13 AM
 #6

Makes sense, so why do people vouch for BTC as the universal currency?

Because 50% of the people have below median intelligence.

Furthermore, of those that have above median intelligence, a significant percentage have not taken the time to truly understand Bitcoin, and instead prefer to simply repeat misinformation that they've heard elsewhere without verifying it first.
collapse
Full Member
***
Offline Offline

Activity: 206
Merit: 102


step forward


View Profile
December 02, 2017, 12:23:39 PM
 #7

No, he shouldn't. Bitcoin is not good for microtransactions and never really has been.

"Bitcoin would be convenient for people who don't have a credit card or don't want to use the cards they have"



Elacoin-ELC,Betacoin-BET,Neutroncoin-NTRN,Americancoin-AMC,Stronghands-SHND,Craftcoin-CRC,DOGE,BCH,BTC,...,Bitcoin,...(and a lot more)
Linux updated wallets (source code) for: ELC, BET, AMC, NKT, SLING, CRC,...
[if (blocknumber > 115000) maxblocksize=largerlimit]   [I don't think the threshold should ever be 0.  We should always allow at least some free transactions.]
mda
Member
**
Offline Offline

Activity: 144
Merit: 13


View Profile
December 02, 2017, 03:56:22 PM
 #8

Makes sense, so why do people vouch for BTC as the universal currency? Because most businesses are built on microtransactions.
With all my disregard of Lightening Network I admit that their payment channels are quite good.
You open a $100 payment channel and shuffle money with shop for free until there is nothing left or you have had enough of them.
Then you close the channel with one on-chain transaction.
achow101
Moderator
Legendary
*
expert
Offline Offline

Activity: 3374
Merit: 6511


Just writing some code


View Profile WWW
December 02, 2017, 06:25:34 PM
Merited by ABCbits (1)
 #9

It still is. Bitcoin is good for paying for things that are at least $10. Paying very low amounts (only a few dollars) is not all that good to do on Bitcoin. Nor are credit cards at those low values. Many merchants (particularly Mom & Pop shops or local restaurants) will not accept credit cards if the purchase is less than $10.

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!