Research/Bitcoin Dev Archive / lightning-dev list
Griefing-Penalty: A proposal for mitigating Griefing Attack
9 messages, May 20 to Jun 5, 2020. Started by Subhra Mazumdar.
ZmnSCPxj (5), Subhra Mazumdar (4)
Hi,
We went through the discussion of Griefing Attack <https://www.learnbitcoin.com/archive/lists/lightning-dev/t/2020/proof-of-closure-as-griefing-attack-mitigation#m-41c297a4> and after a thorough analysis, we realized that the attack cannot be prevented as the adversary doesn’t suffer any loss of funds.
We propose an efficient countermeasure for the attack, known as Griefing-Penalty. Our proposed strategy works for any timelock based payment protocol. The penalty compensates for the loss incurred by the intermediaries, affected by griefing attack. You will find the paper Griefing-Penalty: Countermeasure for Griefing Attack in Bitcoin-compatible PCNs <https://arxiv.org/abs/2005.09327> on arXiv. We look forward to hearing from the community on the feasibility of the approach and whether it can be implemented or not.
Our Contribution to the paper:
• We propose a countermeasure for mitigating griefing attack in Bitcoin-compatible PCNs, known as Griefing-Penalty. It punishes the griefer by forcing it to pay compensation to all the parties whose funds got locked for a certain time period as a result of the attack.
• The loss of funds incurred upon mounting griefing-attack is proportional to the collateral cost of each channel involved in routing the payment.
• To illustrate the benefit of the proposed countermeasure, we propose a new payment protocol, called as HTLC-GP or Hashed Timelock Contract with Griefing-Penalty.
• We provide a security analysis which proves that our protocol is privacy-preserving as well as mitigates loss due to griefing attack by compensating the honest nodes
We will briefly summarize the problem and our contribution through an example.
The problem of Griefing Attack explained briefly
Consider the situation where A wants to transfer 1 msat to C. It figures out a path connecting it to C, in the form A->B->C. A establishes an HTLC with B, locking 1 msat in the contract having expiration time of say 2 days. B after receiving the incoming contract, forms a contract with C, locking 1 msat in the contract with locktime of 1 day.
A------------------------->B---------------------->C
HTLC(1msat, 2 day) HTLC(1msat, 1 day)
Now if C griefs, funds of A and B remain locked as they cannot resolve HTLC. After an elapsed time of 1 day, the fund gets unlocked and B gets back 1 msat. Similarly, B cancels contract with A after 1 day, A unlocks 1 msat. The problem with this construction is that C doesn’t lose anything.
Griefing-Penalty: a strategy to penalize the adversary
Hence we have come up with the following idea:
1) An off-chain contract established between 2 parties requires both the parties to lock funds – one party locking the amount that is to be forwarded and the other party locking the fund which can be claimed as a penalty, if this party griefs.
2) The penalty locked is proportional to the product of the amount being forwarded and the expiration time of the contract. All the parties affected by griefing must get compensation since their liquidity is tied up for a certain period of time.
Considering the example used for demonstrating griefing attack. We modify the contract and term it as HTLC-GP (Hashed Timelock Contract with Griefing Penalty). We assume a rate of penalty, say 0.01 per hour, for calculating the penalty the party has to lock in order to accept an off-chain contract request.
A forwards the term of the contract to B, requesting B to lock 0.01*1*48=0.48 msat as a penalty. A locks 1 msat in the contract, so the total amount locked in the contract is 1.48 msat. In the same way, B forwards the term of the contract to C, requesting C to lock 0.01*1*24=0.24 msat as a penalty. B locks 1 msat in the contract, so the total amount locked in the contract is 1.24 msat. If the payment is not resolved within 1 day, all the parties who have forwarded the contract will claim the penalty locked in the contract.
A-------------------------------------->B-------------------------------->C
HTLC-GP(1.48 msat, 2 days) HTLC-GP(1.24 msat,1 day)
If C releases the preimage before the expiration of locktime, it will claim the full amount locked in the contract, i.e. 1.24 msat. Similarly, B claims 1.48 msat from the contract established with A.
Suppose C griefs. After an elapse of 1 day, B claims 1.24 msat from the contract. C loses 0.24 msat. When B cancels contract with A, it will settle by paying 1.48 msat to A. But then B loses an additional 0.24 msat. This is not desired as B was not involved in mounting the attack. As per the objective, even B should earn a remuneration as it got affected by griefing.
Hence, B should have asked C to lock funds in the contract which can be used for compensating both B and A. So C must lock 0.48 msat + 0.24 msat = 0.72 msat. So if C griefs, now it loses 0.72 msat (proportional to the collateral cost of the path). B pays 0.48 msat to A, keeping 0.24 msat with itself as compensation.
A-------------------------------------->B-------------------------------->C
HTLC-GP(1.48 msat, 2 days) HTLC-GP(1.72 msat,1 day)
A------------------------------------->B-------------------------------->C (griefs)
(A gain 0.48 msat) (B gain 0.24 msat) (C loses 0.72 msat)
Good morning Subhra et al,
I am unsure whether you actually solve the Reverse-Griefing attack that the Griefing-Penalty enables. It seems to me that Reverse-Griefing is worse than Griefing, since it causes loss of funds already owned, whereas griefing only causes loss of opportunity to earn.
In particular:
Quoted text (1 line)
> With the introduction of griefing-penalty, in order to avoid paying a compensation, at least two nodes in the path must be corrupted, as per the argument made above.
Given we route using onion routing, it would be trivial to create a loop in the route so that the same node occurs twice in it, thus trivially meeting the "at least two nodes in the path must be corrupted" requirement.
That is, the sender and the receiver can be the same node, making it appear twice in the path.
Quoted text (1 line)
> Though we assume honest party will act rationally, in reality a party is selfish
This does not make sense.
Rationality requires some goal to work toward.
Often, the goal is "look out for number one" i.e. be selfish.
Thus, an economically rational selfish entity is not a contradiction in terms: instead, it is simply applying its rationality towards its own self-interest.
Can you clarify what *goal* you are assuming the party has, which the party is applying its rationality towards?
Hi ZmnSCPxj,
Thanks for your feedback. We would like to clarify certain points.
Quoted text (2 lines)
> Can you clarify what *goal* you are assuming the party has, which the party is applying its rationality towards?
- The goal of griefing-penalty is to penalize any party who intends to launch a griefing attack on the network. The strategy not only increases the cost of attack but compensates other affected parties. It disincentivizes an adversary from stalling the network and *enforces *good behavior. - Disincentivizing an adversary from carrying out griefing attack definitely improves the credibility of Lightning Network. This will attract more participants, willing to invest in the network, and filter out malicious actors from the system by making the attack financially expensive.
Under the current specification of Lightning Network, griefing attack doesn’t result in any financial loss for the adversary. The attack can potentially lead to financial gain out of routing several transactions if a competitor gets eliminated.
With the introduction of *griefing-penalty*, an adversary might follow either of the two strategies to avoid paying penalty:
-
Myopic strategy: An adversary makes short-term gain by reverse-griefing but loses in the long term because of waiting time involved in earning the profit and also due to closure of channel. -
Long-term strategy: If a strategy provides short term gain but incurs a substantial loss in the long term without fulfilling any of the objectives of griefing attack, the adversary would choose not to deviate from the protocol and behave honestly.
Quoted text (4 lines)
> Rationality requires some goal to work toward. Often, the goal is "look out for number one" i.e. be selfish. Thus, an economically rational selfish entity is not a contradiction in terms: instead, it is simply applying its rationality towards its own self-interest.
Using the term “rational and selfish” in the Discussion was a poor choice of words. Thanks for pointing it out. We define an honest-rational party as someone who follows the protocol unless a strictly more rewarding strategy exists. In our paper, an honest-rational party will follow the protocol as the profit earned by processing several transactions is greater than the profit earned by reverse-griefing.
Quoted text (1 line)
> So if an honestly-self-rational node could be tempted to setting up
reverse-griefing attacks, it seems to me that grief-penalty cannot work well as a solution to griefing.
Apart from earning less profit, there are several factors which justify why an honest rational party would prefer to follow the protocol rather than turn malicious and follow a myopic strategy (i.e resort to reverse-griefing):
1.
A party who tries to reverse-grief has to wait for the expiration of the off-chain contract’s locktime before it can broadcast the transaction for earning a penalty. 2.
Note that this output again is encumbered by the RSMC (1000 block relative confirmation times as stated in [1]) This means that it has to wait for 1000 blocks after broadcasting the penalty transaction before it can actually spend the output. 3.
The fund locked in the contract, which acts as compensation in case of misbehavior, is a substantial amount. Definitely, an intermediate party won’t keep its funds unutilized and try to resolve payment as soon as possible. 4.
It leads to channel closure. Any operation performed on-chain is a costly affair. A rational party will not prefer to close the channel.
Thus an honest-rational party can earn in either of the two ways:
1.
A fee for processing payments. 2.
If affected by griefing attack, it gets compensated for the collateral loss.
Quoted text (5 lines)
> Given we route using onion routing, it would be trivial to create a loop in the route so that the same node occurs twice in it, thus trivially meeting the "at least two nodes in the path must be corrupted" requirement. That is, the sender and the receiver can be the same node, making it appear twice in the path.
Our assumption that at most one party is corrupted under adversarial model holds true for self-payment. Please refer to Corollary 1 of our Security Analysis section in the paper <https://arxiv.org/abs/2005.09327>.
Quoted text (1 line)
> The solution should really prevent griefing without introducing any
reverse-griefing.
To avoid reverse-griefing, we may add an extra round (as preprocessing step) before initiating the lock phase. Additionally, the off-chain contract might contain two hashes: one for normal payment and one for error. Thanks to Rene Pickhardt for his suggestions <https://bitcoin.stackexchange.com/questions/96108/why-do-multihop-ln-payments-start-settling-from-the-recipients-end/96110#96110> .
[1] Poon, J. and Dryja, T., 2016. The bitcoin lightning network: Scalable off-chain instant payments. <https://lightning.network/lightning-network-paper.pdf>
On Wed, May 20, 2020 at 10:23 AM ZmnSCPxj <ZmnSCPxj at protonmail.com> wrote:
Quoted text (194 lines)
> Good morning Subhra et al, > > I am unsure whether you actually solve the Reverse-Griefing attack that > the Griefing-Penalty enables. > It seems to me that Reverse-Griefing is worse than Griefing, since it > causes loss of funds already owned, whereas griefing only causes loss of > opportunity to earn. > > In particular: > > > With the introduction of griefing-penalty, in order to avoid paying a > compensation, at least two nodes in the path must be corrupted, as per the > argument made above. > > Given we route using onion routing, it would be trivial to create a loop > in the route so that the same node occurs twice in it, thus trivially > meeting the "at least two nodes in the path must be corrupted" requirement. > > That is, the sender and the receiver can be the same node, making it > appear twice in the path. > > > Though we assume honest party will act rationally, in reality a party > is selfish > > This does not make sense. > > Rationality requires some goal to work toward. > > Often, the goal is "look out for number one" i.e. be selfish. > > Thus, an economically rational selfish entity is not a contradiction in > terms: instead, it is simply applying its rationality towards its own > self-interest. > > Can you clarify what *goal* you are assuming the party has, which the > party is applying its rationality towards? > > -- > > In general, all work towards such open standards as Lightning Network and > so on have the motivating goal of "creating value": by fixing problems and > improving specs, everyone gets a better Lightning Network and (hopefully) > benefits. > However this is not the ultimate goal towards we work toward. > Instead, this is an instrumental goal, with the ultimate goal being to > acquire more value; the act of creating value is then performed in the hope > that the increase in global value will also translate to an increase in > your own value. > > Thus, any forwarding node, by increasing liquidity on the Lightning > Network, does so in the hope that it will capture some of the increased > value: > > * Directly, by earning fees. > * Indirectly, by promoting the use of Lightning and earning more future > fees. > * Even more indirectly, by promoting the use of Lightning on top of > Bitcoin and increasing the value of any Bitcoin held in channels. > > Thus ultimately all honest behavior is ultimately > honestly-rationally-selfish behavior. > > So if an honestly-self-rational node could be tempted to setting up > reverse-griefing attacks, it seems to me that grief-penalty cannot work > well as a solution to griefing. > > The solution should really prevent griefing without introducing any > reverse-griefing. > > Regards, > ZmnSCPxj > > > > Hi, > > > > We went through the discussion of Griefing Attack and after a thorough > analysis, we realized that the attack cannot be prevented as the adversary > doesn’t suffer any loss of funds. > > > > We propose an efficient countermeasure for the attack, known as > Griefing-Penalty. Our proposed strategy works for any timelock based > payment protocol. The penalty compensates for the loss incurred by the > intermediaries, affected by griefing attack. You will find the paper > Griefing-Penalty: Countermeasure for Griefing Attack in Bitcoin-compatible > PCNs on arXiv. We look forward to hearing from the community on the > feasibility of the approach and whether it can be implemented or not. > > > > Our Contribution to the paper: > > > > • We propose a countermeasure for mitigating griefing attack in > Bitcoin-compatible PCNs, known as Griefing-Penalty. It punishes the griefer > by forcing it to pay compensation to all the parties whose funds got locked > for a certain time period as a result of the attack. > > > > • The loss of funds incurred upon mounting griefing-attack is > proportional to the collateral cost of each channel involved in routing the > payment. > > > > • To illustrate the benefit of the proposed countermeasure, we propose a > new payment protocol, called as HTLC-GP or Hashed Timelock Contract with > Griefing-Penalty. > > > > • We provide a security analysis which proves that our protocol is > privacy-preserving as well as mitigates loss due to griefing attack by > compensating the honest nodes > > > > We will briefly summarize the problem and our contribution through an > example. > > > > The problem of Griefing Attack explained briefly > > > > Consider the situation where A wants to transfer 1 msat to C. It figures > out a path connecting it to C, in the form A->B->C. A establishes an HTLC > with B, locking 1 msat in the contract having expiration time of say 2 > days. B after receiving the incoming contract, forms a contract with C, > locking 1 msat in the contract with locktime of 1 day. > > > > A------------------------->B---------------------->C > > > > HTLC(1msat, 2 day) HTLC(1msat, 1 day) > > > > Now if C griefs, funds of A and B remain locked as they cannot resolve > HTLC. After an elapsed time of 1 day, the fund gets unlocked and B gets > back 1 msat. Similarly, B cancels contract with A after 1 day, A unlocks 1 > msat. The problem with this construction is that C doesn’t lose anything. > > > > Griefing-Penalty: a strategy to penalize the adversary > > > > Hence we have come up with the following idea: > > > > 1) An off-chain contract established between 2 parties requires both the > parties to lock funds – one party locking the amount that is to be > forwarded and the other party locking the fund which can be claimed as a > penalty, if this party griefs. > > > > 2) The penalty locked is proportional to the product of the amount being > forwarded and the expiration time of the contract. All the parties affected > by griefing must get compensation since their liquidity is tied up for a > certain period of time. > > > > Considering the example used for demonstrating griefing attack. We > modify the contract and term it as HTLC-GP (Hashed Timelock Contract with > Griefing Penalty). We assume a rate of penalty, say 0.01 per hour, for > calculating the penalty the party has to lock in order to accept an > off-chain contract request. > > > > A forwards the term of the contract to B, requesting B to lock > 0.01*1*48=0.48 msat as a penalty. A locks 1 msat in the contract, so the > total amount locked in the contract is 1.48 msat. In the same way, B > forwards the term of the contract to C, requesting C to lock 0.01*1*24=0.24 > msat as a penalty. B locks 1 msat in the contract, so the total amount > locked in the contract is 1.24 msat. If the payment is not resolved within > 1 day, all the parties who have forwarded the contract will claim the > penalty locked in the contract. > > > > > A-------------------------------------->B-------------------------------->C > > > > HTLC-GP(1.48 msat, 2 days) HTLC-GP(1.24 msat,1 day) > > > > If C releases the preimage before the expiration of locktime, it will > claim the full amount locked in the contract, i.e. 1.24 msat. Similarly, B > claims 1.48 msat from the contract established with A. > > > > Suppose C griefs. After an elapse of 1 day, B claims 1.24 msat from the > contract. C loses 0.24 msat. When B cancels contract with A, it will settle > by paying 1.48 msat to A. But then B loses an additional 0.24 msat. This is > not desired as B was not involved in mounting the attack. As per the > objective, even B should earn a remuneration as it got affected by griefing. > > > > Hence, B should have asked C to lock funds in the contract which can be > used for compensating both B and A. So C must lock 0.48 msat + 0.24 msat = > 0.72 msat. So if C griefs, now it loses 0.72 msat (proportional to the > collateral cost of the path). B pays 0.48 msat to A, keeping 0.24 msat with > itself as compensation. > > > > > A-------------------------------------->B-------------------------------->C > > > > HTLC-GP(1.48 msat, 2 days) HTLC-GP(1.72 msat,1 day) > > > > > A------------------------------------->B-------------------------------->C > (griefs) > > > > (A gain 0.48 msat) (B gain 0.24 msat) (C loses 0.72 > msat) > > > > -- > > Yours sincerely, > > Subhra Mazumdar. > > >
Good morning Subhra,
Quoted text (3 lines)
> - Myopic strategy: An adversary makes short-term gain by reverse-griefing but loses in the long term because of waiting time involved in earning the profit and also due to closure of channel. > > - Long-term strategy: If a strategy provides short term gain but incurs a substantial loss in the long term without fulfilling any of the objectives of griefing attack, the adversary would choose not to deviate from the protocol and behave honestly.
What mechanism protects against the myopic strategy?
There are many reasons why getting short-term gains *right now* via reverse-griefing is generally better:
* Time discounting. Money you have now is better than money you will have in the future, because you can immediately reinvest the money right now. Thus, future earnings must be discounted by the expected average return on investment compared to current earnings. * Counterparty risk. Even if you maintain the channel open in the hope of future earnings, the counterparty can very well just close the channel at any time for no discernible reason. This reduces the expected return on investment by honest behavior. * Cheap pseudonyms. All you need is to get 256 bits of entropy and you can connect as a different node. VPNs and cloud servers can make it difficult to nail down specific IP addresses as belonging to you as attacker.
My reading of the paper suggests that you simply assume that the honest strategy will earn more economically than reverse-griefing; can you provide expected return of investment on other possible investments (e.g. running a JoinMarket maker) to determine time discounting, and the rate at which channels get closed for no good reason to check counterparty risk?
The fact that a reverse-griefing becomes possible means that, even after ignoring onchain fees, running a node can lead to a negative return on investment, whereas with current Lightning, if we ignore onchain fees, the minimum return on investment is 0 and you can "only" earn (again, emphasizing that this holds only if we ignore onchain fees; but in any case, with reverse-griefing possible, this can potentially give even worse negative return on investment if the node is attacked by reverse-griefing).
Griefing can only prevent you from earning. Reverse-griefing can lose you funds.
Quoted text (9 lines)
> > Rationality requires some goal to work toward. Often, the goal is "look out for number one" i.e. be selfish. Thus, an economically rational selfish entity is not a contradiction in terms: instead, it is simply applying its rationality towards its own self-interest. > > Using the term “rational and selfish” in the Discussion was a poor choice of words. Thanks for pointing it out. We define an honest-rational party as someone who follows the protocol unless a strictly more rewarding strategy exists. In our paper, an honest-rational party will follow the protocol as the profit earned by processing several transactions is greater than the profit earned by reverse-griefing. > > > So if an honestly-self-rational node could be tempted to setting up reverse-griefing attacks, it seems to me that grief-penalty cannot work well as a solution to griefing. > > Apart from earning less profit, there are several factors which justify why an honest rational party would prefer to follow the protocol rather than turn malicious and follow a myopic strategy (i.e resort to reverse-griefing): > > 1. A party who tries to reverse-grief has to wait for the expiration of the off-chain contract’s locktime before it can broadcast the transaction for earning a penalty.
But an honest node that hopes to continuously earn money may need to wait even longer before somebody forwards through them, and is generally paid only a few dozen millisatoshi each time.
Quoted text (1 line)
> 2. Note that this output again is encumbered by the RSMC (1000 block relative confirmation times as stated in [1]) This means that it has to wait for 1000 blocks after broadcasting the penalty transaction before it can actually spend the output.
I am unaware of any modern implementation that uses timelocks that large.
Quoted text (2 lines)
> > 3. The fund locked in the contract, which acts as compensation in case of misbehavior, is a substantial amount. Definitely, an intermediate party won’t keep its funds unutilized and try to resolve payment as soon as possible.
Like I pointed out elsewhere, griefing attacks are attacks committed by payer/payee conspiracies against forwarding nodes; we can disregard this point since it applies to non-griefing-penalty (i.e. current Lightning) just as well.
Quoted text (1 line)
> 4. It leads to channel closure. Any operation performed on-chain is a costly affair. A rational party will not prefer to close the channel.
And like I pointed out, because any counterparty can close its channel with you at any time, this risk can be discounted by the expected average chance that a counterparty will close the channel for no reason. Yes, to earn by reverse-griefing you can need to trigger the channel to be closed, but even if you leave it open, there is a chance the counterparty will close it for no reason it will bother to explain to you.
Quoted text (12 lines)
> > > Thus an honest-rational party can earn in either of the two ways: > > 1. A fee for processing payments. > > 2. If affected by griefing attack, it gets compensated for the collateral loss. > > > > Given we route using onion routing, it would be trivial to create a loop in the route so that the same node occurs twice in it, thus trivially meeting the "at least two nodes in the path must be corrupted" requirement. That is, the sender and the receiver can be the same node, making it appear twice in the path. > > Our assumption that at most one party is corrupted under adversarial model holds true for self-payment. Please refer to Corollary 1 of our Security Analysis section in the paper.
Okay.
Quoted text (4 lines)
> > > The solution should really prevent griefing without introducing any reverse-griefing. > > To avoid reverse-griefing, we may add an extra round (as preprocessing step) before initiating the lock phase. Additionally, the off-chain contract might contain two hashes: one for normal payment and one for error. Thanks to Rene Pickhardt for his suggestions.
Can you describe this in more detail?
Regards, ZmnSCPj
Hi ZmnSCPxj,
Thanks for the feedback. The 1000 block relative confirmation time was just a representative value, as stated in [1]. We acknowledge that practical implementations have much lesser confirmation times.
Quoted text (3 lines)
> Yes, to earn by reverse-griefing you can need to trigger the channel to be closed, but even if you leave it open, there is a chance the counterparty will close it for no reason it will bother to explain to you.
The possibility exists. Noted.
Quoted text (1 line)
> Can you describe this in more detail?
Here is our proposal for mitigating reverse-griefing https://gist.github.com/subhramazumdar/cf7b043a73db136f6a23091d20e51751 Looking forward to your comments.
[1] Poon, J. and Dryja, T., 2016. The bitcoin lightning network: Scalable off-chain instant payments. <https://lightning.network/lightning-network-paper.pdf>
On Sat, May 30, 2020 at 11:35 AM ZmnSCPxj <ZmnSCPxj at protonmail.com> wrote:
Quoted text (148 lines)
> Good morning Subhra, > > > - Myopic strategy: An adversary makes short-term gain by > reverse-griefing but loses in the long term because of waiting time > involved in earning the profit and also due to closure of channel. > > > > - Long-term strategy: If a strategy provides short term gain but > incurs a substantial loss in the long term without fulfilling any of the > objectives of griefing attack, the adversary would choose not to deviate > from the protocol and behave honestly. > > What mechanism protects against the myopic strategy? > > There are many reasons why getting short-term gains *right now* via > reverse-griefing is generally better: > > * Time discounting. > Money you have now is better than money you will have in the future, > because you can immediately reinvest the money right now. > Thus, future earnings must be discounted by the expected average return > on investment compared to current earnings. > * Counterparty risk. > Even if you maintain the channel open in the hope of future earnings, > the counterparty can very well just close the channel at any time for no > discernible reason. > This reduces the expected return on investment by honest behavior. > * Cheap pseudonyms. > All you need is to get 256 bits of entropy and you can connect as a > different node. > VPNs and cloud servers can make it difficult to nail down specific IP > addresses as belonging to you as attacker. > > My reading of the paper suggests that you simply assume that the honest > strategy will earn more economically than reverse-griefing; can you provide > expected return of investment on other possible investments (e.g. running a > JoinMarket maker) to determine time discounting, and the rate at which > channels get closed for no good reason to check counterparty risk? > > The fact that a reverse-griefing becomes possible means that, even after > ignoring onchain fees, running a node can lead to a negative return on > investment, whereas with current Lightning, if we ignore onchain fees, the > minimum return on investment is 0 and you can "only" earn (again, > emphasizing that this holds only if we ignore onchain fees; but in any > case, with reverse-griefing possible, this can potentially give even worse > negative return on investment if the node is attacked by reverse-griefing). > > Griefing can only prevent you from earning. > Reverse-griefing can lose you funds. > > > > > Rationality requires some goal to work toward. Often, the goal is > "look out for number one" i.e. be selfish. Thus, an economically rational > selfish entity is not a contradiction in terms: instead, it is simply > applying its rationality towards its own self-interest. > > > > Using the term “rational and selfish” in the Discussion was a poor > choice of words. Thanks for pointing it out. We define an honest-rational > party as someone who follows the protocol unless a strictly more rewarding > strategy exists. In our paper, an honest-rational party will follow the > protocol as the profit earned by processing several transactions is greater > than the profit earned by reverse-griefing. > > > > > So if an honestly-self-rational node could be tempted to setting up > reverse-griefing attacks, it seems to me that grief-penalty cannot work > well as a solution to griefing. > > > > Apart from earning less profit, there are several factors which justify > why an honest rational party would prefer to follow the protocol rather > than turn malicious and follow a myopic strategy (i.e resort to > reverse-griefing): > > > > 1. A party who tries to reverse-grief has to wait for the expiration of > the off-chain contract’s locktime before it can broadcast the transaction > for earning a penalty. > > But an honest node that hopes to continuously earn money may need to wait > even longer before somebody forwards through them, and is generally paid > only a few dozen millisatoshi each time. > > > > 2. Note that this output again is encumbered by the RSMC (1000 block > relative confirmation times as stated in [1]) This means that it has to > wait for 1000 blocks after broadcasting the penalty transaction before it > can actually spend the output. > > I am unaware of any modern implementation that uses timelocks that large. > > > > > > 3. The fund locked in the contract, which acts as compensation in case > of misbehavior, is a substantial amount. Definitely, an intermediate party > won’t keep its funds unutilized and try to resolve payment as soon as > possible. > > Like I pointed out elsewhere, griefing attacks are attacks committed by > payer/payee conspiracies against forwarding nodes; we can disregard this > point since it applies to non-griefing-penalty (i.e. current Lightning) > just as well. > > > > 4. It leads to channel closure. Any operation performed on-chain is a > costly affair. A rational party will not prefer to close the channel. > > And like I pointed out, because any counterparty can close its channel > with you at any time, this risk can be discounted by the expected average > chance that a counterparty will close the channel for no reason. > Yes, to earn by reverse-griefing you can need to trigger the channel to be > closed, but even if you leave it open, there is a chance the counterparty > will close it for no reason it will bother to explain to you. > > > > > > > Thus an honest-rational party can earn in either of the two ways: > > > > 1. A fee for processing payments. > > > > 2. If affected by griefing attack, it gets compensated for the > collateral loss. > > > > > > > Given we route using onion routing, it would be trivial to create a > loop in the route so that the same node occurs twice in it, thus trivially > meeting the "at least two nodes in the path must be corrupted" requirement. > That is, the sender and the receiver can be the same node, making it appear > twice in the path. > > > > Our assumption that at most one party is corrupted under adversarial > model holds true for self-payment. Please refer to Corollary 1 of our > Security Analysis section in the paper. > > Okay. > > > > > > The solution should really prevent griefing without introducing any > reverse-griefing. > > > > To avoid reverse-griefing, we may add an extra round (as preprocessing > step) before initiating the lock phase. Additionally, the off-chain > contract might contain two hashes: one for normal payment and one for > error. Thanks to Rene Pickhardt for his suggestions. > > > Can you describe this in more detail? > > > Regards, > ZmnSCPj >
Good morning Subhra,
Quoted text (4 lines)
> > Can you describe this in more detail? > > Here is our proposal for mitigating reverse-griefing https://gist.github.com/subhramazumdar/cf7b043a73db136f6a23091d20e51751 > Looking forward to your comments.
Just to clarify my understanding, during the preprocessing stage no contracts are established yet?
If so, note that the locking phase is not safe to perform from recipient to sender (which is how it seems to be described).
* R and S are really the same entity (they can be the same node, the forwarding nodes A B and C would not be aware of this at all, or they could be two very cheaply generated pseudonyms of the same entity). * R and C establish the contract for 7 msat, using 1 msat from C and 6 msat from R: * R shows x such that h = h(x) is true, with R getting 7 msat. * R shows r such that y = h(r) is true, with C getting 1 msat and R getting 6 msat. * After one day, C gets 7 msat. * Similar contracts are established all the way to A. * When A contacts S, S suddenly pretends to be asleep. * R shows x (which it knows, because S and R are cooperating are the same and x is generated by S). * It thus gets 7 msat --- 6 msat originally from R, for a net gain of 1 msat. * A is left holding the bag.
Initial contract establishment has to be done from S to R always, not R to S. Multi-stage contracts can be done from R to S (arguably the simple resolution of HTLC chains is "really' the second stage) for after the initial establishment, but initial establishment always has to be from S to R.
There may be other issues as well with the overall setup, please wait, I am considering as well what would happen if we correctly establish the contracts from S to R.
The onion packet can transfer secret data from S to R as well, there is no need for a separate communication from S to R.
Regards, ZmnSCPxj
Good morning Subhra,
Quoted text (1 line)
> There may be other issues as well with the overall setup, please wait, I am considering as well what would happen if we correctly establish the contracts from S to R.
Unfortunately the Mitigating Reverse-Griefing contract reintroduces griefing.
First, let us simplify the setup to S -> F -> R.
In the griefing attack of today the setup would be:
* S->F has the contract, funded by S only: * If F can reveal x such that h = h(x) for a known h, F can claim the fund. * After 2 days, S can recover the fund. * F->R has the contract, funded by F only: * If R can reveal x such that h = h(x) for a known h, R can claim the fund. * After 1 day, F can recover the fund.
Then, 1 Planck interval before the 1-day limit, R cancels the HTLC by doing some form of `update_fail_htlc` to F. This causes F to not earn any funds, even though it had its funds locked for 1 day minus 1 Planck interval; thus in practice, R can lock the funds of F for a little less than the time limit imposed.
With the Mitigating Reverse Griefing technique, the setup would be:
* S->F has the contract, funded by S and F: * If F can reveal x such that h = h(x) for a known h, F can claim the fund. * If F can reveal r such that y = h(r) for a known y, S and F can recover their original contributions to the fund. * After 2 days, S can claim the fund. * F->R has the contract, funded by F and R: * If R can reveal x such that h = h(x) for a known h, R can claim the fund. * If R can reveal r such that y = h(r) for a known y, F and R can recover their original contributions to the fund. * After 1 day, F can claim the fund.
Then, 1 Planck interval before the 1-day limit, R uses the second clause to cancel the entire payment.
This is exactly the same result as with the current griefing attack: F is induced to lock its funds for 1 day minus 1 Planck interval, but is never compensated for it. It is immaterial whether the mechanism used is `update_fail_htlc` or some other mechanism.
So not only does Mitigating Reverse-Griefing just replace reverse-griefing with the attack described in my previous post, which I am now calling backflip-reverse-griefing (because calling it "reverse-reverse-griefing" would be ***SO BORING AND OBVIOUS***), it also returns the original griefing attack.
I think it is a principle of protocol design that, in general, protecting against one attack could open you up to the opposite of that attack.
It is helpful to remember that the original griefing attack is basically a withholding attack, wherein a participant does not respond after a particular step in the protocol. By adding more steps, you simply add more places where a participant can stop responding after some step in the protocol, and thus add even more attack surface.
Regards, ZmnSCPxj
Hi ZmnSCPxj,
Thanks for your invaluable feedback. The attack stated for the
construction
https://gist.github.com/subhramazumdar/cf7b043a73db136f6a23091d20e51751
holds true for the path S->A->B->C->R. A will end up paying the money
without receiving anything from S.
Quoted text (2 lines)
>Initial contract establishment has to be done from S to R always, not R to S.
Multi-stage contracts can be done from R to S (arguably the simple resolution of HTLC chains is "really' the second stage) for after the initial establishment, but initial establishment always has to be from S to R. If the initial contract establishment starts from S, we can still face reverse-griefing - if an intermediate node, say C, refuses to sign the contract then again B can be reverse-griefed by A. It will deny canceling the contract with B and wait for the locktime to expire, thereby victimizing B.
What might possibly work here is that the parties must first exchange signatures for the error hash in order to unlock collateral and avoid reverse-griefing and only after that, exchange signatures for payment hash.
Again if S starts the locking phase by supplying the error hash in one round followed by exchanging signature for payment hash in the next round, it might supply a wrong error hash so that R is not able to supply proof of cancelation. Even if S has not tampered with the error hash value, an intermediate may refuse to forward the contract with terms of error hash. Again we are stuck with the same problem because R possesses the witness to the error hash. If the contract is not forwarded to R, the preimage will not be revealed.
Given the terms of the contract is (quoting for R and C, for the rest of the channel it is the same except the change in the locktime, penalty, and payment locked by each party): R and C establish the contract for 7 msat, using 1 msat from C and 6 msat from R:
* R shows x such that h = h(x) is true, with R getting 7 msat.
* R shows r such that y = h(r) is true, with C getting 1 msat and R getting 6 msat.
* After one day, C gets 7 msat.
What we think might work for our case is that we let the exchange of signature for lock phase happen over two rounds - R initiating the first round involving error hash and S initiating the second round involving payment hash, as follows:
Initially, let R exchange signatures with C over the following terms of the contract.
“ * (Terms of Cancelation) R shows r such that y = h(r) is true, with C getting 1 msat and R getting 6 msat.
* After one day, C gets 7 msat.
C exchange signature with B and this continues till A has established the contract with S. This allows an honest intermediary in the release phase to unlock the money if R has triggered cancelation of the contracts.
After S has signed the cancelation contract with A, the second round is initiated for forwarding the payment. S exchange signatures with A for the payment hash. This will avoid the problem mentioned in the previous construction whereby an intermediate party ends up paying its successor without being remunerated by a malicious payer. The rest of the intermediate parties does the same. Finally, C will exchange signature with R over the following terms:
* (Terms of Payment) R shows x such that h = h(x) is true, with R getting 7 msat.
R will wait for a constant amount of time in order to receive incoming contract request from C. After that, given the condition, it will either release the preimage of error hash or payment hash. If R griefs, it will lose funds in the form of penalty.
Regarding the second attack:
Quoted text (7 lines)
>Then, 1 Planck interval before the 1-day limit, R uses the second clause to cancel the entire payment. This is exactly the same result as with the current griefing attack: F is induced to lock its funds for 1 day minus 1 Planck interval, but is never compensated for it. It is immaterial whether the mechanism used is `update_fail_htlc` or some other mechanism.
We had mentioned in the paper <https://arxiv.org/abs/2005.09327> under Discussions (Section 6.3) that we do not handle attacks concerning soft-griefing, i.e., if a party withholds the preimage for a long time but releases just before the expiration of locktime. We think with the current set of instructions supported in Bitcoin, it is hard to settle soft-griefing related disputes, accounting penalty for each unit of elapsed time. In case of soft-griefing, we neither impose the griefing penalty, nor is there a chance to reverse-grief.
On Mon, Jun 1, 2020 at 7:39 AM ZmnSCPxj <ZmnSCPxj at protonmail.com> wrote:
Quoted text (78 lines)
> Good morning Subhra, > > > There may be other issues as well with the overall setup, please > wait, I am considering as well what would happen if we correctly establish > the contracts from S to R. > > Unfortunately the Mitigating Reverse-Griefing contract reintroduces > griefing. > > First, let us simplify the setup to S -> F -> R. > > In the griefing attack of today the setup would be: > > * S->F has the contract, funded by S only: > * If F can reveal x such that h = h(x) for a known h, F can claim the > fund. > * After 2 days, S can recover the fund. > * F->R has the contract, funded by F only: > * If R can reveal x such that h = h(x) for a known h, R can claim the > fund. > * After 1 day, F can recover the fund. > > Then, 1 Planck interval before the 1-day limit, R cancels the HTLC by > doing some form of `update_fail_htlc` to F. > This causes F to not earn any funds, even though it had its funds locked > for 1 day minus 1 Planck interval; thus in practice, R can lock the funds > of F for a little less than the time limit imposed. > > > > With the Mitigating Reverse Griefing technique, the setup would be: > > * S->F has the contract, funded by S and F: > * If F can reveal x such that h = h(x) for a known h, F can claim the > fund. > * If F can reveal r such that y = h(r) for a known y, S and F can > recover their original contributions to the fund. > * After 2 days, S can claim the fund. > * F->R has the contract, funded by F and R: > * If R can reveal x such that h = h(x) for a known h, R can claim the > fund. > * If R can reveal r such that y = h(r) for a known y, F and R can > recover their original contributions to the fund. > * After 1 day, F can claim the fund. > > Then, 1 Planck interval before the 1-day limit, R uses the second clause > to cancel the entire payment. > > This is exactly the same result as with the current griefing attack: F is > induced to lock its funds for 1 day minus 1 Planck interval, but is never > compensated for it. > It is immaterial whether the mechanism used is `update_fail_htlc` or some > other mechanism. > > > So not only does Mitigating Reverse-Griefing just replace reverse-griefing > with the attack described in my previous post, which I am now calling > backflip-reverse-griefing (because calling it "reverse-reverse-griefing" > would be ***SO BORING AND OBVIOUS***), it also returns the original > griefing attack. > > > I think it is a principle of protocol design that, in general, protecting > against one attack could open you up to the opposite of that attack. > > > It is helpful to remember that the original griefing attack is basically a > withholding attack, wherein a participant does not respond after a > particular step in the protocol. > By adding more steps, you simply add more places where a participant can > stop responding after some step in the protocol, and thus add even more > attack surface. > > > Regards, > ZmnSCPxj > >
Good morning Subhra,
Quoted text (1 line)
> We had mentioned in the paper under Discussions (Section 6.3) that we do not handle attacks concerning soft-griefing, i.e., if a party withholds the preimage for a long time but releases just before the expiration of locktime. We think with the current set of instructions supported in Bitcoin, it is hard to settle soft-griefing related disputes, accounting penalty for each unit of elapsed time. In case of soft-griefing, we neither impose the griefing penalty, nor is there a chance to reverse-grief.
In fact, what you call the "soft-grief" *is* the griefing attack you expect to see on the network.
If the receiver R let the time elapse, then the forwarding node just before the receiver R will close the channel. Closing a channel and later re-establishing it (in order to mount the attack again, remember, this is an attempt to DoS your competitors, and is thus best done continuously) is expensive.
Thus all griefing attacks will, in practice, involve what you call "soft" griefing, i.e. the payment is cancelled just before the timeout arrives, before the last forwarding node closes the channel. But it is precisely this "soft" griefing which is the problem.
So:
* It is immaterial that you punish R if it lets the time elapse --- channel close is sufficient punishment. * What is material is that if R cancels the payment *just before* the lock time, it should be punished --- there is currently no way to do this.
Regards, ZmnSCPxj