<oembed><type>rich</type><version>1.0</version><author_name>npub1xqcwcttsyk0a64d63crrwsxp88pa42np37rw87hrfn4uku78g2aqltcnns</author_name><author_url>https://nostr.ae/npub1xqcwcttsyk0a64d63crrwsxp88pa42np37rw87hrfn4uku78g2aqltcnns</author_url><provider_name>njump</provider_name><provider_url>https://nostr.ae</provider_url><html>📅 Original date posted:2022-01-19&#xA;📝 Original message:I see, its not primarily to make it cheaper to append fees, but also allows&#xA;appending fees in cases that aren&#39;t possible now. Is that right? I can&#xA;certainly see the benefit of a more general way to add a fee to any&#xA;transaction, regardless of whether you&#39;re related to that transaction or&#xA;not.&#xA;&#xA;How would you compare the pros and cons of your account-based approach to&#xA;something like a new sighash flag? Eg a sighash flag that says &#34;I&#39;m signing&#xA;this transaction, but the signature is only valid if mined in the same&#xA;block as transaction X (or maybe transactions LIST)&#34;. This could be named&#xA;SIGHASH_EXTERNAL. Doing this would be a lot more similar to other bitcoin&#xA;transactions, and no special account would need to be created. Any&#xA;transaction could specify this. At least that&#39;s the first thought I would&#xA;have in designing a way to arbitrarily bump fees. Have you compared your&#xA;solution to something more familiar like that?&#xA;&#xA;On Tue, Jan 18, 2022 at 11:43 AM Jeremy &lt;jlrubin at mit.edu&gt; wrote:&#xA;&#xA;&gt; Can you clarify what you mean by &#34;improve the situation&#34;?&#xA;&gt;&#xA;&gt; There&#39;s a potential mild bytes savings, but the bigger deal is that the&#xA;&gt; API should be much less vulnerable to pinning issues, fix dust leakage for&#xA;&gt; eltoo like protocols, and just generally allow protocol designs to be fully&#xA;&gt; abstracted from paying fees. You can&#39;t easily mathematically quantify API&#xA;&gt; improvements like that.&#xA;&gt; --&#xA;&gt; @JeremyRubin &lt;https://twitter.com/JeremyRubin&gt;&#xA;&gt; &lt;https://twitter.com/JeremyRubin&gt;&#xA;&gt;&#xA;&gt;&#xA;&gt; On Tue, Jan 18, 2022 at 8:13 AM Billy Tetrud &lt;billy.tetrud at gmail.com&gt;&#xA;&gt; wrote:&#xA;&gt;&#xA;&gt;&gt; Do you have any back-of-the-napkin math on quantifying how much this&#xA;&gt;&gt; would improve the situation vs existing methods (eg cpfp)?&#xA;&gt;&gt;&#xA;&gt;&gt;&#xA;&gt;&gt;&#xA;&gt;&gt; On Sat, Jan 1, 2022 at 2:04 PM Jeremy via bitcoin-dev &lt;&#xA;&gt;&gt; bitcoin-dev at lists.linuxfoundation.org&gt; wrote:&#xA;&gt;&gt;&#xA;&gt;&gt;&gt; Happy new years devs,&#xA;&gt;&gt;&gt;&#xA;&gt;&gt;&gt; I figured I would share some thoughts for conceptual review that have&#xA;&gt;&gt;&gt; been bouncing around my head as an opportunity to clean up the fee paying&#xA;&gt;&gt;&gt; semantics in bitcoin &#34;for good&#34;. The design space is very wide on the&#xA;&gt;&gt;&gt; approach I&#39;ll share, so below is just a sketch of how it could work which&#xA;&gt;&gt;&gt; I&#39;m sure could be improved greatly.&#xA;&gt;&gt;&gt;&#xA;&gt;&gt;&gt; Transaction fees are an integral part of bitcoin.&#xA;&gt;&gt;&gt;&#xA;&gt;&gt;&gt; However, due to quirks of Bitcoin&#39;s transaction design, fees are a part&#xA;&gt;&gt;&gt; of the transactions that they occur in.&#xA;&gt;&gt;&gt;&#xA;&gt;&gt;&gt; While this works in a &#34;Bitcoin 1.0&#34; world, where all transactions are&#xA;&gt;&gt;&gt; simple on-chain transfers, real world use of Bitcoin requires support for&#xA;&gt;&gt;&gt; things like Fee Bumping stuck transactions, DoS resistant Payment Channels,&#xA;&gt;&gt;&gt; and other long lived Smart Contracts that can&#39;t predict future fee rates.&#xA;&gt;&gt;&gt; Having the fees paid in band makes writing these contracts much more&#xA;&gt;&gt;&gt; difficult as you can&#39;t merely express the logic you want for the&#xA;&gt;&gt;&gt; transaction, but also the fees.&#xA;&gt;&gt;&gt;&#xA;&gt;&gt;&gt; Previously, I proposed a special type of transaction called a &#34;Sponsor&#34;&#xA;&gt;&gt;&gt; which has some special consensus + mempool rules to allow arbitrarily&#xA;&gt;&gt;&gt; appending fees to a transaction to bump it up in the mempool.&#xA;&gt;&gt;&gt;&#xA;&gt;&gt;&gt; As an alternative, we could establish an account system in Bitcoin as an&#xA;&gt;&gt;&gt; &#34;extension block&#34;.&#xA;&gt;&gt;&gt;&#xA;&gt;&gt;&gt; *Here&#39;s how it might work:*&#xA;&gt;&gt;&gt;&#xA;&gt;&gt;&gt; 1. Define a special anyone can spend output type that is a &#34;fee account&#34;&#xA;&gt;&gt;&gt; (e.g. segwit V2). Such outputs have a redeeming key and an amount&#xA;&gt;&gt;&gt; associated with them, but are overall anyone can spend.&#xA;&gt;&gt;&gt; 2. All deposits to these outputs get stored in a separate UTXO database&#xA;&gt;&gt;&gt; for fee accounts&#xA;&gt;&gt;&gt; 3. Fee accounts can sign only two kinds of transaction: A: a fee amount&#xA;&gt;&gt;&gt; and a TXID (or Outpoint?); B: a withdraw amount, a fee, and an address&#xA;&gt;&gt;&gt; 4. These transactions are committed in an extension block merkle tree.&#xA;&gt;&gt;&gt; While the actual signature must cover the TXID/Outpoint, the committed data&#xA;&gt;&gt;&gt; need only cover the index in the block of the transaction. The public key&#xA;&gt;&gt;&gt; for account lookup can be recovered from the message + signature.&#xA;&gt;&gt;&gt; 5. In any block, any of the fee account deposits can be: released into&#xA;&gt;&gt;&gt; fees if there is a corresponding tx; consolidated together to reduce the&#xA;&gt;&gt;&gt; number of utxos (this can be just an OP_TRUE no metadata needed); or&#xA;&gt;&gt;&gt; released into fees *and paid back* into the requested withdrawal key&#xA;&gt;&gt;&gt; (encumbering a 100 block timeout). Signatures must be unique in a block.&#xA;&gt;&gt;&gt; 6. Mempool logic is updated to allow attaching of account fee spends to&#xA;&gt;&gt;&gt; transactions, the mempool can restrict that an account is not allowed more&#xA;&gt;&gt;&gt; spend more than it&#39;s balance.&#xA;&gt;&gt;&gt;&#xA;&gt;&gt;&gt; *But aren&#39;t accounts &#34;bad&#34;?*&#xA;&gt;&gt;&gt;&#xA;&gt;&gt;&gt; Yes, accounts are bad. But these accounts are not bad, because any funds&#xA;&gt;&gt;&gt; withdrawn from the fee extension are fundamentally locked for 100 blocks as&#xA;&gt;&gt;&gt; a coinbase output, so there should be no issues with any series of reorgs.&#xA;&gt;&gt;&gt; Further, since there is no &#34;rich state&#34; for these accounts, the state&#xA;&gt;&gt;&gt; updates can always be applied in a conflict-free way in any order.&#xA;&gt;&gt;&gt;&#xA;&gt;&gt;&gt;&#xA;&gt;&gt;&gt; *Improving the privacy of this design:*&#xA;&gt;&gt;&gt;&#xA;&gt;&gt;&gt; This design could likely be modified to implement something like&#xA;&gt;&gt;&gt; Tornado.cash or something else so that the fee account paying can be&#xA;&gt;&gt;&gt; unlinked from the transaction being paid for, improving privacy at the&#xA;&gt;&gt;&gt; expense of being a bit more expensive.&#xA;&gt;&gt;&gt;&#xA;&gt;&gt;&gt; Other operations could be added to allow a trustless mixing to be done&#xA;&gt;&gt;&gt; by miners automatically where groups of accounts with similar values are&#xA;&gt;&gt;&gt; trustlessly  split into a common denominator and change, and keys are&#xA;&gt;&gt;&gt; derived via a verifiable stealth address like protocol (so fee balances can&#xA;&gt;&gt;&gt; be discovered by tracing the updates posted). These updates could also be&#xA;&gt;&gt;&gt; produced by individuals rather than miners, and miners could simply honor&#xA;&gt;&gt;&gt; them with better privacy. While a miner generating an update would be able&#xA;&gt;&gt;&gt; to deanonymize their mixes, if you have your account mixed several times by&#xA;&gt;&gt;&gt; independent miners that could potentially add sufficient privacy.&#xA;&gt;&gt;&gt;&#xA;&gt;&gt;&gt; The LN can also be used with PTLCs to, in theory, have another&#xA;&gt;&gt;&gt; individual paid to sponsor a transaction on your behalf only if they reveal&#xA;&gt;&gt;&gt; a valid sig from their fee paying account, although under this model it&#39;s&#xA;&gt;&gt;&gt; hard to ensure that the owner doesn&#39;t pay a fee and then &#39;cancel&#39; by&#xA;&gt;&gt;&gt; withdrawing the rest. However, this could be partly solved by using&#xA;&gt;&gt;&gt; reputable fee accounts (reputation could be measured somewhat&#xA;&gt;&gt;&gt; decentralized-ly by longevity of the account and transactions paid for&#xA;&gt;&gt;&gt; historically).&#xA;&gt;&gt;&gt;&#xA;&gt;&gt;&gt; *Scalability*&#xA;&gt;&gt;&gt;&#xA;&gt;&gt;&gt; This design is fundamentally &#39;decent&#39; for scalability because adding&#xA;&gt;&gt;&gt; fees to a transaction does not require adding inputs or outputs and does&#xA;&gt;&gt;&gt; not require tracking substantial amounts of new state.&#xA;&gt;&gt;&gt;&#xA;&gt;&gt;&gt; Paying someone else to pay for you via the LN also helps make this more&#xA;&gt;&gt;&gt; efficient if the withdrawal issues can be fixed.&#xA;&gt;&gt;&gt;&#xA;&gt;&gt;&gt; *Lightning:*&#xA;&gt;&gt;&gt;&#xA;&gt;&gt;&gt; This type of design works really well for channels because the addition&#xA;&gt;&gt;&gt; of fees to e.g. a channel state does not require any sort of pre-planning&#xA;&gt;&gt;&gt; (e.g. anchors) or transaction flexibility (SIGHASH flags). This sort of&#xA;&gt;&gt;&gt; design is naturally immune to pinning issues since you could offer to pay a&#xA;&gt;&gt;&gt; fee for any TXID and the number of fee adding offers does not need to be&#xA;&gt;&gt;&gt; restricted in the same way the descendant transactions would need to be.&#xA;&gt;&gt;&gt;&#xA;&gt;&gt;&gt; *Without a fork?*&#xA;&gt;&gt;&gt;&#xA;&gt;&gt;&gt; This type of design could be done as a federated network that bribes&#xA;&gt;&gt;&gt; miners -- potentially even retroactively after a block is formed. That&#xA;&gt;&gt;&gt; might be sufficient to prove the concept works before a consensus upgrade&#xA;&gt;&gt;&gt; is deployed, but such an approach does mean there is a centralizing layer&#xA;&gt;&gt;&gt; interfering with normal mining.&#xA;&gt;&gt;&gt;&#xA;&gt;&gt;&gt;&#xA;&gt;&gt;&gt; Happy new year!!&#xA;&gt;&gt;&gt;&#xA;&gt;&gt;&gt; Jeremy&#xA;&gt;&gt;&gt;&#xA;&gt;&gt;&gt; --&#xA;&gt;&gt;&gt; @JeremyRubin &lt;https://twitter.com/JeremyRubin&gt;&#xA;&gt;&gt;&gt; &lt;https://twitter.com/JeremyRubin&gt;&#xA;&gt;&gt;&gt; _______________________________________________&#xA;&gt;&gt;&gt; bitcoin-dev mailing list&#xA;&gt;&gt;&gt; bitcoin-dev at lists.linuxfoundation.org&#xA;&gt;&gt;&gt; https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev&#xA;&gt;&gt;&gt;&#xA;&gt;&gt;&#xA;-------------- next part --------------&#xA;An HTML attachment was scrubbed...&#xA;URL: &lt;http://lists.linuxfoundation.org/pipermail/bitcoin-dev/attachments/20220118/3c72c1c7/attachment-0001.html&gt;</html></oembed>