Re: [bitcoin-dev] New transaction policies (nVersion=3) for contracting protocols

2022-09-30 Thread Greg Sanders via bitcoin-dev
It's likely better if the ephemeral output can be any value, including
dust. This lets contract designers put "trimmed output" value indirectly
towards CPFP fees without making the parent tx have fees itself.

On Fri, Sep 30, 2022, 8:08 AM Bastien TEINTURIER  wrote:

> Hey Ruben,
>
> I discussed this further over IRC, and I now agree that this particular
> change would be very desirable and can likely fit in the initial release
> (even though I'm not the one writing that code, but I'd be happy to
> review it and test it).
>
> Greg already has a draft design that addresses your concerns: if there is
> an "ephemeral output" (0-value, OP_TRUE) in an unconfirmed v3 transaction,
> it MUST be spent by any child v3 transaction. This way, you ensure that
> any child transaction spending the unconfirmed parent spends the ephemeral
> output(s). @Greg, correct me if I misunderstood something here. Note that
> we will need to precisely define the criteria for those "ephemeral outputs"
> (it can probably simply be "outputs that are 0 sats").
>
> Coupled with transactions that pay no fees (and thus require a child to
> CPFP in order to be included in a block), this ensures those outputs can
> never leak into the utxo set. How does that sound?
>
> I'm curious why you would need more than one such output, can you detail?
> I believe we only ever need one, spendable by anyone.
>
> Cheers,
> Bastien
>
> Le ven. 30 sept. 2022 à 02:14, Ruben Somsen  a écrit :
>
>> Hi Bastien,
>>
>> >The other change mentioned (making OP_TRUE standard and allowing outputs
>> that are below dust) can be added later, as those won't be standard until
>> we start allowing them, so there shouldn't be any backwards-compatibility
>> issue with postponing this change. But maybe it's still worth having from
>> the get-go, even though it may take a bit more time? Again, I'm curious to
>> have other people's opinion here
>>
>> I'm sensitive to not wanting to overload the current discussion but this
>> also interests me, provided it can be done in a way that is acceptable
>> (i.e. minimizing the potential UTXO set impact). It would solve a big cost
>> issue in my spacechains design if transactions could be 0 fees and have a 0
>> sat output that could be used in order to pay all the fees with CPFP.
>>
>> My current view is that a tx containing a single 0 sat OP_TRUE output
>> should only get relayed if it is a package where the OP_TRUE output is
>> currently being spent in a way that increases the overall fee rate. But
>> even then, one theoretical edge case remains:
>> - Another CPFP tx can feebump the package on a different (non-OP_TRUE)
>> output with an even higher fee rate
>> - Subsequently, the tx that is spending the OP_TRUE might fall out of the
>> mempool if the mempool fee rate rises
>> - This could cause the 0 sat output to enter the UTXO set (specifically,
>> rational miners wouldn't refuse to mine such a tx)
>>
>> It doesn't seem like this would happen much in practice (nor is there an
>> incentive to do it on purpose), but the chance isn't 0.
>>
>> Cheers,
>> Ruben
>>
>>
>>
>> On Thu, Sep 29, 2022 at 4:50 PM Greg Sanders via bitcoin-dev <
>> bitcoin-dev@lists.linuxfoundation.org> wrote:
>>
>>> > Right, good catch, this does require new logic to handle this case.
>>> As Gloria points out, this should be doable, and is definitely worth
>>> adding (those CSV 1 on every other output are really hacky, glad to
>>> find a way to get rid of them).
>>>
>>> For the record, it turns out ephemeral anchors + v3 solves this already,
>>> as the anchor must be spent, and the parent tx may only have one child.
>>> Somehow I missed this implication for a few months. It's great news if we
>>> can directly source fees from any output claimable, including HTLCs!
>>>
>>> On Thu, Sep 29, 2022 at 5:15 AM Bastien TEINTURIER 
>>> wrote:
>>>
 Hi Gloria, Greg,

 > I interpret most of the discussion around limitations as ideas for
 > future improvements rather than criticisms of the proposal

 As far as I'm concerned, definitely!

 My current understanding is that the main change/improvement that would
 make sense here is restricting the whole v3 package's size (instead of
 just the child) via committing to a specific value in the taproot annex
 (also note that it's probably not just the v3 package's size, it should
 be the whole unconfirmed package including potential v2 unconfirmed
 ancestors).

 While I think this would be very valuable and would like to see this
 happen, I believe that can be done in a second, separate step since this
 would make relay policy stricter (some v3 transactions that previously
 propagated wouldn't propagate under this new rule). As long as you are
 able to find a path to miners through upgraded peers that use this annex
 approach, you should be able to resolve ACP pinning issues?

 I'm curious to know how other people feel about that: is it ok to do

Re: [bitcoin-dev] New transaction policies (nVersion=3) for contracting protocols

2022-09-30 Thread Bastien TEINTURIER via bitcoin-dev
Hey Ruben,

I discussed this further over IRC, and I now agree that this particular
change would be very desirable and can likely fit in the initial release
(even though I'm not the one writing that code, but I'd be happy to
review it and test it).

Greg already has a draft design that addresses your concerns: if there is
an "ephemeral output" (0-value, OP_TRUE) in an unconfirmed v3 transaction,
it MUST be spent by any child v3 transaction. This way, you ensure that
any child transaction spending the unconfirmed parent spends the ephemeral
output(s). @Greg, correct me if I misunderstood something here. Note that
we will need to precisely define the criteria for those "ephemeral outputs"
(it can probably simply be "outputs that are 0 sats").

Coupled with transactions that pay no fees (and thus require a child to
CPFP in order to be included in a block), this ensures those outputs can
never leak into the utxo set. How does that sound?

I'm curious why you would need more than one such output, can you detail?
I believe we only ever need one, spendable by anyone.

Cheers,
Bastien

Le ven. 30 sept. 2022 à 02:14, Ruben Somsen  a écrit :

> Hi Bastien,
>
> >The other change mentioned (making OP_TRUE standard and allowing outputs
> that are below dust) can be added later, as those won't be standard until
> we start allowing them, so there shouldn't be any backwards-compatibility
> issue with postponing this change. But maybe it's still worth having from
> the get-go, even though it may take a bit more time? Again, I'm curious to
> have other people's opinion here
>
> I'm sensitive to not wanting to overload the current discussion but this
> also interests me, provided it can be done in a way that is acceptable
> (i.e. minimizing the potential UTXO set impact). It would solve a big cost
> issue in my spacechains design if transactions could be 0 fees and have a 0
> sat output that could be used in order to pay all the fees with CPFP.
>
> My current view is that a tx containing a single 0 sat OP_TRUE output
> should only get relayed if it is a package where the OP_TRUE output is
> currently being spent in a way that increases the overall fee rate. But
> even then, one theoretical edge case remains:
> - Another CPFP tx can feebump the package on a different (non-OP_TRUE)
> output with an even higher fee rate
> - Subsequently, the tx that is spending the OP_TRUE might fall out of the
> mempool if the mempool fee rate rises
> - This could cause the 0 sat output to enter the UTXO set (specifically,
> rational miners wouldn't refuse to mine such a tx)
>
> It doesn't seem like this would happen much in practice (nor is there an
> incentive to do it on purpose), but the chance isn't 0.
>
> Cheers,
> Ruben
>
>
>
> On Thu, Sep 29, 2022 at 4:50 PM Greg Sanders via bitcoin-dev <
> bitcoin-dev@lists.linuxfoundation.org> wrote:
>
>> > Right, good catch, this does require new logic to handle this case.
>> As Gloria points out, this should be doable, and is definitely worth
>> adding (those CSV 1 on every other output are really hacky, glad to
>> find a way to get rid of them).
>>
>> For the record, it turns out ephemeral anchors + v3 solves this already,
>> as the anchor must be spent, and the parent tx may only have one child.
>> Somehow I missed this implication for a few months. It's great news if we
>> can directly source fees from any output claimable, including HTLCs!
>>
>> On Thu, Sep 29, 2022 at 5:15 AM Bastien TEINTURIER 
>> wrote:
>>
>>> Hi Gloria, Greg,
>>>
>>> > I interpret most of the discussion around limitations as ideas for
>>> > future improvements rather than criticisms of the proposal
>>>
>>> As far as I'm concerned, definitely!
>>>
>>> My current understanding is that the main change/improvement that would
>>> make sense here is restricting the whole v3 package's size (instead of
>>> just the child) via committing to a specific value in the taproot annex
>>> (also note that it's probably not just the v3 package's size, it should
>>> be the whole unconfirmed package including potential v2 unconfirmed
>>> ancestors).
>>>
>>> While I think this would be very valuable and would like to see this
>>> happen, I believe that can be done in a second, separate step since this
>>> would make relay policy stricter (some v3 transactions that previously
>>> propagated wouldn't propagate under this new rule). As long as you are
>>> able to find a path to miners through upgraded peers that use this annex
>>> approach, you should be able to resolve ACP pinning issues?
>>>
>>> I'm curious to know how other people feel about that: is it ok to do
>>> later or should we try to implement this for the first release of v3
>>> transactions?
>>>
>>> The other change mentioned (making OP_TRUE standard and allowing outputs
>>> that are below dust) can be added later, as those won't be standard until
>>> we start allowing them, so there shouldn't be any backwards-compatibility
>>> issue with postponing this change. But maybe it's still