Ravencoin
Ravencoin copied to clipboard
[Feature] Atomic Swap Creation - Discussion
Now that atomic swap execution is in core, I want to look at getting creation implemented as well. That being said, creation has much more complexity to it, so I wanted to open a discussion surrounding creation to make sure everything is sounds good to all involved. There are a lot of considerations that need to be dealt with that I came across while building raven-trader-pro, that may or may not apply to core wallet.
The top-most things in my mind are
- What should the UX be like with regards to locked UTXO's, and other such edge-cases?
- How should the trades be stored locally? Simple JSON vs. more detailed format?
- External integrations (ie: raventrader.net), good in theory, but ultimately not good for centralization. Maybe standardize like IPFS and allow selection in UI?
- RPC Integrations. Maybe this is an after-launch addition, but an easy way to generate trades over RPC would be extremely helpful for developers looking to make integrations.
- UTXO Setup. UTXO's must be "prepared" (ie: self-transfer of the exact amount for the trade) if you don't have an exactly matching UTXO already, which for RVN is practically never.
- Bulk trade setup. Same as 5, but preparing many UTXO's in a single self-transfer, to cut down on transaction fee overhead
- How should trades be shown in the UI?
My answers for raven-trader-pro were as follows, but these solutions might not all apply to core.
- UTXO's are individually recorded as locked (and locked in wallet unless disabled), so the wallet tracks a "spendable" and "complete" UTXO set. UI elements will show partial balances to represent spendable vs. complete.
- JSON file storing trades, locks, and history.
- N/A, dedicate app for website
- Would love to have these <3
- A Trade is created first which outlines the give/take. From that any number of orders are created, which are tied to specific UTXO's. When adding orders to a trade UTXO's are searched or created if needed.
- Trades can have multiple orders under them, and when many are added at once, the self-transfer properly does them in a single transfer, optimizing things.
- Fairly basic, 3 tables. 1 for active Trades. 1 for completed orders. 1 for executed orders.
Let me know your thoughts!
- Maybe a fourth column for current balances - maybe with RVN balance at the top and Asset balances listed below. I know these are listed elsewhere in the core wallet but it would be nice to have them located in the same place as trades/orders as well just from a UX perspective.