<oembed><type>rich</type><version>1.0</version><author_name>npub16dt55fpq3a8r6zpphd9xngxr46zzqs75gna9cj5vf8pknyv2d7equx4wrd</author_name><author_url>https://nostr.ae/npub16dt55fpq3a8r6zpphd9xngxr46zzqs75gna9cj5vf8pknyv2d7equx4wrd</author_url><provider_name>njump</provider_name><provider_url>https://nostr.ae</provider_url><html>📅 Original date posted:2023-05-27&#xA;🗒️ Summary of this message: Financial analysis of Alice&#39;s capital requirements for various activities, including lightning payments and internal transfers. Instant settlement requires OP_XOR or OP_CAT on the base layer.&#xA;📝 Original message:Hi Burak,&#xA;&#xA;Thanks for your response!  I found it very helpful.  I&#39;m going to reply&#xA;to your email a bit out of order.&#xA;&#xA;&gt; 4. Alice places one input to her one-in, three-out transaction to&#xA;&gt;    supply funds to commitment output, connectors output, change&#xA;&gt;    output, and transaction fees.&#xA;&#xA;You don&#39;t mention it in your reply, but was I correct in my earlier&#xA;email in assuming that Alice can claim any funds paid to a commitment&#xA;output after four weeks if its commitments haven&#39;t been published&#xA;onchain?  E.g., that in the best case this allows a ~50 vbyte commitment&#xA;output that pays an arbitrary number of users to be spent as a ~100&#xA;vbyte input (P2TR scriptpath for pk(A) &amp;&amp; older(4 weeks))?&#xA;&#xA;&gt; 1. Mixing coins.&#xA;&gt; 2. Paying lightning invoices&#xA;&gt; 3. Making internal transfers&#xA;&#xA;If commitment outputs can&#39;t normally be spent by Alice for four weeks,&#xA;then Alice needs to keep enough capital on hand to pay out all amounts&#xA;involved in the activities listed above.  I&#39;ve seen many people make&#xA;this point, but I wanted to run some rough numbers to estimate the&#xA;extent of that capital load.&#xA;&#xA;Let&#39;s say Alice has a million customers who each receive all of their&#xA;income and pay all of their expenses with her.  In my country, the&#xA;median income is a bit less than $36,000 USD, or about $3,000 a month.&#xA;I imagine spending is not evenly distributed over time, so let&#39;s say&#xA;Alice needs to hold 3x the average to be prepared for a busy period.&#xA;That implies Alice&#39;s capital requirements are about $9 billion USD (3 *&#xA;3000 * 1e6).&#xA;&#xA;At a hypothetical risk-free interest rate of 1.5% annual, that&#39;s about&#xA;$135 that will need to be recovered from each user per year (9e9 * 0.015&#xA;/ 1e6).&#xA;&#xA;Additionally, if we assume the cost of an onchain transaction is $100&#xA;and the service creates one transaction per five seconds, that&#39;s $630 in&#xA;fee costs that will need to be recovered from each user per year ((60 /&#xA;5) * 60 * 24 * 365 * 100 / 1e6).&#xA;&#xA;I&#39;ll come back to this financial analysis later.&#xA;&#xA;&gt; If we want to enable Lightning-style instant settlement assurances for&#xA;&gt; the internal transfers, we need OP_XOR or OP_CAT on the base layer&#xA;&gt; [...] https://eprint.iacr.org/2017/394.pdf&#xA;&#xA;What do you mean by &#34;instant&#34;?  Do you mean &#34;settlement as soon as the&#xA;next onchain pool transaction is published&#34;?  For example, within 5&#xA;seconds if the coinjoining completes on time?  That&#39;s significantly&#xA;slower than LN today, at least in the typical case for a well-connected&#xA;node.[1]&#xA;&#xA;I think 5 seconds is fine for a lot of purposes (at both point-of-sale&#xA;terminals and on websites, I very often need to wait &gt;5 seconds for a&#xA;credit card transaction to process), but I think it&#39;s worth noting the&#xA;speed difference in a technical discussion.&#xA;&#xA;Additionally, I think the idea described significantly predates that&#xA;paper&#39;s publication, e.g.:&#xA;&#xA;&#34;Well while you can&#39;t prevent it you could render it insecure enabling&#xA;miners to take funds.  That could work via a one-show signature&#xA;[...]&#34;[2]&#xA;&#xA;A problem with the idea of using one-show signatures as double-spend&#xA;protection is that miner-claimable fidelity bonds don&#39;t work as well&#xA;against adversaries that are not just counterparties but also miners&#xA;themselves.  This same problem has been described for other ideas[3],&#xA;but to summarize:&#xA;&#xA;Bob has something valuable.  Alice offers him the output of an&#xA;unconfirmed transaction in exchange for that thing.  She also provides a&#xA;bond that will pay its amount to any miner who can prove that Alice&#xA;double spent her input to the unconfirmed transaction.&#xA;&#xA;If Alice is miner, she can privately create candidate blocks that double&#xA;spend the payment to Bob and which also claim the bond.  If she fails to&#xA;find a PoW solution for those candidate blocks, she lets Bob have his&#xA;money.  If she does find a PoW solution, she publishes the block, taking&#xA;Bob&#39;s money, securing her bond, and also receiving all the regular block&#xA;rewards (sans the fees from whatever space she used for her&#xA;transaction).&#xA;&#xA;I haven&#39;t exactly[4] seen this mentioned before, but I think it&#39;s&#xA;possible to weaken Alice&#39;s position by putting a timelock on the&#xA;spending of the bond, preventing it from being spent in the same block&#xA;as the double-spend.  For example, a one-block timelock (AKA: 1 CSV)&#xA;would mean that she would need to mine both the block containing her&#xA;unconfirmed transactions (to double spend them) and the next block (to&#xA;pay the fidelity bonds back to herself).&#xA;&#xA;Ignoring fee-sniping (bond-sniping in this case), selfish mining, and&#xA;51% attacks, her chance of success at claiming the fidelity bond is&#xA;equal to her portion of the network hashrate, e.g. if she has 33%, she&#39;s&#xA;33% likely to succeed at double spending without paying a penalty.  The&#xA;value of the fidelity bond can be scaled to compensate for that, e.g. if&#xA;you&#39;re worried about Alice controlling up to 50% of hashrate, you make&#xA;the fidelity bond at least 2x the base amount (1 / 50%).  Let&#39;s again&#xA;assume that Alice has a million users making $3,000 USD of payments per&#xA;month (28 days), or about on average $75,000 per minute (1e6 * 3000 / 28&#xA;/ 24 / 60).  If Alice bonds 2x the payment value and her bonds don&#39;t&#xA;expire for 6 blocks (which might take 3 hours), she needs an additional&#xA;$27 million worth of BTC on hand (75000 * 2 * (3 * 60)), which I admit&#xA;is trivial compared to the other capital requirements mentioned above.&#xA;&#xA;* * *&#xA;&#xA;Taken all together, it seems to me that Alice might need to keep several&#xA;billion dollars worth of BTC in a hot wallet in order to serve a million&#xA;users.  The per-user cost in fees and capital service would be around&#xA;$1,000 per year.  If we assume onchain transaction costs are about $100,&#xA;that would be equal to 10 channels that could be opened or closed by&#xA;each user for the same amount (i.e. an average of 5 channel rotations&#xA;per year).&#xA;&#xA;Did I miss something in my analysis that would indicate the capital&#xA;costs would be significantly lower or that there wouldn&#39;t be other&#xA;tradeoffs (slower settlement than LN and a need to use a timelocked&#xA;fidelity bond)?&#xA;&#xA;Thanks!,&#xA;&#xA;-Dave&#xA;&#xA;[1] https://twitter.com/Leishman/status/1661138737009442818&#xA;&#xA;[2] &#xA;https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2014-December/007038.html&#xA;&#xA;[3] &#xA;https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2020-June/018010.html&#xA;&#xA;[4] Years ago, I think I saw a reply by Peter Todd to some idea about&#xA;     paying money to miners in a fair way and he noted that it was&#xA;     critical to pay miners far enough in the future that the current set&#xA;     of miners wouldn&#39;t be incentivized to manipulate who got the money&#xA;     by choosing which block to include the transaction in now.  I wasn&#39;t&#xA;     able to quickly find that post, but it definitely influenced my&#xA;     thinking here.</html></oembed>