mlabs-haskell / TuxedoDapp

Cryptokitties on Polkadot using UTXO
Apache License 2.0
2 stars 2 forks source link

Create POC for kitty trading between two users #45

Closed philoniare closed 5 months ago

philoniare commented 6 months ago

In order to transfer a kitty, a single transaction needs to be signed by both users (recipient and sender). We would first try using talisman in order to see if it's possible to blind sign a transaction from different wallets.

JoshOrndorff commented 6 months ago

In order to transfer a kitty, a single transaction needs to be signed by both users

I'm not sure this is totally correct. Let's dig in on the design you have in mind. There are three cases I can think of, but lmk if you are thinking of something else.

Case 1: I give you a kitty as a gift.

This is a dead simple asset transfer that only requires one redeemer (probably my signature). I guess this is not what you are considering.

Case 2: I sell you a kitty for money (OTC deal).

In this case I need to sign the kitty input and you need to sign the coin inputs. This should not be done in two separate transactions because there would be counterparty risk (I send the kitty but you don't send the money, or vice versa). In this case we really do need both signatures on a single transaction.

Case 3: I sell you a kitty for money (Onchain marketplace)

Case two is inconvenient, not only because you need to exchange signatures out-of-band but also because you need to find your trading partner and negotiate a price out-of-band. Marketplaces have long eased this pain, and on-chain is no different. @NadigerAmit has prototyped an on-chain marketplace where I can list my kitty for sale (to any buyer) in a single transaction then you can accept that offer in a second transaction, and I can claim the payment tokens in a third transaction. While there are more total transactions here, there is no offchain coordination necessary, and no multi-party transaction construction problem.

philoniare commented 5 months ago

We're continuing work on a simplified version of Case 3 without a marketplace. @NadigerAmit has already implemented the code to list a kitty and buying it, but this will be done with a transfer of money UTXOs.

philoniare commented 5 months ago

Verified that the current implementation allows for trading a kitty with money. Front-end implementation pending