What if “someone you know” on the internet wants to buy some coins from you? Maybe his government has banned Binance or Bitfinex and he cannot have access to some tokens you have or for any other reason.
When you don't know exactly the other side, there's always the problem - who makes the first transaction?
I was thinking - token exchange is nothing more than data flow. Why not create something to exchange tokens directly one-to-one via Streamr with smart-contracts securing the transaction? The way I imagined it to make it secure is to negotiate encrypted private keys.
Build some kind of app to trade tokens/private keys one-to-one without direct peer trust or third parties.
(As with every trade, both peers buy and sell in one transaction, for simplicity, as one-to-one trading, I will call the user who creates the bid "creator" and the user who fulfills the contract as the "receiver".)
How I imagine the app working:
Generates a bid with ID for the creator to share with the receiver.
Generates an encrypted private key with an open address that the creator can fund.
Generates a smart-contract that will send the encrypted private key if fulfilled.
- Smart-contract needs to know:
- A specific wallet chosen by the creator to check if the payment was received.
- The amount necessary to send the encrypted private key.
- The max time amount to be fulfilled. If it's not the creator needs to be able to decrypt the key and be refunded.
Let the receiver find the bid with the ID.
Let the receiver transfer funds to the wallet specified in the smart-contract.
Connect and send/receive the encrypted key via Streamr Network. Pay for broker nodes if needed in the future.
Decrypt the key for the receiver.
I don't do coding / programming, so I don't know if any of the above makes sense (the logic behind it) or if it's feasible.
Of course, I also don't know how these things interact with each other with encryption and stuff, and maybe something like oracles (eg chainlink) is needed to interact / secure smart contracts (?).
I know Streamr Network being a pub/sub network is usually more suitable for many data points per event but I also believe it can do one data point.
I could never build something like this. It is just a thought exercise for me and it’s the most technical I can for now.
I would really like to hear from someone who actually knows how to develop things. =)