Bitcoin Forum
April 26, 2024, 01:33:54 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1] 2 »  All
  Print  
Author Topic: Brainstorming: On chain decentralized exchange possible on Bitcoin Blockchain?  (Read 462 times)
100bitcoin (OP)
Sr. Member
****
Offline Offline

Activity: 860
Merit: 423


View Profile WWW
January 05, 2020, 02:26:10 PM
 #1

Recently I used Uniswap Exchange, which appears to be a fantastic product to me. It is a simple smart contract interface for swapping ERC20 tokens. I wonder, if a similar product is possible on Bitcoin Blokchain. USDT, BSQ, RSK and some other tokens already runs on Bitcoin Blockchain. How about a decentralized asset exchange between BTC and these tokens? Is not it technically feasible?

1714095234
Hero Member
*
Offline Offline

Posts: 1714095234

View Profile Personal Message (Offline)

Ignore
1714095234
Reply with quote  #2

1714095234
Report to moderator
1714095234
Hero Member
*
Offline Offline

Posts: 1714095234

View Profile Personal Message (Offline)

Ignore
1714095234
Reply with quote  #2

1714095234
Report to moderator
1714095234
Hero Member
*
Offline Offline

Posts: 1714095234

View Profile Personal Message (Offline)

Ignore
1714095234
Reply with quote  #2

1714095234
Report to moderator
The network tries to produce one block per 10 minutes. It does this by automatically adjusting how difficult it is to produce blocks.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714095234
Hero Member
*
Offline Offline

Posts: 1714095234

View Profile Personal Message (Offline)

Ignore
1714095234
Reply with quote  #2

1714095234
Report to moderator
1714095234
Hero Member
*
Offline Offline

Posts: 1714095234

View Profile Personal Message (Offline)

Ignore
1714095234
Reply with quote  #2

1714095234
Report to moderator
1714095234
Hero Member
*
Offline Offline

Posts: 1714095234

View Profile Personal Message (Offline)

Ignore
1714095234
Reply with quote  #2

1714095234
Report to moderator
squatter
Legendary
*
Offline Offline

Activity: 1666
Merit: 1196


STOP SNITCHIN'


View Profile
January 05, 2020, 06:46:42 PM
Last edit: January 05, 2020, 06:57:36 PM by squatter
Merited by d5000 (1), pooya87 (1), ABCbits (1)
 #2

Recently I used Uniswap Exchange, which appears to be a fantastic product to me. It is a simple smart contract interface for swapping ERC20 tokens. I wonder, if a similar product is possible on Bitcoin Blokchain. USDT, BSQ, RSK and some other tokens already runs on Bitcoin Blockchain. How about a decentralized asset exchange between BTC and these tokens? Is not it technically feasible?

I'm not sure about a comprehensive DEX, but Bitcoin-based atomic swaps are possible using nLocktime and shared secrets. TierNolan pointed this out years ago:

No it's not. I assume that you mean that the problem is that B's coins will remain locked until A agrees to unlock, but this is solved with locktime as described by gmaxwell, see also here.

Sounds reasonable.

A picks a random number x

A creates TX1: "Pay w BTC to <B's public key> if (x for H(x) known and signed by B) or (signed by A & B)"

A creates TX2: "Pay w BTC from TX1 to <A's public key>, locked 48 hours in the future, signed by A"

A sends TX2 to B

B signs TX2 and returns to A

1) A submits TX1 to the network

B creates TX3: "Pay v alt-coins to <A-public-key> if (x for H(x) known and signed by A) or (signed by A & B)"

B creates TX4: "Pay v alt-coins from TX3 to <B's public key>, locked 24 hours in the future, signed by B"

B sends TX4 to A

A signs TX4 and sends back to B

2) B submits TX3 to the network

3) A spends TX3 giving x

4) B spends TX1 using x

This is atomic (with timeout).  If the process is halted, it can be reversed no matter when it is stopped.

Before 1: Nothing public has been broadcast, so nothing happens
Between 1 & 2: A can use refund transaction after 48 hours to get his money back
Between 2 & 3: B can get refund after 24 hours.  A has 24 more hours to get his refund
After 3: Transaction is completed by 2
- A must spend his new coin within 24 hours or B can claim the refund and keep his coins
- B must spend his new coin within 48 hours or A can claim the refund and keep his coins

For safety, both should complete the process with lots of time until the deadlines.

There are some alternative ideas for accomplishing the same thing without using locktime, like a specialized altchain:

Quote
Another proposal of cross-chain p2ptrade is to use specialized altchain with properties for efficient operation of p2ptrade from bitcoin chain. Additionally, we use only single standard bitcoin transaction which looks exactly the same as normal payment (no nlocktime, no multisig, no special script).

Assuming the altchain has actual economic value to support it, it can even serve as proxy for (relatively) efficient zero-trust p2p market between fe. BTC and LTC thanks to arbitraging market makers.

The Lightning Network can also facilitate this:

Quote from: achow101
If someone wanted to be paid in Litecoin over the Lightning Network but you only have Bitcoin channels, you can (in theory, I don't know if this is implemented) route your payment through a node that has both Bitcoin and Litecoin channels using the same HTLC secrets and it would be totally fine. The only caveat is the exchange rate between Bitcoin and Litecoin which would have to be negotiated with that node doing the bridging between Bitcoin and Litecoin.
https://bitcointalk.org/index.php?topic=4638321.msg48997244#msg48997244

100bitcoin (OP)
Sr. Member
****
Offline Offline

Activity: 860
Merit: 423


View Profile WWW
September 19, 2020, 07:52:52 PM
 #3

Revisiting this thread after a long time because I stumbled upon an article. Most of you have opined here that Decentralized Exchange is not possible on Bitcoin Blockchain. But, the following article is claiming otherwise. What is your opinion?

Bitcoin DeFi May Be Unstoppable: What Does It Look Like?

notblox1
Legendary
*
Offline Offline

Activity: 2044
Merit: 1263


Logo Designer ⛨ BSFL Division1


View Profile WWW
September 21, 2020, 11:14:22 PM
 #4

Defi built directly on bitcoin blockchain would be a bad idea, because even uniswap that is on ethereum have problems with huge fees and failed transactions.
That being said, I believe some people are working on second layer solution that will enable better decentralized exchange for Bitcoin.
This is better because fees can be much lower and transaction can be faster. Meanwhile, we can use Bisq exchange.

BIP-119 sure looks interesting:
https://utxos.org/
 

██
██
██
██
██
██
██
██
██
██
██
██
██
... LIVECASINO.io    Play Live Games with up to 20% cashback!...██
██
██
██
██
██
██
██
██
██
██
██
██
Last of the V8s
Legendary
*
Offline Offline

Activity: 1652
Merit: 4392


Be a bank


View Profile
September 22, 2020, 07:00:17 AM
 #5

does not make sense to have an order book on a blockchain
former is inconstant, latter immutable

pooya87
Legendary
*
Offline Offline

Activity: 3430
Merit: 10499



View Profile
September 22, 2020, 07:26:26 AM
 #6

does not make sense to have an order book on a blockchain
former is inconstant, latter immutable

the order-book itself is not stored on the blockchain, there is no reason for that. it can be anywhere because there is no reason for it to even be stored. the contract or the script which is the executed order or the trade is stored on the blockchain.

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
Last of the V8s
Legendary
*
Offline Offline

Activity: 1652
Merit: 4392


Be a bank


View Profile
September 22, 2020, 07:45:02 AM
 #7

good but then the exchange isn't decentralised

pooya87
Legendary
*
Offline Offline

Activity: 3430
Merit: 10499



View Profile
September 22, 2020, 10:22:31 AM
 #8

good but then the exchange isn't decentralised

why?!! there is no centralized authority or a middle man involved. it can easily happen peer to peer and then settled on bitcoin chain.
i don't see how you see any traces of centralization in this.

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

Activity: 1582
Merit: 6681


bitcoincleanup.com / bitmixlist.org


View Profile WWW
September 22, 2020, 12:09:09 PM
Merited by vapourminer (1)
 #9

I see a big problem blocking this from being launched, and that is funding for nodes to run on whatever sidehain they make. It could be as simple as giving universities money to host their own nodes, if you need to get a lot of nodes up quickly controlled by different parties without an agenda. But who is going to spend millions to prop up a sidechain like that?

Even LN doesn't have enough nodes running to make a full scale network (I'll probaby end up helping out running one myself if I can obtain a dedicated host), but at least they have nodes to start with, so let's piggyback on the sidechain that made the most progress.

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

Activity: 2114
Merit: 1292


There is trouble abrewing


View Profile
September 22, 2020, 03:28:00 PM
 #10

I see a big problem blocking this from being launched, and that is funding for nodes to run on whatever sidehain they make. It could be as simple as giving universities money to host their own nodes, if you need to get a lot of nodes up quickly controlled by different parties without an agenda. But who is going to spend millions to prop up a sidechain like that?

running a bitcoin full node doesn't cost anywhere near millions so why should a running a node on side chain cost that much money? besides what you are suggesting is centralization and if that is the only solution then we are better off using the existing centralized exchanges instead.

There is a FOMO brewing...
BrewMaster
Legendary
*
Offline Offline

Activity: 2114
Merit: 1292


There is trouble abrewing


View Profile
September 23, 2020, 04:43:09 PM
 #11

It could be more expensive to run node for sidechain if:
1. It has bigger block size limit or lower block time
2. It uses more "expensive" cryptography, such as zero-knowledge proof
3. It's designed to store all kinds of data

true but even if it costs "a lot" to run such a node it won't be and can not be close to costing millions to run it otherwise it won't work.
besides, unlike bitcoin's blockchain that needs to store the history of all transactions, such sidechain doesn't have to store the history of all trades so it won't need to store that much data (if any since the trade itself doesn't have to be recorded in my opinion).

There is a FOMO brewing...
d5000
Legendary
*
Offline Offline

Activity: 3892
Merit: 6085


Decentralization Maximalist


View Profile
September 25, 2020, 08:16:35 PM
 #12

Well there are some options already:

Atomic DEX - while not a Bitcoin-exclusive project, it uses Bitcoin Script for atomic swaps like @squatter showed them above, and an additional P2P network for order matching. In my opinion, an underrated project (I have started a thread about it here), even if it may seem questionable that they charge fees.

Omni, which was the first DEX ever and already exists since 2014, is also using pure Bitcoin technology. It can't exchange currencies on other blockchains but only Bitcoin-based Omni tokens, (like the original TetherUSD). But always take into account that "Ethereum DEXes" like Uniswap also only can exchange Ethereum-based tokens.

One very interesting aspect of Omni is OmniBOLT which is a work-in-progress solution to transfer Omni tokens via Lightning. This would be the "ultimate solution" for token transfer and exchange.

There is also Counterparty which was a bit "forgotten" lately and is basically something very similar to Omni.

And there are more obscure projects like OpenAssets (which is outdated) and PeerAssets, all based on pure Bitcoin script (even if the latter was designed for Peercoin).

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
Wind_FURY
Legendary
*
Offline Offline

Activity: 2898
Merit: 1822



View Profile
September 27, 2020, 11:30:46 AM
 #13

8 months on after OP, the Ethereum network has also been suffering to that thing that the Ethereans has been criticizing Bitcoin for. Their solution, sharding, is more complexity, but for small, and unsure benefit.

██████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
██████████████████████
.SHUFFLE.COM..███████████████████████
███████████████████████
███████████████████████
███████████████████████
███████████████████████
█████████████████████
████████████████████
██████████████████████
████████████████████
██████████████████████
███████████████████████
███████████████████████
███████████████████████
███████████████████████
███████████████████████
███████████████████████
██████████████████████
██████████████████████
██████████████████████
███████████████████████
███████████████████████
███████████████████████
███████████████████████
███████████████████████
███████████████████████
███████████████████████
.
...Next Generation Crypto Casino...
BrewMaster
Legendary
*
Offline Offline

Activity: 2114
Merit: 1292


There is trouble abrewing


View Profile
September 27, 2020, 02:24:39 PM
 #14

8 months on after OP, the Ethereum network has also been suffering to that thing that the Ethereans has been criticizing Bitcoin for. Their solution, sharding, is more complexity, but for small, and unsure benefit.

you mean the huge transaction fees? that's not new for ethereum. it has always had a much worse scaling issue than bitcoin. it was jut not noticeable as much because unlike bitcoin it is not under magnifying glass and of course its usage is far less than bitcoin's. but every now and then with a small surge of token scams (like the DEFI these days) it shoots up.
i don't think sharding would change anything about fees though. it would only make syncing and running a full node easier (even though more centralized).

There is a FOMO brewing...
BitcoinGirl.Club
Legendary
*
Offline Offline

Activity: 2758
Merit: 2711


Farewell LEO: o_e_l_e_o


View Profile WWW
September 27, 2020, 03:58:21 PM
Last edit: May 14, 2023, 04:50:48 PM by BitcoinGirl.Club
 #15

8 months on after OP, the Ethereum network has also been suffering to that thing that the Ethereans has been criticizing Bitcoin for. Their solution, sharding, is more complexity, but for small, and unsure benefit.

you mean the huge transaction fees? that's not new for ethereum. it has always had a much worse scaling issue than bitcoin. it was jut not noticeable as much because unlike bitcoin it is not under magnifying glass and of course its usage is far less than bitcoin's. but every now and then with a small surge of token scams (like the DEFI these days) it shoots up.
i don't think sharding would change anything about fees though. it would only make syncing and running a full node easier (even though more centralized).
I was looking for historical fees for ETH and it seems indeed the fees are way to high then anytime.


https://bitinfocharts.com/comparison/ethereum-transactionfees.html

You are right about other things like, unlike bitcoin ETH is not really in much of use so the circulation is less too.

▄▄███████▄▄
▄██████████████▄
▄██████████████████▄
▄████▀▀▀▀███▀▀▀▀█████▄
▄█████████████▄█▀████▄
███████████▄███████████
██████████▄█▀███████████
██████████▀████████████
▀█████▄█▀█████████████▀
▀████▄▄▄▄███▄▄▄▄████▀
▀██████████████████▀
▀███████████████▀
▀▀███████▀▀
.
 MΞTAWIN  THE FIRST WEB3 CASINO   
.
.. PLAY NOW ..
BrewMaster
Legendary
*
Offline Offline

Activity: 2114
Merit: 1292


There is trouble abrewing


View Profile
September 27, 2020, 04:18:42 PM
 #16

I was looking for historical fees for ETH and it seems indeed the fees are way to high then anytime.

well the situation has been spiraling out of control as ETH is on a bad path. so each cycle when the scam hypes grow in number the fee situation becomes a little worse. otherwise the chart (or the one on blockchair which is better) shows this common occurrence clearly.

There is a FOMO brewing...
BitcoinGirl.Club
Legendary
*
Offline Offline

Activity: 2758
Merit: 2711


Farewell LEO: o_e_l_e_o


View Profile WWW
September 27, 2020, 06:02:15 PM
 #17

well the situation has been spiraling out of control as ETH is on a bad path. so each cycle when the scam hypes grow in number the fee situation becomes a little worse. otherwise the chart (or the one on blockchair which is better) shows this common occurrence clearly.
I never paid much attention on how ETH fees calculation works. Unlike bitcoin with ETH I have always used the suggested fees the wallet does and very few times I have used ETH so may be I will not talk much about it.

PS: In the blockchair I could not find any data which shows fees analysis. Which corner it is hiding?

▄▄███████▄▄
▄██████████████▄
▄██████████████████▄
▄████▀▀▀▀███▀▀▀▀█████▄
▄█████████████▄█▀████▄
███████████▄███████████
██████████▄█▀███████████
██████████▀████████████
▀█████▄█▀█████████████▀
▀████▄▄▄▄███▄▄▄▄████▀
▀██████████████████▀
▀███████████████▀
▀▀███████▀▀
.
 MΞTAWIN  THE FIRST WEB3 CASINO   
.
.. PLAY NOW ..
PrimeNumber7
Copper Member
Legendary
*
Offline Offline

Activity: 1610
Merit: 1899

Amazon Prime Member #7


View Profile
September 27, 2020, 11:13:50 PM
 #18

.
There is a lot you can do with Etherium, but the problem is that it is all on chain, which is really not scalable. Think of all the times bitcoin fees have spiked, and multiple that times 100 (or more) because of all the different types of things that can cause ETH fees to spike.

does not make sense to have an order book on a blockchain
former is inconstant, latter immutable
does not make sense to have an order book on a blockchain
former is inconstant, latter immutable

the order-book itself is not stored on the blockchain, there is no reason for that. it can be anywhere because there is no reason for it to even be stored. the contract or the script which is the executed order or the trade is stored on the blockchain.
good but then the exchange isn't decentralised
It is not realistic to keep every bid/ask on the blockchain. That is too many transactions, and waiting 10 minutes (on average) to submit a bid or an ask is not going to attract any users. I don't think any of the existing DEXs keep their orderbook on the blockchain, they only use the blockchain for settlement.
Wind_FURY
Legendary
*
Offline Offline

Activity: 2898
Merit: 1822



View Profile
September 28, 2020, 07:35:50 AM
 #19

8 months on after OP, the Ethereum network has also been suffering to that thing that the Ethereans has been criticizing Bitcoin for. Their solution, sharding, is more complexity, but for small, and unsure benefit.

you mean the huge transaction fees? that's not new for ethereum. it has always had a much worse scaling issue than bitcoin. it was jut not noticeable as much because unlike bitcoin it is not under magnifying glass and of course its usage is far less than bitcoin's. but every now and then with a small surge of token scams (like the DEFI these days) it shoots up.


Yes, plus the blockchain-bloat, making it hard to run an actual full node.

Quote

i don't think sharding would change anything about fees though. it would only make syncing and running a full node easier (even though more centralized).


I have been debating that point. It's added complexity, added risk, just for a small benefit.

Plus if the miners a required to have all the blocks, that's not sharding.

██████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
██████████████████████
.SHUFFLE.COM..███████████████████████
███████████████████████
███████████████████████
███████████████████████
███████████████████████
█████████████████████
████████████████████
██████████████████████
████████████████████
██████████████████████
███████████████████████
███████████████████████
███████████████████████
███████████████████████
███████████████████████
███████████████████████
██████████████████████
██████████████████████
██████████████████████
███████████████████████
███████████████████████
███████████████████████
███████████████████████
███████████████████████
███████████████████████
███████████████████████
.
...Next Generation Crypto Casino...
Wind_FURY
Legendary
*
Offline Offline

Activity: 2898
Merit: 1822



View Profile
September 28, 2020, 10:49:23 AM
 #20

8 months on after OP, the Ethereum network has also been suffering to that thing that the Ethereans has been criticizing Bitcoin for. Their solution, sharding, is more complexity, but for small, and unsure benefit.

you mean the huge transaction fees? that's not new for ethereum. it has always had a much worse scaling issue than bitcoin. it was jut not noticeable as much because unlike bitcoin it is not under magnifying glass and of course its usage is far less than bitcoin's. but every now and then with a small surge of token scams (like the DEFI these days) it shoots up.

That's the price of wanting doing and storing everything you could on blockchain.

i don't think sharding would change anything about fees though. it would only make syncing and running a full node easier (even though more centralized).

When it's far cheaper to run sharding node, i'm sure ETH community will agree to increase block gas limit (which determine block size limit).


If I run a "sharding-node", do I trust the other "sharding-nodes" of the other shard, instead of the consensus itself?

Would it be considered sharding if the miners are required to have all the blocks?

██████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
██████████████████████
.SHUFFLE.COM..███████████████████████
███████████████████████
███████████████████████
███████████████████████
███████████████████████
█████████████████████
████████████████████
██████████████████████
████████████████████
██████████████████████
███████████████████████
███████████████████████
███████████████████████
███████████████████████
███████████████████████
███████████████████████
██████████████████████
██████████████████████
██████████████████████
███████████████████████
███████████████████████
███████████████████████
███████████████████████
███████████████████████
███████████████████████
███████████████████████
.
...Next Generation Crypto Casino...
Pages: [1] 2 »  All
  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!