Open
Description
When minting, race conditions don't really matter or happen. However, with the upcoming LIST / BUY functionality, any UI displaying a list of NFTs for sale has no idea if someone has already issued a transaction towards it. This can lead to several purchases for a single NFT, where it would be the seller's responsibility to refund those whose purchases did not go through. We can't really count on people's goodness here, so two solutions are possible:
- Use a centralized DB and communicate through it with the UI.
- Pros:
- Easy to quickly disable / remove an item that's being purchased
- Might work faster than a chain-native solution
- Cons:
- Might crash during high demand periods.
- Centralized
- ?
- Add a "centralized" relayer of websockets through which all the different decentralized (IPFS / local) UIs will communicate with each other. The only purpose of this relayer would be to recognize when a TX is in progress for a certain item and to disable that item in other UIs.
- Pros:
- More decentralized than the above option
- Cons:
- Need to implement in such a way that the WS emitter checks the API connection for Kusama, the TX for a pending one, and makes sure the TX exists in the nodes the other UIs have connected to, for safety.
- Even with the above, someone
mightwill figure out how to send bogus WS messages and block UI for everyone else, effectively hoarding all the items. - Still has a central element
- Add a pending and non-finalized BUY watcher, which would disable an item if it detects a BUY for it in the mempool or an unfinalized block, and put it back if the tx is dropped or the block is forked out.
- Pros:
- Decentralized
- Cons:
- Hard to reliably implement?
Metadata
Metadata
Assignees
Labels
No labels