mlabs-haskell / TuxedoDapp

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

BlockChain - Piece: Trading of kitties #3

Closed AltiMario closed 1 month ago

AltiMario commented 7 months ago

DApp ensures Kitties can be traded between the users. Ensure ownership is transferred successfully once trading is completed.

NadigerAmit commented 7 months ago

Both blockchain side and wallet side implementation is done as below

  1. Blockchain side : https://github.com/mlabs-haskell/Tuxedo/blob/4caa90a2cc88b70973427c55c154f5af224118b8/wardrobe/tradable_kitties/src/lib.rs#L439-L44
  2. Wallet side : https://github.com/mlabs-haskell/Tuxedo/blob/4caa90a2cc88b70973427c55c154f5af224118b8/wallet/src/kitty.rs#L509-L587

This has limitations: Since the seller and buyer will have their private keys stored in their respective wallet , if we ant to trade it involves below steps 1. Kitty need to be transferred from seller to buer , so kitty need to be signed by seller

  1. Coins or money need to be transferred from the buyer to seller, so coins need to be signed by buyer. I.e redeemers need to be included for each input .
  2. How to sign the coins and kitty at the same time ; Please see below issues : https://github.com/Off-Narrative-Labs/Tuxedo/issues/169 I think solution 1 is more feasible.
NadigerAmit commented 7 months ago

Blockchain-side implementation is done. Solution 1 proposed in the https://github.com/Off-Narrative-Labs/Tuxedo/issues/169 seems possible in JS wallet side. CLI-wallet side implementation is not done. May be difficult to implement on cli side. Not planning to implement in CLI wallet.

Mikhail needs to study the feasibility and propose.

NadigerAmit commented 6 months ago

Since blockchain-side implementation is done I moving to Done as it is already submitted in the https://github.com/mlabs-haskell/Tuxedo