Skip to content

Conversation

@coblee
Copy link
Contributor

@coblee coblee commented Jun 29, 2012

This code helps with reducing dust spam. The original code will make the transaction fee become the minimum fee if any output is less than a cent. This makes it costly to send dust spam, but there's an edge case. The attacker can send a transaction with 1000 outputs of one satoshi each. The transaction size is huge but the fee is only the base fee. This fix will increase the fee by the base fee amount for each output that's less than a cent.

@jgarzik
Copy link
Contributor

jgarzik commented Jun 29, 2012

ACK -- the economics seem to make sense, but I am interested in comments from others

@coblee
Copy link
Contributor Author

coblee commented Jun 29, 2012

@gmaxwell
Copy link
Contributor

This doesn't sound bad— although generally I'd like to start talking about how to get the net-change-to-the-open-txn-set included in the free/priority structure.

This is a dual attack in that it both adds static blockchain data but it also adds a ton of data which is probably never going to get redeemed, thus also burdening pruned nodes. This could be discouraged using as the size metric of something like max(size/2,2*size-size_of_txouts_reedemed). This would also discourage this sort of attack, where the out data size is much larger than the redeemed inputs.

@coblee
Copy link
Contributor Author

coblee commented Jun 29, 2012

Yes, once you get a lot of dust spam, select coins can take forever. For Litecoin, I had to implement a workaround for people to ignore the dustspam and make them not count towards coins that they own. It was a huge pain.

@gmaxwell
Copy link
Contributor

Sort of tangent— but wrt the select coins problem you might want to look at adding a post processing step: once you've prepared a txn with change and either a free txn with excess priority, or a with fee which isn't right at the boundary, then add in additional of your smallest inputs in order to get them out of your wallet (and out of pruned chains).

@gmaxwell
Copy link
Contributor

gmaxwell commented Jul 2, 2012

On further consideration: This will break the faucet, it will also remove an incentive to use sendmany.

@coblee
Copy link
Contributor Author

coblee commented Jul 2, 2012

As Bitcoin's value increases, you will probably need to reduce the value in which a output is considered spam. For Litecoin, less than 0.01 LTC is pretty much worthless. Maybe for Bitcoin, we should change it so that we add a fee for any output less than 0.0001 BTC.

@gavinandresen
Copy link
Contributor

This doesn't feel like the right fix to me.

Fixing the coin selection algorithm so it works quickly with wallets containing gazillions of tiny transactions is part of the solution. Something simple like "If there are more than X unspent outputs, don't use the fancy knapsack-problem-solver, just use the biggest-value unspent input(s) until you have enough to pay for the transaction+fee."

See https://gist.github.com/2961409 for the direction I think will work. With the right priority algorithm (and a minimum-to-be-relayed-included threshold) I don't think a dust spam fee is needed at all.

@coblee
Copy link
Contributor Author

coblee commented Jul 2, 2012

@gavinandresen
Copy link
Contributor

Right, see the gist for the other part of what I think would be a better fix.

For a very-low-transaction-volume chain like LiteCoin, I think the right fix would involve miners specifying a small maximum block size (say 10K, enough space for 40 or so regular-sized transactions) and a high "forgo this amount of transaction fees" (so block space is dominated by transaction priority, not fee).

@BitcoinPullTester
Copy link

@SergioDemianLerner
Copy link
Contributor

Remember there is a previously reported attack involving one connection sending txs with tiny amounts to increase the GLOBAL limit, thus preventing the other connections from sending free transactions. It's necessary to review how this change may affect that attack, and if it can make it worse. I suggested using per-connection limits, and not a global limit.

@jgarzik
Copy link
Contributor

jgarzik commented Sep 4, 2012

It sounds like consensus is against merging this specific fix at this time.

@jgarzik jgarzik closed this Sep 4, 2012
@felipelalli
Copy link

It sounds good merging this specific fix at this time, after some attacks.

@m-schmoock
Copy link

One only learns from mistakes

@adv0r
Copy link

adv0r commented Jul 8, 2015

@felipelalli +1

@mb300sd
Copy link
Contributor

mb300sd commented Jul 9, 2015

Whatever my opinion is worth... +1.

@ghost
Copy link

ghost commented Jul 9, 2015

Consensus has changed. It's back on the table. This could potentially resolve the backlog we have in transactions

@pentarh
Copy link

pentarh commented Jul 9, 2015

Txout should be compared not to CENT, which is very hardcoded value, but to nBaseFee imho. Like this

if (txout.nValue < nBaseFee) nMinFee += nBaseFee;

@ABISprotocol
Copy link

This is certainly not back on the table at all, imho. There were very good reasons this pull request was closed out in 2012. I would encourage people to re-read the remarks (including those of @gavinandresen as shown here) and @gmaxwell's.

It's a bad idea to take a nuclear option with respect to fees and reject the opportunity that can be presented from analyzing microgiving potential. Odd also that people keep referring to this as "dust spam" when they could be reframing the language and the issue... the current "dust problem" (which I would argue should actually be called a "giving opportunity") is an opportunity to re-examine transactions, transforming them into bursts of microgiving. Do not foreclose on the an opportunity to re-examine and re-envision transactions and thus change the system you are using.

In closing, I would also recommend you see issue #6402 as an example (of how this could be handled better, perhaps) and also some of the more recent comments on #6201 (including one that I've entered).

suprnurd pushed a commit to chaincoin-legacy/chaincoin that referenced this pull request Dec 5, 2017
…bitcoin#1536)

governance.cs -> mempool.cs:
`CGovernanceManager::ProcessMessage - LOCK2(cs_main, governance.cs) ->  GetTransaction ->  lookup - LOCK(mempool.cs)`

mempool.cs -> governance.cs:
`CreateNewBlock - LOCK2(cs_main, mempool.cs)  -> FillBlockPayments ->  IsSuperblockTriggered - LOCK(governance.cs)`
lateminer pushed a commit to lateminer/bitcoin that referenced this pull request May 6, 2020
… setup

45ce02e [Build] Disable apt-cacher for Windows WSL gitian setup (Fuzzbawls)

Pull request description:

  gitian's use of apt-cacher server on the host doesn't work when using
  Windows 10's WSL subsystem. This adds a check to see if the ubuntu OS
  version is from "Microsoft" (which indicates it is a WSL environment),
  then uses the boolean result to disable the use of apt-cacher if true.

ACKs for top commit:
  random-zebra:
    utACK 45ce02e

Tree-SHA512: c2954ca6c727ddcd13515c1b6591e1ef6f2ed5c229aafe106c7b90b83b4236961b88970a2b2040f28f4376e549a5aadf39db7b887326d3dd3c735157236a0bea
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.