Return-Path: Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by lists.linuxfoundation.org (Postfix) with ESMTP id B2BEDC016F for ; Mon, 22 Jun 2020 07:35:34 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id A190788124 for ; Mon, 22 Jun 2020 07:35:34 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id CGhegAqzSXY0 for ; Mon, 22 Jun 2020 07:35:33 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail-ot1-f43.google.com (mail-ot1-f43.google.com [209.85.210.43]) by whitealder.osuosl.org (Postfix) with ESMTPS id 148F2880E4 for ; Mon, 22 Jun 2020 07:35:33 +0000 (UTC) Received: by mail-ot1-f43.google.com with SMTP id g7so12256239oti.13 for ; Mon, 22 Jun 2020 00:35:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=acinq-fr.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=VeMPtwqBThO2+VyzsKlAOVeW0CUM7UkM4Lq26n86nsc=; b=d9oUvq8B4+Ma3mSxX+/vn76LibnAM+u7aim03dgZXDMmUd3m10mkl9n6hroMKtc8y/ 5LftonLzeuTKepcFOD/dwgRr+QJ9JoYpZjlje+NtBEVG46XIEwrWlbbryOtBeboiou8o bF+DZui2T5nRlCmhLhWuacLAaAou5PCBeMMrQPgJRRu84AFcoEqxrCM3TIpHTtTupOYc /sMTW9xrGu6graFqf6N7L5L5XUhncgDgprSmSnTfdjEj8e90BfbpTTnYO1Nuav0XUdA/ VxIR7FZHDyJijY86iM2p4aMJwAShDXa7Ic5cSjXjOmuPWi1SUn8wm8OsvaZE5+GeV9rS 8lYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=VeMPtwqBThO2+VyzsKlAOVeW0CUM7UkM4Lq26n86nsc=; b=namuDTEBsUxazCnu1EUew35kXDQ+MePRNCRLBVM24su72IrMLNbJyDeAt9ExuiX9nQ 59fHuA6aOs3SwgSsgT7v5LORjCMsm/J7Vi/AQ+GPCITzrj4kgsTb3yAnqtdAbkHeK9pE 6eAt1IilPHVUixeg898XCfu8NL847D7ZpShmPS1Ivb9LJUAR3E1qmZ3rfejLaL1LgY84 R2+65t+tkJ5jccs1dbZ8AvFWA0CDzKmukPQn04SlJFHQSSiic+kzAVQ8dEMFwDE09iXM kV+oqr1EE78nT2Bq0F5J+7WGqEtyAZS4gjZGUODlpcPnigJaz1vQ8GlxPzSXkZC6tZCW ilfA== X-Gm-Message-State: AOAM533eyMdzTHVhAVFXRbuGkaUR7zVhLImUWLvfe8tPGWCoYqfo6bMg uZF9aOtq9NvDzO0cIH7zr0astKqiGoE+mFoCDgnvSVysSB4= X-Google-Smtp-Source: ABdhPJw6djHS3YgdAA5j4lgzBgF/lBAJ22wKowgXY9svJXy6cPk+C5YOHDNk2ff5xwMfKRNQiMBkz3POBARb3dGqxmk= X-Received: by 2002:a9d:6d8c:: with SMTP id x12mr12626180otp.86.1592811332022; Mon, 22 Jun 2020 00:35:32 -0700 (PDT) MIME-Version: 1.0 References: <67334082-5ABA-45C7-9C09-FF19B119C80D@mattcorallo.com> <62P_3wvv8z7AVCdKPfh-bs30-LliHkx9GI9Og3wqIK6hadIG0d6MJJm077zac1erpPUy31FqgZjkAjEl9AQtrOCg4XA5cxozBb7-OIbbgvE=@protonmail.com> <4c4f3a06-0078-ef6a-7b06-7484f0f9edf1@mattcorallo.com> <20200619195846.fclw4ilngvbbf2kk@ganymede> <20200619205220.fshbr7pbijaerbf2@ganymede> <20200620103647.g62srlcxbjqpaqj6@ganymede> In-Reply-To: <20200620103647.g62srlcxbjqpaqj6@ganymede> From: Bastien TEINTURIER Date: Mon, 22 Jun 2020 09:35:20 +0200 Message-ID: To: "David A. Harding" Content-Type: multipart/alternative; boundary="000000000000a3c3c405a8a749c4" X-Mailman-Approved-At: Mon, 22 Jun 2020 11:03:50 +0000 Cc: Bitcoin Protocol Discussion , lightning-dev Subject: Re: [bitcoin-dev] [Lightning-dev] RBF Pinning with Counterparties and Competing Interest X-BeenThere: bitcoin-dev@lists.linuxfoundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Bitcoin Protocol Discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Jun 2020 07:35:34 -0000 --000000000000a3c3c405a8a749c4 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Thanks for the detailed write-up on how it affects incentives and centralization, these are good points. I need to spend more time thinking about them. This is one reason I suggested using independent pay-to-preimage > transactions[1] > While this works as a technical solution, I think it has some incentives issues too. In this attack, I believe the miners that hide the preimage tx in their mempool have to be accomplice with the attacker, otherwise they would share that tx with some of their peers, and some non-miner nodes would get that preimage tx and be able to gossip them off-chain (and even relay them to other mempools). If they are actively helping the attacker, they wouldn't spend the pay-to-preimage tx, unless they gain more from it than the share the attacker gives them. This becomes a simple bidding war, and the honest user will always be the losing party here (the attacker has nothing to lose). For this reason I'm afraid it wouldn't work out in practice as well as we'd hope...what do you think? And even if the honest user wins the bidding war, the attack still steals money from that user; it just goes into the miner's pocket. But from the perspective of a single LN node, it > might make more sense to get the information and *not* share it > I think it depends. If this attack becomes doable in practice and we see it happening, LN routing nodes and service providers have a very high incentive to thwart these attacks, because otherwise they'd lose their business as people would leave the lightning network. As long as enough nodes think that way (with "enough" being a very hard to define quantity), this should mitigate the attack. The only risk would be a big "exit scam" scenario, but the coordination cost between all these nodes makes that scenario unlikely (IMHO). Thanks, Bastien Le sam. 20 juin 2020 =C3=A0 12:37, David A. Harding a =C3= =A9crit : > On Sat, Jun 20, 2020 at 10:54:03AM +0200, Bastien TEINTURIER wrote: > > We're simply missing information, so it looks like the only good > > solution is to avoid being in that situation by having a foot in > > miners' mempools. > > The problem I have with that approach is that the incentive is to > connect to the highest hashrate pools and ignore the long tail of > smaller pools and solo miners. If miners realize people are doing this, > they may begin to charge for information about their mempool and the > largest miners will likely be able to charge more money per hashrate > than smaller miners, creating a centralization force by increasing > existing economies of scale. > > Worse, information about a node's mempool is partly trusted. A node can > easily prove what transactions it has, but it can't prove that it > doesn't have a certain transaction. This implies incumbent pools with a > long record of trustworthy behavior may be able to charge more per > hashrate than a newer pools, creating a reputation-based centralizing > force that pushes individual miners towards well-established pools. > > This is one reason I suggested using independent pay-to-preimage > transactions[1]. Anyone who knows the preimage can mine the > transaction, so it doesn't provide reputational advantage or direct > economies of scale---pay-to-preimage is incentive equivalent to paying > normal onchain transaction fees. There is an indirect economy of > scale---attackers are most likely to send the low-feerate > preimage-containing transaction to just the largest pools, so small > miners are unlikely to learn the preimage and thus unlikely to be able > to claim the payment. However, if the defense is effective, the attack > should rarely happen and so this should not have a significant effect on > mining profitability---unlike monitoring miner mempools which would have > to be done continuously and forever. > > ZmnSCPxj noted that pay-to-preimage doesn't work with PTLCs.[2] I was > hoping one of Bitcoin's several inventive cryptographers would come > along and describe how someone with an adaptor signature could use that > information to create a pubkey that could be put into a transaction with > a second output that OP_RETURN included the serialized adaptor > signature. The pubkey would be designed to be spendable by anyone with > the final signature in a way that revealed the hidden value to the > pubkey's creator, allowing them to resolve the PTLC. But if that's > fundamentally not possible, I think we could advocate for making > pay-to-revealed-adaptor-signature possible using something like > OP_CHECKSIGFROMSTACK.[3] > > [1] > https://lists.linuxfoundation.org/pipermail/lightning-dev/2020-April/0026= 64.html > [2] > https://lists.linuxfoundation.org/pipermail/lightning-dev/2020-April/0026= 67.html > [3] https://bitcoinops.org/en/topics/op_checksigfromstack/ > > > Do you think it's unreasonable to expect at least some LN nodes to > > also invest in running nodes in mining pools, ensuring that they learn > > about attackers' txs and can potentially share discovered preimages > > with the network off-chain (by gossiping preimages found in the > > mempool over LN)? > > Ignoring my concerns about mining centralization and from the > perspective of just the Lightning Network, that doesn't sound > unreasonable to me. But from the perspective of a single LN node, it > might make more sense to get the information and *not* share it, > increasing your security and allowing you to charge lower routing fees > compared to your competitors. This effect would only be enhanced if > miners charged for their mempool contents (indeed, to maximize their > revenue, miners might require that their mempool subscribers don't share > the information---which they could trivially enforce by occasionally > sending subscribers a preimage specific to the subscriber and seeing if > it propagated to the public network). > > > I think that these recent attacks show that we need (at least some) > > off-chain nodes to be somewhat heavily invested in on-chain operations > > (layers can't be fully decoupled with the current security assumptions > > - maybe Eltoo will help change that in the future?). > > I don't see how eltoo helps. Eltoo helps ensure you reach the final > channel state, but this problem involves an abuse of that final state. > > -Dave > --000000000000a3c3c405a8a749c4 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Thanks for the detailed write-up on how it affects incenti= ves and centralization,
these are good points. I need to spend more tim= e thinking about them.

This is one reason I suggested using independent pay-to-preimag= e
transactions[1]

While this works a= s a technical solution, I think it has some incentives issues too.
In this attack, I believe the miners that hide the preimage tx in their m= empool have
to be accomplice with the attacker, otherwise they wo= uld share that tx with some of
their peers, and some non-miner no= des would get that preimage tx and be able to
gossip them off-cha= in (and even relay them to other mempools).

If the= y are actively helping the attacker, they wouldn't spend the pay-to-pre= image tx,
unless they gain more from it than the share the attack= er gives them. This becomes
a simple bidding war, and the honest = user will always be the losing party here (the
attacker=C2=A0has = nothing to lose). For this reason I'm afraid it wouldn't work out i= n practice
as well as we'd hope...what do you think? And even= if the honest user wins the bidding
war, the attack still steals= money from that user; it just goes into the miner's pocket.
=
But from = the perspective of a single LN node, it
might make more sense to get the= information and *not* share it

I think= it depends. If this attack becomes doable in practice and we see it happen= ing,
LN routing nodes and service providers have a very high ince= ntive to thwart these attacks,
because otherwise they'd lose = their business as people would leave the lightning network.

<= /div>
As long as enough nodes think that way (with "enough" b= eing a very hard to define quantity),=C2=A0
this should mitigate = the attack. The only risk would be a big "exit scam" scenario, bu= t the
coordination cost between all these nodes makes that scenar= io unlikely (IMHO).

Thanks,
Bastien

Le=C2=A0sam. 20 juin 2020 =C3=A0=C2=A012:37, David A. Harding <dave@dtrt.org> a =C3=A9crit=C2=A0:
On Sat, Jun 20, 2020 at= 10:54:03AM +0200, Bastien TEINTURIER wrote:
> We're simply missing information, so it looks like the only good > solution is to avoid being in that situation by having a foot in
> miners' mempools.

The problem I have with that approach is that the incentive is to
connect to the highest hashrate pools and ignore the long tail of
smaller pools and solo miners.=C2=A0 If miners realize people are doing thi= s,
they may begin to charge for information about their mempool and the
largest miners will likely be able to charge more money per hashrate
than smaller miners, creating a centralization force by increasing
existing economies of scale.

Worse, information about a node's mempool is partly trusted.=C2=A0 A no= de can
easily prove what transactions it has, but it can't prove that it
doesn't have a certain transaction.=C2=A0 This implies incumbent pools = with a
long record of trustworthy behavior may be able to charge more per
hashrate than a newer pools, creating a reputation-based centralizing
force that pushes individual miners towards well-established pools.

This is one reason I suggested using independent pay-to-preimage
transactions[1].=C2=A0 Anyone who knows the preimage can mine the
transaction, so it doesn't provide reputational advantage or direct
economies of scale---pay-to-preimage is incentive equivalent to paying
normal onchain transaction fees.=C2=A0 There is an indirect economy of
scale---attackers are most likely to send the low-feerate
preimage-containing transaction to just the largest pools, so small
miners are unlikely to learn the preimage and thus unlikely to be able
to claim the payment.=C2=A0 However, if the defense is effective, the attac= k
should rarely happen and so this should not have a significant effect on mining profitability---unlike monitoring miner mempools which would have to be done continuously and forever.

ZmnSCPxj noted that pay-to-preimage doesn't work with PTLCs.[2]=C2=A0 I= was
hoping one of Bitcoin's several inventive cryptographers would come
along and describe how someone with an adaptor signature could use that
information to create a pubkey that could be put into a transaction with a second output that OP_RETURN included the serialized adaptor
signature.=C2=A0 The pubkey would be designed to be spendable by anyone wit= h
the final signature in a way that revealed the hidden value to the
pubkey's creator, allowing them to resolve the PTLC.=C2=A0 But if that&= #39;s
fundamentally not possible, I think we could advocate for making
pay-to-revealed-adaptor-signature possible using something like
OP_CHECKSIGFROMSTACK.[3]

[1] https://lists.li= nuxfoundation.org/pipermail/lightning-dev/2020-April/002664.html
[2] https://lists.li= nuxfoundation.org/pipermail/lightning-dev/2020-April/002667.html
[3] https://bitcoinops.org/en/topics/op_check= sigfromstack/

> Do you think it's unreasonable to expect at least some LN nodes to=
> also invest in running nodes in mining pools, ensuring that they learn=
> about attackers' txs and can potentially share discovered preimage= s
> with the network off-chain (by gossiping preimages found in the
> mempool over LN)?

Ignoring my concerns about mining centralization and from the
perspective of just the Lightning Network, that doesn't sound
unreasonable to me.=C2=A0 But from the perspective of a single LN node, it<= br> might make more sense to get the information and *not* share it,
increasing your security and allowing you to charge lower routing fees
compared to your competitors.=C2=A0 This effect would only be enhanced if miners charged for their mempool contents (indeed, to maximize their
revenue, miners might require that their mempool subscribers don't shar= e
the information---which they could trivially enforce by occasionally
sending subscribers a preimage specific to the subscriber and seeing if
it propagated to the public network).

> I think that these recent attacks show that we need (at least some) > off-chain nodes to be somewhat heavily invested in on-chain operations=
> (layers can't be fully decoupled with the current security assumpt= ions
> - maybe Eltoo will help change that in the future?).

I don't see how eltoo helps.=C2=A0 Eltoo helps ensure you reach the fin= al
channel state, but this problem involves an abuse of that final state.

-Dave
--000000000000a3c3c405a8a749c4--