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