A Possible Security Problem (about dividend payment transaction fees)

Hi all,

In distributing dividends, the transaction fees are paid by the distributer, aren't they? So, if there's a divisible token, an attacker who has many addresses may buy the token in very small fractions to his/her addresses. Then, the distributor would have to pay transaction fees for each address.

Considering that each Counterparty action currently requires 0.0005 BTC, paying dividends to 10000 different addresses would require 5 BTC. The attacker may pay 5 BTC only once when he/she buys the tokens. However, the dividend distributor needs to pay 5 BTC each time he/she wants to pay dividends.

This must be an annoying possibility for someone who plans to issue a token with daily dividend payments. It also discourages any kind of small dividend amounts. It would be perfect if there was a choice for dividend distributors to choose whether themselves or payee would pay the transaction fees. Of course, this is only possible when the dividends are paid in bitcoins.

[quote author=Najska link=topic=682.msg3552#msg3552 date=1411690577]
Hi all,

In distributing dividends, the transaction fees are paid by the distributer, aren't they? So, if there's a divisible token, an attacker who has many addresses may buy the token in very small fractions to his/her addresses. Then, the distributor would have to pay transaction fees for each address.

Considering that each Counterparty action currently requires 0.0005 BTC, paying dividends to 10000 different addresses would require 5 BTC. The attacker may pay 5 BTC only once when he/she buys the tokens. However, the dividend distributor needs to pay 5 BTC each time he/she wants to pay dividends.

This must be an annoying possibility for someone who plans to issue a token with daily dividend payments. It also discourages any kind of small dividend amounts. It would be perfect if there was a choice for dividend distributors to choose whether themselves or payee would pay the transaction fees. Of course, this is only possible when the dividends are paid in bitcoins.
[/quote]


Transaction fees always go only to bitcoin miners.

Hi Something,

Yes, I know. A competitor may use this attack to destroy someone’s business. The aim is not to take the fee, just to leave the issuer out of money.

Okay, I get your point.

But, now that we know about this possibility, issuers can issue non-divisible coins in larger denominations, so IMHO it’s more about properly executing one’s issuance strategy.

First, let’s make one point clear. Distribution of dividends uses multi-output btc transactions. Are we sure that distributing dividends to 10 shareholders is more expensive than making the distribution to 5 shareholders?

This attack is really just on the policy of an issuer. As long as they put in some minimum dividend payment value, they can just skip stakes that are too small to service. So I would suggest dividends not get issued to a specific address if the fees would be more than 1% of the dividend. To avoid this, dividends would be preferentially paid (from an issuer’s standpoint) in XDP, XBTC, or some other Counterparty token since there the fees are just for one transaction no matter how many stakeholders addresses there are.


If there is a best practices for dividends, this would be an important point to note there.

“So I would suggest dividends not get issued to a specific address if the fees would be more than 1% of the dividend.”

How can the issuer do that? Is there such an option in the protocol?

And one more thing, why is it paid only one tx fee if the dividend is paid in a token? What is the difference of this with paying the dividend in BTC?

There isn’t that kind of option in the protocol. Dividends paid in tokens only require one Bitcoin transaction to distribute to all holders. Further explanation follows.

You can do two kinds of dividends with Counterparty and Bitcoin. One is by sending btc and in this case, you have this issue but since you have to generate these transactions manually or with your own script you could add in such a rule. The other is using the native Counterparty dividend feature which actually pays dividends with a single Bitcoin transaction. That transaction says that you are sending each of the holders of token A a proportional share of some quantity of token B. Since this is done in one transaction, the only wrinkle would be if a token weren’t divisible enough and then I would think those very small stakes in token A would just get zero of token B.

weex,

Thank you for the answer. But I need one more point to be clarified.

“One is by sending btc and in this case, you have this issue but since you have to generate these transactions manually or with your own script you could add in such a rule.”

Isn’t there a built-in Counterparty dividend distribution feature to pay dividends in bitcoins. In Counterwallet.co, when I try to pay dividends, I can choose BTC as the “Distribution Token” (“The token in which the distribution is paid”). Does it still require many transaction fees? If so, what is different in distributing tokens than distributing bitcoins, when both is done with that exact same native Counterparty dividend distribution feature?

I’m not entirely sure how that feature would work. The wiki says on the subject, “To pay dividends in BTC, you should, for now, just use a regular Bitcoin client, coupled with the output from counterpartyd asset ASSET, which will list all of the shareholders (and their holdings) of ASSET.” This to me implies that you will need to manually or with some other tool, create one or more sendmany transactions and there you would want to be sensitive to the size of the transaction as per your initially identified problem. 

I'm not entirely sure how that feature would work. 

I haven’t ever issued any assets but here’s a script to easily pay out dividends to a bunch of addresses:
https://wiki.counterparty.io/w/Sendmany

I forgot to mention, at the time, that it’d cost the attacker at least 5 BTC (the same amount) in tx_fees to attack (acquire a fractional amount of the asset from 1,000 addresses) so it’s not a very good deal (although theoretically the impact would be more than one-off, it’d be 5 BTC every time dividend is paid).

Related to the cost of sending,a picopayment library is available for testing (docs: https://github.com/CounterpartyXCP/Documentation/pull/123), by the way.
Also, since today Bitcoin 0.13 with addrindex beta (addrindex is req’d by counterparty-server) is available from BTCdrak’s repo.