Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: Oukanina on May 08, 2019, 12:55:49 PM



Title: An Experiment on trade - Smart contract for trustless trading
Post by: Oukanina on May 08, 2019, 12:55:49 PM
Let's assume that there is a magic box that is safe and indestructible. It allows people to put money into it and set multiple locks on it. People who set locks on it can set money allocation plan when the box is unlocked. 

For example, seller A and buyer B,
1.Create a box
2.Specify the corresponding income after opening the box
3.They both deposit some money into the box
4.They both set a lock on it

If both A and B confirmed the deal is complete, locks will be opened. Each one get previously specified income.

If there is a problem with the transaction, one can keep his lock locked so that they both can't withdraw the deposit. Or they can create a new box to negotiate.

Let's say the locked fund are large enough, will it reduce fraudulent transactions?

Who will use this box to trade?

Will there be a lot of extortion?

The code:
https://ropsten.etherscan.io/address/0x8439270cd9f9108970d950adec463fc37b65d680#code
https://github.com/Oukanina/Lockbox/blob/master/Lockbox.sol


Title: Re: An Experiment on trade - Smart contract for trustless trading
Post by: AndreyVen on May 08, 2019, 04:15:43 PM
I think this could be useful if you combine it with a reputation system.

Much how ebay works, you only risk low value transaction with people who have a low reputation score.

There are a few projects out there working on a system like this.


Title: Re: An Experiment on trade - Smart contract for trustless trading
Post by: ABCbits on May 08, 2019, 04:20:11 PM
Not bad idea, but the biggest question is, what stops someone who wants another party suffer losses or/and he don't care about his losses? On escrow system with 2-of-3 multi-signature, it can be mitigated easily.

I don't know about ETH, but on Bitcoin it's already possible with 2-of-2 multi-signature scheme.

Let's say the locked fund are large enough, will it reduce fraudulent transactions?

Maybe yes, since scammer don't want risks big amount for small "profit"

Who will use this box to trade?

Probably no one, since deposit big money is required, unless there's user-friendly wallet for it.

Will there be a lot of extortion?

No idea


Title: Re: An Experiment on trade - Smart contract for trustless trading
Post by: d5000 on May 09, 2019, 02:56:04 AM
If I understand your proposal, then that is exactly the way Bisq (https://bisq.network/) is working, which is (until now) the only exchange with a (relatively) decentralized operation model that allows to exchange Bitcoins for fiat.

ETFBitcoin has already mentioned it: there is no need for Solidity/Ethereum in this case, everything can be achieved with standard Bitcoin script (multisig contracts). That's also the way Bisq is doing it.

I don't know Bisq very well and haven't used it, but I read that definitively there is a risk of extortion, above all if you lock an amount that is worth less than the trade in question because you trust a party which has already carried out some trades with you. This scheme is known as "selective scamming" (build up reputation, and when you get the opportunity to carry out a big transaction, scam the other party and disappear).



Title: Re: An Experiment on trade - Smart contract for trustless trading
Post by: BlockchainAppFactory on May 10, 2019, 06:25:28 AM
Isn't this the same concept as Atomic Swap or hash time-locked contracts (HTLCs)?


Title: Re: An Experiment on trade - Smart contract for trustless trading
Post by: d5000 on May 10, 2019, 09:48:06 AM
Isn't this the same concept as Atomic Swap or hash time-locked contracts (HTLCs)?
No. In the atomic swap concept, the contract ensures the funds are only "moved" when all parties have fulfilled their obligations. That's why it's called an "atomic" (undivisable) swap. So there is no need for a "box" with an additional multisig-secured "security deposit".

If one party does not carry out the accorded transaction, then the other party can withdraw the funds from the contract without suffering a loss. The only loss could be transaction fees in the original concept (https://en.bitcoin.it/wiki/Atomic_swap), but a similar contract can also be achieved off-chain (with similar mechanisms than the Lightning Network offers).