Joe Miyamoto Philips [ARCHIVE] on Nostr: 📅 Original date posted:2022-10-12 📝 Original message: > The offchain-to-onchain ...
📅 Original date posted:2022-10-12
📝 Original message:
> The offchain-to-onchain swap protocol is intended to be used by end- users to pay onchain when all their funds are in a Lightning channel.
> Thus, there is the possibility that the end-user has no onchain funds to payjoin into the onchain HTLC, only Lightning funds, and the only way > to get it out is to swap it out to onchain, hence, catch-22.
I don't think that the fact the initiator must have a small on-chain
funds before swap-out is not a showstopper, but my point is to make a
first swap tx and pre-payment contingent.
So it does not really have to be a payjoin, in fact, you can do it
with off-chain prepayment like this. It's simple, assuming PTLC....
1. Alice asks Bob for offchain-to-onchain swap,
2. Bob forwards it to Carol
3. Carol agrees, and sends Alice the following items
* tweak T (:= t * G)
* Transaction for onchain PTLC for the swap.
* Adaptor signature for the tx tweaked by T
4. Alice validates, and creates a PTLC multi-hop payment for a small
amount to Carol, this is a prepayment for the swap. And Carol must
reveal `t` to get paid.
5. After Carol receives payment, Alice un-tweak the Adaptor sig and
broadcast the onchain PTLC.
6. swap goes on...
Carol can disturb the protocol by invaliding the PTLC tx by using one
of its inputs.
But there is not much point in doing so because prepayment is only for
a fee for a single tx in the first place.
There are many things we must consider here (e.g. Alice can learn
Carol's UTXO with no cost, etc...), but overall I think it works fine.
Best, Joe
Published at
2023-06-09 13:07:05Event JSON
{
"id": "e9fc3e79c8fbdde852f785f2f91fbe9549f94241cb3a51a432e094cae963e75c",
"pubkey": "19b3a319eb60745e57b7383c3fa98720c9d70cae6545850941a165c0c1b39a53",
"created_at": 1686316025,
"kind": 1,
"tags": [
[
"e",
"297fed99fa3fe6a78c6a64856aa9312577febc417828d48a9c8cf1acfaf01a34",
"",
"root"
],
[
"e",
"d6e0a02efa1a34dc3b5b112d3d871af0c7b34a5da7327c2ae7100387f1fdfa84",
"",
"reply"
],
[
"p",
"4505072744a9d3e490af9262bfe38e6ee5338a77177b565b6b37730b63a7b861"
]
],
"content": "📅 Original date posted:2022-10-12\n📝 Original message:\n\u003e The offchain-to-onchain swap protocol is intended to be used by end- users to pay onchain when all their funds are in a Lightning channel.\n\u003e Thus, there is the possibility that the end-user has no onchain funds to payjoin into the onchain HTLC, only Lightning funds, and the only way \u003e to get it out is to swap it out to onchain, hence, catch-22.\n\nI don't think that the fact the initiator must have a small on-chain\nfunds before swap-out is not a showstopper, but my point is to make a\nfirst swap tx and pre-payment contingent.\n\nSo it does not really have to be a payjoin, in fact, you can do it\nwith off-chain prepayment like this. It's simple, assuming PTLC....\n\n1. Alice asks Bob for offchain-to-onchain swap,\n2. Bob forwards it to Carol\n3. Carol agrees, and sends Alice the following items\n * tweak T (:= t * G)\n * Transaction for onchain PTLC for the swap.\n * Adaptor signature for the tx tweaked by T\n4. Alice validates, and creates a PTLC multi-hop payment for a small\namount to Carol, this is a prepayment for the swap. And Carol must\nreveal `t` to get paid.\n5. After Carol receives payment, Alice un-tweak the Adaptor sig and\nbroadcast the onchain PTLC.\n6. swap goes on...\n\nCarol can disturb the protocol by invaliding the PTLC tx by using one\nof its inputs.\nBut there is not much point in doing so because prepayment is only for\na fee for a single tx in the first place.\n\nThere are many things we must consider here (e.g. Alice can learn\nCarol's UTXO with no cost, etc...), but overall I think it works fine.\n\nBest, Joe",
"sig": "121b052cffa2d1deec288c9831653fe8c96cbc2f986eb889eba354aaa6a3183b40b6641ccdadfd4201395a591abb62f86a0e35411ee0d28b0b85f806ab881df8"
}