{"type":"rich","version":"1.0","author_name":"npub1g5zswf6y48f7fy90jf3tlcuwdmjn8znhzaa4vkmtxaeskca8hpss23ms3l","author_url":"https://nostr.ae/npub1g5zswf6y48f7fy90jf3tlcuwdmjn8znhzaa4vkmtxaeskca8hpss23ms3l","provider_name":"njump","provider_url":"https://nostr.ae","html":"📅 Original date posted:2023-05-23\n🗒️ Summary of this message: A write-up on designing a non-custodial L2 should be read by everyone, emphasizing the importance of testing for footguns before deploying in production.\n📝 Original message:Here is an old write-up that should be read by everyone trying to design a NON-custodial L2: https://zmnscpxj.github.io/offchain/safety.html\n\n\n\n\nSent with Proton Mail secure email.\n\n------- Original Message -------\nOn Wednesday, May 24th, 2023 at 12:40 AM, ZmnSCPxj via bitcoin-dev \u003cbitcoin-dev at lists.linuxfoundation.org\u003e wrote:\n\n\n\u003e Good morning Burak,\n\u003e \n\u003e \u003e \u003e As the access to Lightning is also by the (same?) ASP, it seems to me that the ASP will simply fail to forward the payment on the broader Lightning network after it has replaced the in-mempool transaction, preventing recipients from actually being able to rely on any received funds existing until the next pool transaction is confirmed.\n\u003e \u003e \n\u003e \u003e Yes, that's correct. Lightning payments are routed through ASPs. ASP may not cooperate in forwarding HTLC(s) AFTER double-spending their pool transaction. However, it's a footgun if ASP forwards HTLC(s) BEFORE double-spending their pool transaction.\n\u003e \n\u003e \n\u003e This is why competent coders test their code for footguns before deploying in production.\n\u003e \n\u003e \u003e What makes Ark magical is, in the collaborative case, users' ability to pay lightning invoices with their zero-conf vTXOs, without waiting for on-chain confirmations.\n\u003e \n\u003e \n\u003e You can also do the same in Lightning, with the same risk profile: the LSP opens a 0-conf channel to you, you receive over Lightning, send out over Lightning again, without waiting for onchain confirmations.\n\u003e Again the LSP can also steal the funds by double-spending the 0-conf channel open, like in the Ark case.\n\u003e \n\u003e The difference here is that once confirmed, the LSP can no longer attack you.\n\u003e As I understand Ark, there is always an unconfirmed transaction that can be double-spent by the ASP, so that the ASP can attack at any time.\n\u003e \n\u003e \u003e This is the opposite of swap-ins, where users SHOULD wait for on-chain confirmations before revealing their preimage of the HODL invoice; otherwise, the swap service provider can steal users' sats by double-spending their zero-conf HTLC.\n\u003e \n\u003e \n\u003e If by \"swap-in\" you mean \"onchain-to-offchain swap\" then it is the user who can double-spend their onchain 0-conf HTLC, not the swap service provider.\n\u003e As the context is receiving money and then sending it out, I think that is what you mean, but I think you also misunderstand the concept.\n\u003e \n\u003e Regards,\n\u003e ZmnSPCxj\n\u003e _______________________________________________\n\u003e bitcoin-dev mailing list\n\u003e bitcoin-dev at lists.linuxfoundation.org\n\u003e https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev"}
