Skip to content

Commit 875c97c

Browse files
committed
Topcis: add multiple topics for Newsletter 283
1 parent 3acd779 commit 875c97c

File tree

6 files changed

+454
-9
lines changed

6 files changed

+454
-9
lines changed

_posts/en/newsletters/2024-01-03-newsletter.md

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ infrastructure.
7171
confirmed at an acceptable feerate.
7272

7373
Law notes that this addresses one of the longstanding concerns noted
74-
in the [original Lightning Network paper][] about _forced expiration
75-
floods_ where too many channels all closing simultaneously may
74+
in the [original Lightning Network paper][] about [forced expiration
75+
floods][topic expiration floods] where too many channels all closing simultaneously may
7676
result in insufficient block space for all of them to be
7777
confirmed before their timelocks expire, potentially resulting in
7878
some users losing money. With fee-dependent timelocks in place,
@@ -111,7 +111,7 @@ infrastructure.
111111
- **Cluster fee estimation:** Abubakar Sadiq Ismail [posted][ismail
112112
cluster] to Delving Bitcoin about using some of the tools and insights
113113
from the design of [cluster mempool][topic cluster mempool] to improve
114-
fee estimation in Bitcoin Core. The current fee estimation algorithm
114+
[fee estimation][topic fee estimation] in Bitcoin Core. The current fee estimation algorithm
115115
in Bitcoin Core tracks the number of blocks it takes for transactions
116116
entering the local node's mempool to become confirmed. When
117117
confirmation happens, the transaction's feerate is used to update a
@@ -229,10 +229,9 @@ infrastructure.
229229
- **Verification of arbitrary programs using proposed opcode from MATT:**
230230
Johan Torås Halseth [posted][halseth ccv] to Delving Bitcoin about
231231
[elftrace][], a proof of concept program that can use the
232-
`OP_CHECKCONTRACTVERIFY` opcode from the [MATT][] soft fork proposal
233-
to allow a party in a contract protocol to claim money if an arbitrary
234-
program executed successfully. It is similar in concept to BitVM (see
235-
[Newsletter #273][news273 bitvm]) but simpler in its Bitcoin
232+
`OP_CHECKCONTRACTVERIFY` opcode from the [MATT][topic matt] soft fork proposal
233+
to allow a party in a contract protocol to [claim money][topic acc] if an arbitrary
234+
program executed successfully. It is similar in concept to [BitVM][topic acc] but simpler in its Bitcoin
236235
implementation due to using an opcode specifically designed for
237236
program execution verification. Elftrace works with programs compiled
238237
for the RISC-V architecture using Linux's [ELF][] format; almost any
@@ -288,7 +287,7 @@ infrastructure.
288287
constructing party. Ingala roughly describes how this feature could
289288
be added to a multiparty contract protocol using [OP_CAT][],
290289
`OP_CHECKCONTRACTVERIFY`, and amount introspection from the proposed
291-
[MATT][] soft fork, with him noting that it would be easier with the
290+
[MATT][topic matt] soft fork, with him noting that it would be easier with the
292291
addition also of [OP_CSFS][topic op_checksigfromstack] and 64-bit
293292
arithmetic operators in [tapscript][topic tapscript].
294293

@@ -405,7 +404,6 @@ Proposals (BIPs)][bips repo], [Lightning BOLTs][bolts repo], and
405404
[black descpsbt]: https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2023-November/022186.html
406405
[halseth ccv]: https://delvingbitcoin.org/t/verification-of-risc-v-execution-using-op-ccv/313
407406
[elftrace]: https://github.com/halseth/elftrace
408-
[matt]: /en/newsletters/2022/11/16/#general-smart-contracts-in-bitcoin-via-covenants
409407
[news273 bitvm]: /en/newsletters/2023/10/18/#payments-contingent-on-arbitrary-computation
410408
[elf]: https://en.m.wikipedia.org/wiki/Executable_and_Linkable_Format
411409
[ingala exit]: https://delvingbitcoin.org/t/aggregate-delegated-exit-for-l2-pools/297

_topics/en/acc.md

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
---
2+
title: Accountable Computing Contracts
3+
4+
## Optional. Shorter name to use for reference style links e.g., "foo"
5+
## will allow using the link [topic foo][]. Not case sensitive
6+
shortname: ACC
7+
8+
## Optional. An entry will be added to the topics index for each alias
9+
aliases:
10+
- BitVM
11+
- Zero-Knowledge Contingent Payments (ZKCP)
12+
13+
## Required. At least one category to which this topic belongs. See
14+
## schema for options
15+
categories:
16+
- Contract Protocols
17+
18+
## Optional. Produces a Markdown link with either "[title][]" or
19+
## "[title](link)"
20+
#primary_sources:
21+
# - title: Test
22+
# - title: Example
23+
# link: https://example.com
24+
25+
## Optional. Each entry requires "title" and "url". May also use "feature:
26+
## true" to bold entry and "date"
27+
optech_mentions:
28+
- title: ZKCP versus standardized atomic data delivery following LN payments
29+
url: /en/newsletters/2019/07/03/#standardized-atomic-data-delivery-following-ln-payments
30+
31+
- title: "BitVM: payments contingent on arbitrary computation without consensus changes"
32+
url: /en/newsletters/2023/10/18/#payments-contingent-on-arbitrary-computation
33+
34+
- title: "Publication of two BitVM proof of concepts"
35+
url: /en/newsletters/2023/11/22/#bitvm-proof-of-concepts
36+
37+
- title: Proposal for general smart contracts in Bitcoin via covenants
38+
url: /en/newsletters/2022/11/16/#general-smart-contracts-in-bitcoin-via-covenants
39+
40+
- title: Verification of arbitrary programs using proposed opcode from MATT
41+
url: /en/newsletters/2024/01/03/#verification-of-arbitrary-programs-using-proposed-opcode-from-matt
42+
43+
## Optional. Same format as "primary_sources" above
44+
see_also:
45+
- title: "Merklize All The Things (MATT)"
46+
link: topic matt
47+
48+
## Optional. Force the display (true) or non-display (false) of stub
49+
## topic notice. Default is to display if the page.content is below a
50+
## threshold word count
51+
#stub: false
52+
53+
## Required. Use Markdown formatting. Only one paragraph. No links allowed.
54+
## Should be less than 500 characters
55+
excerpt: >
56+
**Accountable Computing Contracts (ACC)** are payments
57+
that the receiving party can spend if they verifiably run a specified
58+
function on a specified set of inputs. If the receiving party doesn't
59+
run the function or doesn't run it correctly, the paying party can
60+
reclaim the payment after a period of time.
61+
62+
---
63+
For example, Alice claims she has a solution to a puzzle. Bob wants to
64+
buy the solution to the puzzle, but Alice is unwilling to give him a
65+
solution until she's guaranteed to receive a payment. Bob is similarly
66+
unwilling to pay Alice until he's sure the solution is correct. They
67+
decide to write a program that will return true if it verifies the
68+
solution is correct. Then Bob pays money to a transaction output that
69+
will allow Alice to claim the money if she provides a solution that was
70+
verified by the program. If the solution is incorrect, either Alice's
71+
spend will be invalid or she will need to pay a penalty that is equal to
72+
or greater than the amount of the payment.
73+
74+
There have been several proposals and implementations of this idea for
75+
Bitcoin:
76+
77+
- [Zero-Knowledge Contingent Payments][zkcp] (ZKCPs) allow Alice to
78+
prove that she ran the program on her puzzle solution and that the
79+
solution has a particular hash digest. Bob can then create an
80+
[HTLC][topic HTLC] that pays Alice if she discloses the preimage for
81+
that hash digest. If Alice doesn't disclose it, Bob can reclaim his
82+
funds after the HTLC timelock expires.
83+
84+
- [BitVM][] allows Bob to deposit money into a contract that
85+
compactly references the program they're using for verification.
86+
Alice can then provide the solution. If Bob is satisfied, he releases
87+
the money to Alice. If he fails to take action, Alice can claim the
88+
money after a period of time. If he isn't satisfied, he can challenge
89+
Alice to prove that their program returns true when run on her
90+
solution, breaking the challenge into multiple steps that each require
91+
an onchain transaction. BitVM is available on Bitcoin today.
92+
93+
- [MATT][topic matt] works similar to BitVM, although it requires a soft
94+
fork. As a tradeoff, it can be much more efficient than BitVM due to
95+
changing the consensus rules to make this type of proving
96+
efficient.
97+
98+
{% include references.md %}
99+
{% include linkers/issues.md issues="" %}
100+
[zkcp]: https://bitcoincore.org/en/2016/02/26/zero-knowledge-contingent-payments-announcement/
101+
[bitvm]: /en/newsletters/2023/10/18/#payments-contingent-on-arbitrary-computation

_topics/en/ark.md

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
---
2+
title: Ark
3+
4+
## Optional. Shorter name to use for reference style links e.g., "foo"
5+
## will allow using the link [topic foo][]. Not case sensitive
6+
# shortname: foo
7+
8+
## Optional. An entry will be added to the topics index for each alias
9+
#aliases:
10+
# - Foo
11+
12+
## Required. At least one category to which this topic belongs. See
13+
## schema for options
14+
categories:
15+
- Contract Protocols
16+
17+
## Optional. Produces a Markdown link with either "[title][]" or
18+
## "[title](link)"
19+
primary_sources:
20+
- title: "Basis Of Ark Technology (BOATs)"
21+
link: https://github.com/ark-network/boats
22+
23+
## Optional. Each entry requires "title" and "url". May also use "feature:
24+
## true" to bold entry and "date"
25+
optech_mentions:
26+
- title: Proposal for a managed joinpool protocol
27+
url: /en/newsletters/2023/05/31/#proposal-for-a-managed-joinpool-protocol
28+
feature: true
29+
30+
- title: Improving LN scalability with covenants in a similar way to Ark
31+
url: /en/newsletters/2023/09/27/#using-covenants-to-improve-ln-scalability
32+
33+
## Optional. Same format as "primary_sources" above
34+
see_also:
35+
- title: Joinpools
36+
link: topic joinpools
37+
38+
- title: Covenants
39+
link: topic covenants
40+
41+
## Optional. Force the display (true) or non-display (false) of stub
42+
## topic notice. Default is to display if the page.content is below a
43+
## threshold word count
44+
#stub: false
45+
46+
## Required. Use Markdown formatting. Only one paragraph. No links allowed.
47+
## Should be less than 500 characters
48+
excerpt: >
49+
**Ark** is a trustless joinpool-style protocol where a large number
50+
of users share a UTXO by accepting a counterparty as a co-signer on
51+
all transactions within a certain time period. This spreads the cost
52+
of onchain fees from using that UTXO across many users, minimizing
53+
their individual costs.
54+
55+
---
56+
The users can either unilaterally withdraw their bitcoins onchain
57+
after the expiry of the time period or instantly and trustlessly
58+
transfer them offchain to the counterparty before the end of the time
59+
period. Normally, a user will simply roll their bitcoins into another
60+
contract with the counterparty, which can be highly fee efficient when
61+
done with many other users at the same time. Alternatively, the
62+
counterparty may help the user make a payment onchain, through LN, or
63+
through any other protocol supported by the counterparty. Presumably,
64+
the counterparty would pass along to the user any fees the
65+
counterparty had to pay for using the payment protocol, e.g.
66+
forwarding fees if LN was used.
67+
68+
Ark can be implemented on Bitcoin with no consensus changes required,
69+
but it will support a larger number of users---making it much more fee
70+
efficient---if a [covenant][topic covenants] feature is added to
71+
Bitcoin.
72+
73+
{% include references.md %}
74+
{% include linkers/issues.md issues="" %}

_topics/en/expiration-floods.md

Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
---
2+
title: Expiration floods
3+
4+
## Optional. Shorter name to use for reference style links e.g., "foo"
5+
## will allow using the link [topic foo][]. Not case sensitive
6+
# shortname: foo
7+
8+
## Optional. An entry will be added to the topics index for each alias
9+
aliases:
10+
- Forced expiration spam
11+
- Flood and loot
12+
13+
## Required. At least one category to which this topic belongs. See
14+
## schema for options
15+
categories:
16+
- Contract Protocols
17+
- Lightning Network
18+
- Security Problems
19+
- Security Enhancements
20+
21+
## Optional. Produces a Markdown link with either "[title][]" or
22+
## "[title](link)"
23+
primary_sources:
24+
- title: "The Bitcoin Lightning Network: Scalable Off-Chain Instant Payments"
25+
link: https://lightning.network/lightning-network-paper.pdf
26+
27+
- title: "Flood & Loot: A Systemic Attack On The Lightning Network"
28+
link: https://arxiv.org/abs/2006.08513
29+
30+
## Optional. Each entry requires "title" and "url". May also use "feature:
31+
## true" to bold entry and "date"
32+
optech_mentions:
33+
- title: LN developer discussion about flood and loot attacks
34+
url: /en/newsletters/2020/08/05/#chicago-meetup-discussion
35+
36+
- title: Concern about forced expiration spam in very large channel factories
37+
url: /en/newsletters/2023/09/27/#using-covenants-to-improve-ln-scalability
38+
39+
- title: Mitigating expiration floods with fee-depedent timelocks
40+
url: /en/newsletters/2024/01/03/#fee-dependent-timelocks
41+
42+
## Optional. Same format as "primary_sources" above
43+
see_also:
44+
- title: HTLCs
45+
link: topic htlc
46+
47+
- title: PTLCs
48+
link: topic ptlc
49+
50+
## Optional. Force the display (true) or non-display (false) of stub
51+
## topic notice. Default is to display if the page.content is below a
52+
## threshold word count
53+
#stub: false
54+
55+
## Required. Use Markdown formatting. Only one paragraph. No links allowed.
56+
## Should be less than 500 characters
57+
excerpt: >
58+
**Expiration floods** occur when many timelock-contingent payments
59+
need to be settled onchain within a limited period of time. If not
60+
all of the settlement transactions can fit into blocks before
61+
timelocks begin expiring, then not all of the contingent payments will
62+
resolve as expected, likely resulting in some users losing money.
63+
64+
---
65+
For example, Mallory runs a very popular LN node with many users. Each
66+
channel has the maximum-allowed number of incoming and outgoing pending
67+
[HTLCs][topic htlc], making the cost to resolve each of those channels
68+
onchain around 100,000 vbytes. A full block can only fit about 10 of
69+
those channels. If the most critical [timelocks][topic timelocks] on
70+
some of the HTLCs might expire in 10 blocks or less, Mallory can force
71+
close more than 100 of those channels to eliminate the guarantee that
72+
her honest counterparties will receive their money.
73+
74+
Although an expiration flood can be triggered deliberately by a
75+
malicious counterparty, it can also happen accidentally either by
76+
coincidence or by a situation that causes many users to attempt to close
77+
their channels simultaneously, e.g. a bug in a software implementation.
78+
In the accidental case, some honest users will get their money and other
79+
honest users may not, even though they all followed the protocol
80+
correctly.
81+
82+
Expiration floods were described in the original [Lightning Network
83+
paper][] under the name **forced expiration spam**. A later
84+
[paper][flood and loot] called the attack **flood and loot**. Concern
85+
about expiration floods has heavily influenced the development of LN and
86+
other offchain protocols.
87+
88+
Mitigations that don't require consensus changes include:
89+
90+
- **Minimizing onchain enforcement data:** designing protocols and
91+
setting limits so that timelock-contingent payments are small. For
92+
example, many LN implementations default to accepting and creating
93+
much less than the protocol-allowed maximum number of pending HTLCs.
94+
(That also helps mitigate other attacks.)
95+
96+
- **Using long timelocks when possible:** in our example above, Mallory
97+
needs to close at least 100 channels with 10-block timelocks. If the
98+
timelocks were 100 blocks, she'd need to close 1,000 channels
99+
simultaneously. It would take more effort on her part to find that
100+
many victims and get their channels into an exploitable state.
101+
102+
- **Improving counterparty decentralization:** someone who is a
103+
counterparty to 100 users has more power to execute an expiration
104+
flood attack than someone who is only counterparty to 10 users.
105+
This suggests that a less centralized distribution of counterparties
106+
might be safer against deliberately triggered expiration floods.
107+
Of course, in privacy-protecting protocols, it may be impossible to
108+
prove that two counterparties are distinct entities and not colluding.
109+
110+
Proposed mitigations that require consensus changes include:
111+
112+
- **Dynamic bounded block sizes:** this would allow miners to create larger
113+
blocks during high periods of demand so that they can confirm more
114+
transactions during an expiration flood. [Proposals][friedenbach
115+
dynamic] of this [nature][maxwell dynamic]
116+
usually require miners to pay a cost for creating higher blocks, such
117+
as destroying bitcoins or generating more proof of work. The lost
118+
bitcoins and work are expected to be compensated for by the extra fee
119+
income they will receive from confirming urgent transactions.
120+
121+
- **Fee-dependent timelocks:** [this][fdt] would prevent a timelock from
122+
expiring when feerates were above a specified amount. If too many
123+
timelock-contingent payments entered the mempool at once; the users
124+
would bid up their feerates in competition with each other to get
125+
their transactions confirmed before the regular timelocks expired.
126+
When feerates exceeded the fee-dependent timelock, expiration of those
127+
timelocks would be delayed, keeping those users safe until feerates
128+
reduced. As long as the user paid a feerate above their fee-dependent
129+
timelock amount, their transaction should confirm before the timelock
130+
expires, ensuring the user's desired transaction gets confirmed before
131+
the timelock expires.
132+
133+
{% include references.md %}
134+
{% include linkers/issues.md issues="" %}
135+
[lightning network paper]: https://lightning.network/lightning-network-paper.pdf
136+
[flood and loot]: https://arxiv.org/abs/2006.08513
137+
[friedenbach dynamic]: https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2015-May/008017.html
138+
[maxwell dynamic]: https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2015-May/008038.html
139+
[fdt]: /en/newsletters/2024/01/03/#fee-dependent-timelocks

0 commit comments

Comments
 (0)