Is it possible to facilitate exchange between different currencies using spending conditions? For example, if someone wants to exchange USD for sats, could it be done with minimal trust in a spending condition?

Reply to this note

Please Login to reply.

Discussion

Yes, I think it can be done via an atomic swap using HTLCs:

- You share your pubkey with me and your order ("I want to trade 100 sat against $0.10”)

- I generate an HTLC preimage and lock 100 sat to it and to your pubkey and share the ecash with you, together with my pubkey

- If you like what you see, you lock $0.10 to the same HTLC hash as me and to my pubkey and send the ecash to me

- If I like what I see, I spend your $0.10 ecash by unlocking the HTLC, you obtain the preimage from the mint (using /check) and unlock my 100 sat with it.

We've traded 100 sat against $0.10.

Thanks, Calle. It's good to know. This feature brings much potential to ecash.

Sounds super cool but I don't get the thing with the currency. I can get $ ecash over lightning? So I could put them into my bank account?