# Zcash Shielded Assets -- Asset Swaps and beyond

**URL:** <https://forum.zcashcommunity.com/t/zcash-shielded-assets-asset-swaps-and-beyond/44497>\
**Category:** Applications\
**Created:** [April 30, 2023, 10:22am UTC](https://forum.zcashcommunity.com/t/zcash-shielded-assets-asset-swaps-and-beyond/44497 "2023-04-30T10:22:29Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![GGuy](https://sea2.discourse-cdn.com/zcash/user_avatar/forum.zcashcommunity.com/gguy/32/19036_2.png) [@GGuy](https://forum.zcashcommunity.com/u/GGuy)\
**Post date:** [April 30, 2023, 1:09pm UTC](https://forum.zcashcommunity.com/t/zcash-shielded-assets-asset-swaps-and-beyond/44497/3 "2023-04-30T13:09:06Z")

</div>

Hi. When I pondered atomic swaps I thought about them being implemented as off-chain contracts that the receiving party can optionally execute on-chain… “Options”. On chain would also be awesome too, definitely wouldn’t rule it out but it feels way more complex and harder to get right. Anyways… Just food for thought my comments are below.

> [@The Future of Atomic Swaps](https://forum.zcashcommunity.com/t/the-future-of-atomic-swaps/42861/1):
>
> ### Open recipient atomic swaps
> 
> I like to call them “options” and think of them in the same way we think of traditional financial options. Someone may receive (for free or paid) an option and can “optionally” execute the atomic swap before the expiry time. (Edit: the assumption here is the options issuer can set the expiry time).
> 
> One example is an exchange. They could allow a user to select the exchange pair on their website and enter amount to spend. The website would then issue them (e.g. via QR code) with an option based on the current exchange rate that’s only valid for a short period of time. The user can then execute that atomic swap if they choose. I imagine the slip is largely dependent on how long the option is valid for.
> 
> The added benefit here is an exchange could allow users to purchase options with really long expiry times for additional hedging/trading options.

Think about them as options also open up the idea that a failed execution of an option could trigger another action (e.g. think insurance).

> [@The Future of Atomic Swaps](https://forum.zcashcommunity.com/t/the-future-of-atomic-swaps/42861/1):
>
> ### Fail case open recipient atomic swaps
> 
> Open recipient atomic swaps that allow the receiver to execute a fail case in the event the atomic swap fails (e.g. insured loans, secured loans, etc). This would enable 3rd parties (or DAOs) to insure “options”.

Also, conditional options should be a thing.

> [@The Future of Atomic Swaps](https://forum.zcashcommunity.com/t/the-future-of-atomic-swaps/42861/1):
>
> ### Conditional “options”
> 
> Think of options that are condition on an option before it being executed.
> 
> Imagine a 1year car loan with monthly repayments. Ownership of the car doesn’t transfer until all 12 repayments are made (i.e. executed options). This could be done a few different ways:
> 
> - User receives 12 sequential options that must be executed in order. The first 11 are simply ZEC payment to the loan company. Last one is an atomic

* * *

It wasn’t my intent but now that I think about it stacking options in this way is kind of like an off-chain smart contract :thinking:. What other features might we need to support this off chain Turing machine :thinking:. The more I think about it the more I likey 🤯!

* * *

**Edit**  
From an implementation perspective we could pass the contracts/options around in JWTs, CWTs, and/or ZWTs. There are a couple of benefits I see here:

1. The options receive all the privacy features of a memo but are only optionally executed by the receiver. I assume ZWTs are simply CWTs that only need to store the payload as they rely on the underlying cryptographic properties of the memo. The main reason I call them ZWTs is because the APIs and terminology would match and there would be a clear/clean conversion between JWTs, CWTs and ZWTs.

2. ZWTs don’t exist yet but the benefit here is if the memo field is big enough for V1 but not big enough for future complex claims then that work could be offloaded to the others to solve.

3. If we want more complex system such as on-chain exchanges then the problem that needs to be solved is simply making some memos optionally transparent (and possibly labelling/categorising them). The ZWT memo stays the same we just allow a special kind of transaction that’s transparent. Again, optionally could be offloaded to other teams.

> [@RFP - Zcash Memo Field Secure Messaging Extension](https://forum.zcashcommunity.com/t/rfp-zcash-memo-field-secure-messaging-extension/44069/13):
>
> I’ve always thought “Zcash Object Signing and Encryption” would be a good idea

---

_[View the full topic](https://forum.zcashcommunity.com/t/zcash-shielded-assets-asset-swaps-and-beyond/44497)._
