David A. Harding [ARCHIVE] on Nostr: š
Original date posted:2023-05-27 šļø Summary of this message: A proposal ...
š
Original date posted:2023-05-27
šļø Summary of this message: A proposal suggests relaying block templates and weak blocks to improve DoS resistance and offer useful features, delegating responsibility to relays to mitigate concerns.
š Original message:On 2023-05-22 21:19, Joost Jager via bitcoin-dev wrote:
> A notable advantage of this approach is that it delegates the
> responsibility of dealing with Denial-of-Service (DoS) threats to the
> relays themselves. They could, for example, require a payment to
> mitigate such concerns.
Hi Joost,
Thanks for working on this! One quick thought I had was that a possibly
interesting avenue for exploration would be that, in addition to
relaying individual transactions or packages, it might be worth relaying
block templates and weak blocks as both of those provide inherent DoS
resistance and can offer useful features.
A block template is an ordered list of raw transactions that can all be
included in the next block (with some space reserved for a coinbase
transaction). A full node can validate those transactions and calculate
how much fee they pay. A Nostr relay can simply relay almost[1] any
template that pays more fees than the previous best template it saw for
the next block. That can be more flexible than the current
implementation of submitblock with package relay which still enforces a
lot of the rules that helps keep a regular relay node safe from DoS and
a miner node able to select mineable transactions quickly.
A weak block is a block whose header doesn't quite hash to low enough of
a value to be included on the chain. It still takes an extraordinary
amount of hashrate to produce, so it's inherently DoS resistant. If
miners are producing block that include transactions not seen by typical
relay nodes, that can reduce the efficiency and effectiveness of BIP152
compact block relay, which hurts the profitability of miners of custom
blocks. To compensate, miners could relay weak blocks through Nostr to
full nodes and other miners so that they could quickly relay and accept
complete blocks that later included the same custom transactions. This
would also help fee estimation and provide valuable insights to those
trying to get their transactions included into the next block.
Regarding size, the block template and weak block could both be sent in
BIP152 compact block format as a diff against the expected contents of a
typical node, allowing Alice to send just a small amount of additional
data for relay over what she'd have to send anyway for each transaction
in a package. (Although it's quite possible that BetterHash or Stratum
v2 have even better solutions, possibly already implemented.)
If nothing else, I think Nostr could provide an interesting playground
for experimenting with various relay and mining ideas we've talked about
for years, so thanks again for working on this!
-Dave
[1] In addition to validating transactions, a relay would probably want
to reject templates that contained transactions that took
excessively long to validate (which could cause a block including
them to become stale) or that included features reserved for
upgrades (as a soft fork that happened before the relay's node was
upgraded might make that block invalid).
Published at
2023-06-07 23:22:01Event JSON
{
"id": "6d6c7a41fcd672a9a0e2c57b0cf1a3767c7da7968575e02dfacfdda52db97c5b",
"pubkey": "d3574a24208f4e3d0821bb4a69a0c3ae842043d444fa5c4a8c49c369918a6fb2",
"created_at": 1686180121,
"kind": 1,
"tags": [
[
"e",
"ff7b0d9c2eb48b739a6f9c60e69ef08c7a82bedb306dc1c44f964ba4bef01540",
"",
"root"
],
[
"e",
"e9d4850e72cf8ffede6cc2886fa9f468e0e775e5b45cb04f735fac057cb7d428",
"",
"reply"
],
[
"p",
"ec3fb08b335b94aace30d13181f2ad0280df9bc34f1a99832c4e2da8fb125eb3"
]
],
"content": "š
Original date posted:2023-05-27\nšļø Summary of this message: A proposal suggests relaying block templates and weak blocks to improve DoS resistance and offer useful features, delegating responsibility to relays to mitigate concerns.\nš Original message:On 2023-05-22 21:19, Joost Jager via bitcoin-dev wrote:\n\u003e A notable advantage of this approach is that it delegates the\n\u003e responsibility of dealing with Denial-of-Service (DoS) threats to the\n\u003e relays themselves. They could, for example, require a payment to\n\u003e mitigate such concerns.\n\nHi Joost,\n\nThanks for working on this! One quick thought I had was that a possibly\ninteresting avenue for exploration would be that, in addition to\nrelaying individual transactions or packages, it might be worth relaying\nblock templates and weak blocks as both of those provide inherent DoS\nresistance and can offer useful features.\n\nA block template is an ordered list of raw transactions that can all be\nincluded in the next block (with some space reserved for a coinbase\ntransaction). A full node can validate those transactions and calculate\nhow much fee they pay. A Nostr relay can simply relay almost[1] any\ntemplate that pays more fees than the previous best template it saw for\nthe next block. That can be more flexible than the current\nimplementation of submitblock with package relay which still enforces a\nlot of the rules that helps keep a regular relay node safe from DoS and\na miner node able to select mineable transactions quickly.\n\nA weak block is a block whose header doesn't quite hash to low enough of\na value to be included on the chain. It still takes an extraordinary\namount of hashrate to produce, so it's inherently DoS resistant. If\nminers are producing block that include transactions not seen by typical\nrelay nodes, that can reduce the efficiency and effectiveness of BIP152\ncompact block relay, which hurts the profitability of miners of custom\nblocks. To compensate, miners could relay weak blocks through Nostr to\nfull nodes and other miners so that they could quickly relay and accept\ncomplete blocks that later included the same custom transactions. This\nwould also help fee estimation and provide valuable insights to those\ntrying to get their transactions included into the next block.\n\nRegarding size, the block template and weak block could both be sent in\nBIP152 compact block format as a diff against the expected contents of a\ntypical node, allowing Alice to send just a small amount of additional\ndata for relay over what she'd have to send anyway for each transaction\nin a package. (Although it's quite possible that BetterHash or Stratum\nv2 have even better solutions, possibly already implemented.)\n\nIf nothing else, I think Nostr could provide an interesting playground\nfor experimenting with various relay and mining ideas we've talked about\nfor years, so thanks again for working on this!\n\n-Dave\n\n[1] In addition to validating transactions, a relay would probably want\n to reject templates that contained transactions that took\n excessively long to validate (which could cause a block including\n them to become stale) or that included features reserved for\n upgrades (as a soft fork that happened before the relay's node was\n upgraded might make that block invalid).",
"sig": "49737dd02e42b0409cfb0149a1feab2d7a46b8197539d11f36901e05ed396a47cc29f3a30d3b2a9236eb0cb28638dc2a3f32d7969ab6668c05cb95a2a02b0bd8"
}