Bitcoin Forum
May 26, 2024, 04:26:39 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Trustless Leveraged Trading via Atomic Swaps  (Read 122 times)
F848 (OP)
Newbie
*
Offline Offline

Activity: 10
Merit: 0


View Profile
June 26, 2021, 11:45:23 AM
 #1

I want to propose a clever mechanism here for building actual markets/exchanges with Atomic Swap technology.

The basic idea is to run a sort of "smart contract" that is really a specialized blockchain of its own.
It does not matter which consensus algorithm it uses, the important points are:

- Has specialized transaction types for making and taking BTC/ALT Atomic Swap offers
- Is 'aware' of Bitcoin chain
- Is 'aware' of Altcoin chain
- Has a native token, let’s call it $TRADE (The native token could be airdropped, mined, backed by USD, whatever works well)

Now an offer to swap BTC/ALT looks something like:
- Volume
- Rate
- Collateral in $TRADE (deposited with the offer)
- Required taker collateral in $TRADE

What is the collateral for? Atomic Swap markets are easily DoS-attackable, you just initiate lots of trades, but don’t follow through with the Atomic Swap protocol. In my proposed design, if either side stops following protocol, they lose their collateral to the counterparty.
That is, in the happy case, both sides can conduct the Atomic Swap entirely in private and simply sign off on a final "Atomic Swap executed" TX jointly, to unlock both of their collaterals on the $TRADE chain.
In the unhappy case that one side tries to dodge the Swap, the victim commits a "complaint" tx to the $TRADE chain. If the perpetrator does not respond with a counter-proof (by pointing to the TX it has conducted on the BTC or ALT chain), their collateral is claimed.
(Inspired by this article: https://medium.com/@graycoding/lessons-learned-from-making-a-chess-game-for-ethereum-6917c01178b6)

Now the interesting thing is we don’t have to dictate the amount of collateral deposited. We can let the market decide.
You can offer better exchange rates, at lower collateral, or worse rates at higher collateral.
At any point, if the unrealized loss from your position exceeds the collateral, you will probably just forfeit the collateral instead of following through with the Swap.
See this very good article for an intro to these dynamics: https://blog.bitmex.com/atomic-swaps-and-distributed-exchanges-the-inadvertent-call-option/

(What you can also try is to build a reputation (your trade history can be public on-chain, after all) as being an honest trader that always Swaps, letting you 'get away' with lower collateral because you have executed 1000 Swaps and dodged 0, for example.)

_____

OK, now we take this to another level. We don’t want every trade to actually be an Atomic Swap – transactions on $BTC and other chains are costly!
Let’s make positions fungible.

Alice posts offer:
- 1 BTC for 50 ALT
- Collateral 100 $TRADE, taker has to bring the same. Let’s say 100 $TRADE is worth 0.1 BTC, so the collateral covers 10% of the position.

Bob takes the offer. Now Bob owes Alice 50 $ALT and Alice owes Bob 1 $BTC. We can think of these as 'positions' in trading,
as long as neither Bob nor Alice insists on the Atomic Swap being executed, they simply hold the 'Call Option'.

Market develops, Carol comes around and posts offer:
- 55 ALT for 1 BTC
- 110 $TRADE collateral

Bob can use the +1 BTC position he holds against Alice, to take this trade! He pockets the 5 $ALT / 10 $TRADE winnings.
Now we have:
- Carol owes Alice 50 $ALT
- Carol owes Bob 5 $ALT, or 10 $TRADE (excess collateral)
- Alice owes Carol 1 BTC
- The position between Alice and Carol is collateralized with 100 $TRADE as before. (Collateral must not shrink)

Bob can now demand payment of 5 $ALT from Carol. Again if Carol does not pay, he complains on the $TRADE chain and the chain decides to let him claim the 10 $TRADE collateral, unless Carol can point to the transaction on the ALT chain where she has actually paid Bob.

Note that Bob needed to find an offer that had a better rate as well as excess collateral to cover his winnings.
He could’ve also made use of an offer that had the _same_ rate, but more collateral, and just claim the excess collateral!

_____


What we discovered is that Bob can trade with leverage. Maybe he owns neither 1 BTC or 50 ALT – he just owns 0.1 BTC worth of $TRADE. So he just traded with 10x leverage.
The scheme is extremely capital-efficient. Rather than locking up the complete worth of the position like in a spot market, or taking out a loan to fund a leveraged position, you transparently engage in trades that are in the end only secured by the collateral.
As the Bitmex article put it, »it may be better to embrace the call option feature as a viable product, rather than ignoring or fighting it.«

Since both "force execution of a position" and "exit a position by trading it away" would be actions on the $TRADE chain, Alice can try calling Bob out on his leveraged play, by frontrunning his trade TX with a TX that forces their pending Swap to start being executed.
In this case, his lack of real funds would come to light and he’d lose his position AND his collateral, even though he was winning the trade! This is a feature.

So, to make life for people like Bob feasible, we can introduce timing windows to positions, e.g. "this Atomic Swap can only be forced to execute from Oct 1, and no later than Oct 3" – like Futures. So if Bob takes the position with Alice on Sep1, he’s got 1 month to exit until his 'bluff' can be called.
He can 'roll' his futures by finding trades of Oct1 vs. Nov1 position etc. A lot of different markets can develop on the $TRADE chain. The number of actually executed Atomic Swaps may grow very very small, but the threat of forcing execution is the thing that makes this market work completely without price Oracles.

There’s a lot of questions I haven’t touched in this overview, and maybe the idea holds a fatal flaw – hard to tell. Would love to hear input on this.

Stray notes:
- Of course there must be BTC/TRADE and ALT/TRADE markets, too
- Many trade-chains can exist and parallel and be arbitraged between, it works wonderfully, scales
- Frontends could offer close-to normal exchange experience, hide the nitty-gritty details of comparing different offers
- Closing one position via another trade can also be done just partially, with the obvious implications of looking at keeping collateral/volume ratio the same etc.
- Positions can also demand an up-front premium in exchange for better rates, mimicking Options. The premium can even be payable in BTC or ALT, does not have to be $TRADE
- To avoid adjusting rates on your offers all the time, you can hook into external price streams. Basically you demand from the Taker a "signed message from #myFavorityCentralizedExchange" that asserts the rate at block height X is Y. Your favorite exchange publishes these messages as a service. Could be multi-sig by a consortium of CEX, too. You get the idea.
dkbit98
Legendary
*
Offline Offline

Activity: 2240
Merit: 7200



View Profile WWW
June 26, 2021, 03:39:39 PM
 #2

There is no need for creating separate token and blockchain for Atomic Swaps and there are projects you can use now for swapping like AtomicDex.io, that you can download and use like non-custodial wallet/dex-exchange.
Smart contracts you are proposing can often times be exploited, resulting in losing money, like we see every day on other chains like bsc with fake dex trading.


█████████████████████████
████▐██▄█████████████████
████▐██████▄▄▄███████████
████▐████▄█████▄▄████████
████▐█████▀▀▀▀▀███▄██████
████▐███▀████████████████
████▐█████████▄█████▌████
████▐██▌█████▀██████▌████
████▐██████████▀████▌████
█████▀███▄█████▄███▀█████
███████▀█████████▀███████
██████████▀███▀██████████
█████████████████████████
.
BC.GAME
▄▄░░░▄▀▀▄████████
▄▄▄
██████████████
█████░░▄▄▄▄████████
▄▄▄▄▄▄▄▄▄██▄██████▄▄▄▄████
▄███▄█▄▄██████████▄████▄████
███████████████████████████▀███
▀████▄██▄██▄░░░░▄████████████
▀▀▀█████▄▄▄███████████▀██
███████████████████▀██
███████████████████▄██
▄███████████████████▄██
█████████████████████▀██
██████████████████████▄
.
..CASINO....SPORTS....RACING..
█░░░░░░█░░░░░░█
▀███▀░░▀███▀░░▀███▀
▀░▀░░░░▀░▀░░░░▀░▀
░░░░░░░░░░░░
▀██████████
░░░░░███░░░░
░░█░░░███▄█░░░
░░██▌░░███░▀░░██▌
░█░██░░███░░░█░██
░█▀▀▀█▌░███░░█▀▀▀█▌
▄█▄░░░██▄███▄█▄░░▄██▄
▄███▄
░░░░▀██▄▀


▄▄████▄▄
▄███▀▀███▄
██████████
▀███▄░▄██▀
▄▄████▄▄░▀█▀▄██▀▄▄████▄▄
▄███▀▀▀████▄▄██▀▄███▀▀███▄
███████▄▄▀▀████▄▄▀▀███████
▀███▄▄███▀░░░▀▀████▄▄▄███▀
▀▀████▀▀████████▀▀████▀▀
F848 (OP)
Newbie
*
Offline Offline

Activity: 10
Merit: 0


View Profile
June 26, 2021, 04:25:09 PM
 #3

There is no need for creating separate token and blockchain for Atomic Swaps and there are projects you can use now for swapping like AtomicDex.io, that you can download and use like non-custodial wallet/dex-exchange.


There is no leverage on AtomicDex, and each trade is actually executed as an Atomic Swap. It is a nice project for the average Joe looking to buy some Altcoin, but it’s not practical for power traders.
As it states on their website, for example:

Quote
Atomic swaps are designed such that both traders either receive the funds they desire, or nothing happens at all and both traders retain the funds they started with.

"Nothing happens at all" is exactly the problem. Your liquidity gets stuck in a canceled Atomic Swap and the market moves away from you.
This is why a penalty (claim of collateral) is needed; and this penalty can only be enacted by a system that can judge whether the TX was executed or not, on the real actual BTC or ALT chain.

Quote
Smart contracts you are proposing can often times be exploited, resulting in losing money, like we see every day on other chains like bsc with fake dex trading.

The $TRADE chain would be an actual standalone blockchain or DAG structure or what have you. But it’s a Smart Contract in the sense that it is aware of things "outside of it" and has specialized logic to interact with these.
It’s also a Smart Contract in the sense that competing instances could co-exist rather peacefully.
XeroTOP
Newbie
*
Offline Offline

Activity: 2
Merit: 0


View Profile
June 26, 2021, 04:28:55 PM
 #4

I want to propose a clever mechanism here for building actual markets/exchanges with Atomic Swap technology.

The basic idea is to run a sort of "smart contract" that is really a specialized blockchain of its own.
It does not matter which consensus algorithm it uses, the important points are:

- Has specialized transaction types for making and taking BTC/ALT Atomic Swap offers
- Is 'aware' of Bitcoin chain
- Is 'aware' of Altcoin chain
- Has a native token, let’s call it $TRADE (The native token could be airdropped, mined, backed by USD, whatever works well)

Now an offer to swap BTC/ALT looks something like:
- Volume
- Rate
- Collateral in $TRADE (deposited with the offer)
- Required taker collateral in $TRADE

What is the collateral for? Atomic Swap markets are easily DoS-attackable, you just initiate lots of trades, but don’t follow through with the Atomic Swap protocol. In my proposed design, if either side stops following protocol, they lose their collateral to the counterparty.
That is, in the happy case, both sides can conduct the Atomic Swap entirely in private and simply sign off on a final "Atomic Swap executed" TX jointly, to unlock both of their collaterals on the $TRADE chain.
In the unhappy case that one side tries to dodge the Swap, the victim commits a "complaint" tx to the $TRADE chain. If the perpetrator does not respond with a counter-proof (by pointing to the TX it has conducted on the BTC or ALT chain), their collateral is claimed.
(Inspired by this article: https://medium.com/@graycoding/lessons-learned-from-making-a-chess-game-for-ethereum-6917c01178b6)

Now the interesting thing is we don’t have to dictate the amount of collateral deposited. We can let the market decide.
You can offer better exchange rates, at lower collateral, or worse rates at higher collateral.
At any point, if the unrealized loss from your position exceeds the collateral, you will probably just forfeit the collateral instead of following through with the Swap.
See this very good article for an intro to these dynamics: https://blog.bitmex.com/atomic-swaps-and-distributed-exchanges-the-inadvertent-call-option/

(What you can also try is to build a reputation (your trade history can be public on-chain, after all) as being an honest trader that always Swaps, letting you 'get away' with lower collateral because you have executed 1000 Swaps and dodged 0, for example.)

_____

OK, now we take this to another level. We don’t want every trade to actually be an Atomic Swap – transactions on $BTC and other chains are costly!
Let’s make positions fungible.

Alice posts offer:
- 1 BTC for 50 ALT
- Collateral 100 $TRADE, taker has to bring the same. Let’s say 100 $TRADE is worth 0.1 BTC, so the collateral covers 10% of the position.

Bob takes the offer. Now Bob owes Alice 50 $ALT and Alice owes Bob 1 $BTC. We can think of these as 'positions' in trading,
as long as neither Bob nor Alice insists on the Atomic Swap being executed, they simply hold the 'Call Option'.

Market develops, Carol comes around and posts offer:
- 55 ALT for 1 BTC
- 110 $TRADE collateral

Bob can use the +1 BTC position he holds against Alice, to take this trade! He pockets the 5 $ALT / 10 $TRADE winnings.
Now we have:
- Carol owes Alice 50 $ALT
- Carol owes Bob 5 $ALT, or 10 $TRADE (excess collateral)
- Alice owes Carol 1 BTC
- The position between Alice and Carol is collateralized with 100 $TRADE as before. (Collateral must not shrink)

Bob can now demand payment of 5 $ALT from Carol. Again if Carol does not pay, he complains on the $TRADE chain and the chain decides to let him claim the 10 $TRADE collateral, unless Carol can point to the transaction on the ALT chain where she has actually paid Bob.

Note that Bob needed to find an offer that had a better rate as well as excess collateral to cover his winnings.
He could’ve also made use of an offer that had the _same_ rate, but more collateral, and just claim the excess collateral!

_____


What we discovered is that Bob can trade with leverage. Maybe he owns neither 1 BTC or 50 ALT – he just owns 0.1 BTC worth of $TRADE. So he just traded with 10x leverage.
The scheme is extremely capital-efficient. Rather than locking up the complete worth of the position like in a spot market, or taking out a loan to fund a leveraged position, you transparently engage in trades that are in the end only secured by the collateral.
As the Bitmex article put it, »it may be better to embrace the call option feature as a viable product, rather than ignoring or fighting it.«

Since both "force execution of a position" and "exit a position by trading it away" would be actions on the $TRADE chain, Alice can try calling Bob out on his leveraged play, by frontrunning his trade TX with a TX that forces their pending Swap to start being executed.
In this case, his lack of real funds would come to light and he’d lose his position AND his collateral, even though he was winning the trade! This is a feature.

So, to make life for people like Bob feasible, we can introduce timing windows to positions, e.g. "this Atomic Swap can only be forced to execute from Oct 1, and no later than Oct 3" – like Futures. So if Bob takes the position with Alice on Sep1, he’s got 1 month to exit until his 'bluff' can be called.
He can 'roll' his futures by finding trades of Oct1 vs. Nov1 position etc. A lot of different markets can develop on the $TRADE chain. The number of actually executed Atomic Swaps may grow very very small, but the threat of forcing execution is the thing that makes this market work completely without price Oracles.

There’s a lot of questions I haven’t touched in this overview, and maybe the idea holds a fatal flaw – hard to tell. Would love to hear input on this.

Stray notes:
- Of course there must be BTC/TRADE and ALT/TRADE markets, too
- Many trade-chains can exist and parallel and be arbitraged between, it works wonderfully, scales
- Frontends could offer close-to normal exchange experience, hide the nitty-gritty details of comparing different offers
- Closing one position via another trade can also be done just partially, with the obvious implications of looking at keeping collateral/volume ratio the same etc.
- Positions can also demand an up-front premium in exchange for better rates, mimicking Options. The premium can even be payable in BTC or ALT, does not have to be $TRADE
- To avoid adjusting rates on your offers all the time, you can hook into external price streams. Basically you demand from the Taker a "signed message from #myFavorityCentralizedExchange" that asserts the rate at block height X is Y. Your favorite exchange publishes these messages as a service. Could be multi-sig by a consortium of CEX, too. You get the idea.
dkbit98
Legendary
*
Offline Offline

Activity: 2240
Merit: 7200



View Profile WWW
June 26, 2021, 07:27:17 PM
 #5

There is no leverage on AtomicDex, and each trade is actually executed as an Atomic Swap. It is a nice project for the average Joe looking to buy some Altcoin, but it’s not practical for power traders.
Yeah, there is no leverage trading on AtomicDex, but you are saying that you want to use some new blockchain, so there is no way for this to work as fully atomic swaps, and we probably need to trust some third party for this swaps, and that is not trustless.

The $TRADE chain would be an actual standalone blockchain or DAG structure or what have you. But it’s a Smart Contract in the sense that it is aware of things "outside of it" and has specialized logic to interact with these.
It’s also a Smart Contract in the sense that competing instances could co-exist rather peacefully.
DAG is not even a blockchain but more like a spreadsheet, and smart contracts have shown to experimental and buggy, and doing leverage with other altcoins is a stupid idea in my opinion.

█████████████████████████
████▐██▄█████████████████
████▐██████▄▄▄███████████
████▐████▄█████▄▄████████
████▐█████▀▀▀▀▀███▄██████
████▐███▀████████████████
████▐█████████▄█████▌████
████▐██▌█████▀██████▌████
████▐██████████▀████▌████
█████▀███▄█████▄███▀█████
███████▀█████████▀███████
██████████▀███▀██████████
█████████████████████████
.
BC.GAME
▄▄░░░▄▀▀▄████████
▄▄▄
██████████████
█████░░▄▄▄▄████████
▄▄▄▄▄▄▄▄▄██▄██████▄▄▄▄████
▄███▄█▄▄██████████▄████▄████
███████████████████████████▀███
▀████▄██▄██▄░░░░▄████████████
▀▀▀█████▄▄▄███████████▀██
███████████████████▀██
███████████████████▄██
▄███████████████████▄██
█████████████████████▀██
██████████████████████▄
.
..CASINO....SPORTS....RACING..
█░░░░░░█░░░░░░█
▀███▀░░▀███▀░░▀███▀
▀░▀░░░░▀░▀░░░░▀░▀
░░░░░░░░░░░░
▀██████████
░░░░░███░░░░
░░█░░░███▄█░░░
░░██▌░░███░▀░░██▌
░█░██░░███░░░█░██
░█▀▀▀█▌░███░░█▀▀▀█▌
▄█▄░░░██▄███▄█▄░░▄██▄
▄███▄
░░░░▀██▄▀


▄▄████▄▄
▄███▀▀███▄
██████████
▀███▄░▄██▀
▄▄████▄▄░▀█▀▄██▀▄▄████▄▄
▄███▀▀▀████▄▄██▀▄███▀▀███▄
███████▄▄▀▀████▄▄▀▀███████
▀███▄▄███▀░░░▀▀████▄▄▄███▀
▀▀████▀▀████████▀▀████▀▀
F848 (OP)
Newbie
*
Offline Offline

Activity: 10
Merit: 0


View Profile
June 27, 2021, 02:52:31 PM
 #6

There is no leverage on AtomicDex, and each trade is actually executed as an Atomic Swap. It is a nice project for the average Joe looking to buy some Altcoin, but it’s not practical for power traders.
Yeah, there is no leverage trading on AtomicDex, but you are saying that you want to use some new blockchain, so there is no way for this to work as fully atomic swaps, and we probably need to trust some third party for this swaps, and that is not trustless.

No no, you would do the normal fully trustless Atomic Swaps. The 'some new blockchain' construct just asserts that you actually DID go through with the Swap.
You are right, one way to do this is to have a centralized 3rd party that judges whether a Swap was executed.
But there is also the other way, which is to have a fully seperate blockchain that ALSO observes the BTC chain.
That is, the participants in the Tradechain would also run the Bitcoin chain, and when somebody claims to have executed an Atomic Swap, they include a pointer to the true Bitcoin TX as proof of that. Everyone running the Tradechain only accepts that "I did swap" claim only if their local Bitcoin chain state includes that Bitcoin tx.
The Bitcoin chain is oblivious of the Trade chain, it only sees the normal Atomic Swap transactions.
But the Trade chain is not oblivious of the Bitcoin chain: Certain types of "transaction" (like the claim to have gone through with a Swap) are validated against the Bitcoin chain state.


doing leverage with other altcoins is a stupid idea in my opinion.

Fair enough; but the upside of leverage/derivatives is tighter spreads and more liquidity in general, even if one does not use leverage.
NotATether
Legendary
*
Offline Offline

Activity: 1610
Merit: 6761


bitcoincleanup.com / bitmixlist.org


View Profile WWW
June 27, 2021, 04:12:11 PM
Merited by ABCbits (1)
 #7

What is the collateral for? Atomic Swap markets are easily DoS-attackable, you just initiate lots of trades, but don’t follow through with the Atomic Swap protocol. In my proposed design, if either side stops following protocol, they lose their collateral to the counterparty.
That is, in the happy case, both sides can conduct the Atomic Swap entirely in private and simply sign off on a final "Atomic Swap executed" TX jointly, to unlock both of their collaterals on the $TRADE chain.

This is similar to how commitment transactions in the lightning network work, so you can use lnd code as a blueprint for your ideas.

In a simple form, the two parties broadcast two transactions that has two conditional paths: a revocable delivery transaction that unlocks it where one of the parties takes everything, and a delivery transaction that also unlocks it, where the two parties get the amounts provisioned in the commitment transaction.

The first path is equivalent to "stealing" the balance and thus breaking the protocol. How LN solves this is a bit tricky because half a dozen more transactions are involved, but one idea I have is there's a third transaction made that sends all the balance to the other party. And each party gets the private keys to the others party's "release all funds transaction".

But I don't think that idea's going to work because it relies on honesty and each party is not willing to activate each others' release transactions.

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
Pmalek
Legendary
*
Offline Offline

Activity: 2772
Merit: 7160



View Profile
June 28, 2021, 10:24:29 AM
 #8

I kind of share dkbit98's view and I wouldn't want to use a brand-new asset as collateral. Collateral should be something I wouldn't want to lose or something that would make me think hard before deciding not to respect my side of the exchange. Bitcoin is such a collateral that meets that condition. A new $TRADE token would be too volatile, and I don't see too much potential value in it.   

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
F848 (OP)
Newbie
*
Offline Offline

Activity: 10
Merit: 0


View Profile
June 28, 2021, 11:59:26 AM
 #9

Yeah, I get that using a new token for this sucks. But I don’t see an alternative except locking a BTC collateral up with escrow, which is worse, because it is not trustless.
Projects like Thorchain try to use massive-multisig custody in order to model "BTC locked until arbitrary outside conditions are met" – but really it’s just the same, the Thorchain can at any point defect with the Bitcoin you have locked up in it.

The $TRADE token is not meant to be a BTC-competing cryptocurrency.
One angle that would serve to make that very clear is to use a 1:1 USD-backed token.
So, some venture raises $1 Billion USD to launch a trade chain. Anybody can buy into that chain by exchanging USD for $TRADE. (Could even be KYC’d and all.)
Now the trade chain works nicely, traders can join anonymously by spending BTC to get $TRADE from KYC’d traders.
In order to cash out your $TRADE for USD again, perhaps you have to pay a 4% fee and also go through KYC.

In this design, it’s clear that 1 $TRADE will always be worth around 1 USD: It’s not a speculative asset.

Of course, this instance of the trade chain would be limited to $1 Billion USD collateral capacity.
But a competitor could raise $2 Billion and launch another instance of the chain. Now there’s $3 Billion overall, both chains can easily be arbitraged between – nice.
NotATether
Legendary
*
Offline Offline

Activity: 1610
Merit: 6761


bitcoincleanup.com / bitmixlist.org


View Profile WWW
June 28, 2021, 06:04:49 PM
 #10

Yeah, I get that using a new token for this sucks. But I don’t see an alternative except locking a BTC collateral up with escrow, which is worse, because it is not trustless.
~
In this design, it’s clear that 1 $TRADE will always be worth around 1 USD: It’s not a speculative asset.

When you launch a token to an exchange, it's inevitably going to be exposed to the end-user by it to speculate on. See USDT for example.

Smart contacts (by this I mean scripts with lots of paths and conditions in them for alternate transactions) can enforce atomic swaps up to a certain point, going back to the LN example even the specification relies on the user to manually broadcast the penalty transaction if the handshake is violated. There's simply no way to broadcast the transaction from within a script, it's not a programming language. And automatic broadcasting is required to implement the second part of the trade, after the first part is broadcasted manually. And nevermind trying to sign such nested transactions securely without exposing private keys, I suspect this is how most smart contracts get hacked in the first place.

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!