[prev in list] [next in list] [prev in thread] [next in thread] 

List:       bitcoin-dev
Subject:    Re: [bitcoin-dev] Bitcoin Transaction Relay over Nostr
From:       Greg Sanders via bitcoin-dev <bitcoin-dev () lists ! linuxfoundation ! org>
Date:       2023-05-30 13:30:32
Message-ID: CAB3F3DuoOdTAypfqptU94E_j4oNJuBwZHPifo8mmDxTOaSeyNQ () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Hi Joost, David,

In my mind, weak blocks' main benefit would be that it improves block relay
by giving PoW-hints on what are in miner's mempools. Non-standard
transactions could even be cached(even if not validated until block
inclusion), which would tolerate more heterogeneity in policies without
drastically increasing relay times. Of course, it can also have the side
effect of gossiping better transaction packages, though I think this would
be a ton of work to really take advantage of. Perhaps we might be able to
do better in a post-cluster-mempool world, gossiping chunks.

At present I think energy would be best spent writing a weak blocks BIP
proposal, since one has never been written before(?), and it would be
fairly trivial to swap out p2p things with RPC calls if so desired for fast
experimentation over alternative relays.

Cheers,
Greg



On Tue, May 30, 2023 at 8:58 AM Joost Jager via bitcoin-dev <
bitcoin-dev@lists.linuxfoundation.org> wrote:

> Hi David,
>
>
>> 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.
>>
>
> Interesting idea! This would also make it easy for external services to
> try to do the best possible block building using advanced algorithms.
> Miners would just select the best template available from various sources
> including nostr.
>
>
>> 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.
>>
>
> I believe this would be useful right away, wouldn't it? Looking at
> mempool.space's block audit, there are definitely blocks that have a
> "surprising" content and might take long to download.
>
> The anti-dos measures that you describe for both weak blocks and block
> templates seem very robust, but they would require a more intelligent nostr
> relay to enforce. Not sure if it is still allowed to call it nostr at that
> point. Perhaps it becomes more of a specialised bitcoin relay. btcstr -
> "bitcoin stuff transmitted by relays".
>
> 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.)
>>
>
> Sounds like a great way to repurpose what already exists to reduce
> resource usage for these additional message types.
>
>
>> 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!
>>
>
> I think so too! The main question on my mind though is how to actually
> make this work. There is a bit of a chicken-egg problem here with users and
> miners possibly waiting for each other to adopt.
>
> Joost
> _______________________________________________
> bitcoin-dev mailing list
> bitcoin-dev@lists.linuxfoundation.org
> https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev
>

[Attachment #5 (text/html)]

<div dir="ltr">Hi Joost, David,<div><br></div><div>In my mind, weak blocks&#39; main \
benefit would be that it improves block relay by giving PoW-hints on what are in \
miner&#39;s mempools. Non-standard transactions could even be cached(even if not \
validated until block inclusion), which would tolerate more heterogeneity  in \
policies without drastically increasing relay times. Of course, it can also have the \
side effect of gossiping better transaction packages, though I think this would be a \
ton of work to really take advantage of. Perhaps we might be able to do better in a \
post-cluster-mempool world, gossiping chunks.</div><div><br></div><div>At present I \
think energy would be best spent writing a weak blocks BIP proposal, since one has \
never been written before(?), and it would be fairly trivial to swap out p2p things \
with RPC calls if so desired for fast experimentation over alternative \
relays.</div><div><br></div><div>Cheers,</div><div>Greg</div><div><br></div><div><br></div></div><br><div \
class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, May 30, 2023 at \
8:58 AM Joost Jager via bitcoin-dev &lt;<a \
href="mailto:bitcoin-dev@lists.linuxfoundation.org">bitcoin-dev@lists.linuxfoundation.org</a>&gt; \
wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px \
0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div \
class="gmail_quote"><div>Hi David,<br>  </div><blockquote class="gmail_quote" \
style="margin:0px 0px 0px 0.8ex;border-left:1px solid \
rgb(204,204,204);padding-left:1ex"> A block template is an ordered list of raw \
transactions that can all be<br> included in the next block (with some space reserved \
for a coinbase<br> transaction).   A full node can validate those transactions and \
calculate<br> how much fee they pay.   A Nostr relay can simply relay almost[1] \
any<br> template that pays more fees than the previous best template it saw for<br>
the next block.   That can be more flexible than the current<br>
implementation of submitblock with package relay which still enforces a<br>
lot of the rules that helps keep a regular relay node safe from DoS and<br>
a miner node able to select mineable transactions \
quickly.<br></blockquote><div><br></div><div>Interesting idea! This would also make \
it easy for external services to try to do the best possible block building using \
advanced algorithms. Miners would just select the best template available from \
various sources including nostr.</div><div>  </div><blockquote class="gmail_quote" \
style="margin:0px 0px 0px 0.8ex;border-left:1px solid \
rgb(204,204,204);padding-left:1ex"> A weak block is a block whose header doesn&#39;t \
quite hash to low enough of<br> a value to be included on the chain.   It still takes \
an extraordinary<br> amount of hashrate to produce, so it&#39;s inherently DoS \
resistant.   If<br> miners are producing block that include transactions not seen by \
typical<br> relay nodes, that can reduce the efficiency and effectiveness of \
BIP152<br> compact block relay, which hurts the profitability of miners of custom<br>
blocks.   To compensate, miners could relay weak blocks through Nostr to<br>
full nodes and other miners so that they could quickly relay and accept<br>
complete blocks that later included the same custom transactions.   This<br>
would also help fee estimation and provide valuable insights to those<br>
trying to get their transactions included into the next \
block.<br></blockquote><div><br></div><div>I believe this would be useful right away, \
wouldn&#39;t it? Looking at <a href="http://mempool.space" \
target="_blank">mempool.space</a>&#39;s block audit, there are definitely blocks that \
have a &quot;surprising&quot; content and might take long to download.</div><div>  \
</div><div>The anti-dos measures that you describe for both weak blocks and block \
templates seem very robust, but they would require a more intelligent nostr relay to \
enforce. Not sure if it is still allowed to call it nostr at that point. Perhaps it \
becomes more of a specialised bitcoin relay. btcstr - &quot;bitcoin stuff transmitted \
by relays&quot;.</div><div><br></div><blockquote class="gmail_quote" \
style="margin:0px 0px 0px 0.8ex;border-left:1px solid \
rgb(204,204,204);padding-left:1ex"> Regarding size, the block template and weak block \
could both be sent in<br> BIP152 compact block format as a diff against the expected \
contents of a<br> typical node, allowing Alice to send just a small amount of \
additional<br> data for relay over what she&#39;d have to send anyway for each \
transaction<br> in a package.   (Although it&#39;s quite possible that BetterHash or \
Stratum<br> v2 have even better solutions, possibly already \
implemented.)<br></blockquote><div><br></div><div>Sounds like a great way to \
repurpose what already exists to reduce resource usage for these additional message \
types.</div><div>  <br></div><blockquote class="gmail_quote" style="margin:0px 0px \
0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"> If nothing else, \
I think Nostr could provide an interesting playground<br> for experimenting with \
various relay and mining ideas we&#39;ve talked about<br> for years, so thanks again \
for working on this!<br></blockquote><div><br></div><div>I think so too! The main \
question on my mind though is how to actually make this work. There is a bit of a \
chicken-egg problem here with users and miners possibly waiting for each other to \
adopt.</div><div><br></div><div>Joost  </div></div></div> \
_______________________________________________<br> bitcoin-dev mailing list<br>
<a href="mailto:bitcoin-dev@lists.linuxfoundation.org" \
target="_blank">bitcoin-dev@lists.linuxfoundation.org</a><br> <a \
href="https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev" \
rel="noreferrer" target="_blank">https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev</a><br>
 </blockquote></div>



_______________________________________________
bitcoin-dev mailing list
bitcoin-dev@lists.linuxfoundation.org
https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic