• Forum has been upgraded, all links, images, etc are as they were. Please see Official Announcements for more information

Mint-Gox

So Cofresi spend half his weekend with a bottle of aged dominican rum, the voices in my head speaking of nothing but a decentralised drk exchange...

Mind having a very close look and tell me exactly what flaws you see and what could be wrong with this:

Cofresi's simple in-wallet btc/drk p2p exchange that leverages masternodes

Let me introduce the usual suspects....

Brokers

Server daemons, entirely separate from the darkcoind binary, running on those Masternodes whose owners are ready to take the risk and the opportunity to be a currency exchange broker for btc/drk. Some flags in the config file of this daemon could be the exact same as in darkcoind to identify the masternode and tie it to its hot or cold wallet's public key, e.g. the masternodeprivkey and whatever else is necessary, for the commission payments. The deamon runs on a separate port, e.g. 8888. China very lucky number. As a matter of fact, the brokers are nothing more than a simple bid/ask matching engine. They serve their trading clients and should be able to handle multiple clients at once. They are just here to bring the traders together very quickly. Apart from their commission they never get any money from their clients. The trades happen without them. As a masternode and just like the darkcoind deamon, the brokers will have an identifying token on the token based multi-path routing system. This token is used for inter broker communication. It should only be possible to run the broker daemon on an active masternode that fulfills the requirements of 1000 drk.

Traders (Alice & Bob)

Say Alice wants to buy 100 drk for 0.01 drk/btc with btc (BID)
Say Bob wants to sell 100 drk for 0.01 drk/btc for btc (ASK)

Distributed Order Book

I'm not be a big fan of using the drk or btc blockchain because of privacy issues and bloat.

For the sake of simplicty, I propose to make use of an already existing technology like bitmessage and adapt it to our needs. Let's call it Bidmessage. Like Bitmessage, Bidmessage doesn't have a blockchain but each client sends its messages to all users. The nodes store all those messages for two days and then delete them. I think that's perfect for our exchange wallets and masternode brokers. This message storage time could obviously be changed if needed. It's just our currency exchange internal order message storing system, so there shouldn't be any scalability problem. To prevent spam, bitmessage uses POW for each message which takes around 4 min. on an average computer. That would be impossibly long and we don't really need POW to prevent order spam, because the traders will have to pay a collateral into a deposit account in advance which later will serve as the commission for the broker. So every order message on Bidmessage needs to include the txid of the collateral transaction in order for the system to verify that the collateral has been paid. Also every message needs to include the token of the client's broker, so the broker of a matched trader can connect to with them.

https://bitmessage.org/bitmessage.pdf

Order protocol

https://bitmessage.org/wiki/Protocol_specification

Some simple and easy parseable order message which is packed into Bidmessage protocol. Like a json string with the all necessary variables

action (buy or sell)
currency to buy (drk or btc)
currency to sell (drk or btc)
order type (market or limit)
limit (limit price)
order amount
order expiration (day, gtc)
payout address (the drk or btc address where the bought coins should be sent)
txid of collateral multisig
broker token

Trades

Alice's trade order process

In order to place a market order for 100 drk at the price of 0.01 btc/drk the following steps are necessary

- Alice puts in the order info in the exchange wallet's GUI and hits SUBMIT
- Alice's exchange wallet connects to a free broker in the exchange network
- The exchange wallet sets up a collateral multisig account with the broker (2-of-2 in the btc blockchain)
- Alice's exchange wallet sends a percentage of the trading value of 1 btc (0.01 btc) into the collateral account
- Alice's exchange wallet can now broadcast the order message to the exchange network

Bob's trade order process

In order to place a market order for 1 btc at the price of 0.01 btc/drk the following steps are necessary

- Bob puts in the order info in the exchange wallet's GUI and hits SUBMIT
- Bob's exchange wallet connects to a free broker in the exchange network
- The exchange wallet sets up a collateral multisig account with the broker (2-of-2 in the drk blockchain)
- Bob's exchange wallet sends a percentage of the trading value of 100 drk (1 drk) into the collateral account
- Bob's exchange wallet can now broadcast the order message to the exchange network

Bid/Ask order matching and atomic cross chain transfer

The brokers constantly scan existing or new Bidmessage messages for new Bid/Ask orders that match the orders of their clients (Alice & Bob).
Once a broker found one or more matching order where BID >= ASK or ASK <= BID, even only partial fills, they take the oldest by timestamp matching order and try to connect
to the broker of the matched client. If they are the first to connect, they lock the order, fix a settlement price and broadcast to the network that
the order was fully filled or, in case of a partial fill, broadcast the same order again with the order amount accordingly reduced.

Alice and Bob have now been matched. The atomic cross chain transfer algorithm according to TierNolan can now be initiated. A = Alice's wallet. B = Bob's wallet. This exchange between the wallets happens almost instantaneous. The long refund times are just here in case something goes wrong (like if Bob would have changed the behaviour of his wallet and not pay A after receiving TX3).

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.

https://bitcointalk.org/index.php?topic=193281.msg2224949#msg2224949

Again: this exchange between A and B is instantaneous and the deadlines will never be used as long as nobody tampered with the code in their wallets. I think this could be misunderstood because the quoted algorithm works just the same for two people doing everything manually. Since our wallets A and B are doing the same automatically, the process is fast as hell.

Since ultimately the traded amounts are transfered without the interference of the brokers, we shouldn't worry about the brokers being hacked or abused to steal funds. Except for the commission/collateral, it is really a peer to peer transfer.

Once the newly bought coins hit the payout address in Alice's and Bob's wallets, the collateral is released and goes to the broker masternodes public address as a commission.

Distributing broker work evenly amongst masternodes

All broker masternodes are constantly accepting new clients and scanning the Bidmessage messages for matching orders. Those with more network capacity and faster hardware can broker more trades and earn more commissions.

Multi-currency wallet

A little inconvenient shock to finish off my thoughts: in order for everything to happen in-wallet, inside the DarkcoinQT or whatever other client solution, we need to somehow merge a drk wallet with a btc wallet. Sounds like a perversion. Do we really need to do this? Well, I just don't think we should forfeit the chance of really taking control and leaving the btc side of the trading outside of the Exchange-GUI and the whole thing split across different wallets.

To keep it more light, maybe we could merge the btc/drk electrum wallets and fork a ultra-light multi-currency electrum exchange wallet instead of needing to import the btc blockchain into the DarkcoinQT. That would also facilitate a later merge with other electrum ready cryptos. On the other hand, most people that do btc/drk trading probably have the btc blockchain already on their computer, so in order to import the btc wallet into the DarkcoinQT, on the GUI-side of things it would require only a simple import wizard that asks for the wallet.dat, the privatekey and the encryption password. And a extra tab for the btc wallet.

That's it. So who's gonna code it up already? I can't. No good C++.

- Different Exchanges can compete for customers (voting system, who is best and trusted...
let the exchanges compete on quality of service and user experience)
Tx TT for the input

The system I discribed doesn't include different exchanges living in the masternode servers. It would be just one darkcoin network wide exchange. I couldn't really grasp how TT imagined this. Tungfa, maybe you or TT can clarify?
 
Last edited by a moderator:
hey Cofresí
good thinking, wish i had a ottel of rum, but just have a coffee in hand.

The thing is that you still need exchanges with big volume of DRK + BTC involved, if you go bob sells to marry as bob wants 20 DRK, it will take forever to trade as bob is in Hong Kong and Mary is in USA (Time difference) ! that time difference between the two gives the market enough time to change. even if i put my order in at 0.0059 and it is in escrow, before Mary wakes up to confirm, the market is already at 0.0065, or 0.0045 so bob will pull his buy order as he wants to get a good price.
to open this/us up to exchanges means speed and volume. If you wanna buy, you wanna buy now as the price is right, with private people we will not accomplish that.
If we open ourself up to Exchanges who have to look for customers (being good, reliable, volume and price) we can stay on the same speed we are trading now !
(as we want the best prices)

Localbitcoin works as it is in every city (Time Zones), i see my BTC trader being online and my 'trade' with him is done on minutes.

With DRK we would not have that as we are a much smaller niche market.
Let the exchanges do what do do best, exchange and trade, with us they just have to do it through our (DRK) wallets so we are save !

Look at the Anonymization now ! you know how hard it is to find somebody only who wants to anonymize 20 DRK ?
Have you tried , man it takes FOREVER (if you are not lucky) and with the trading it would be the same or even worth !

clearer ?
 
hey Cofresí
Look at the Anonymization now ! you know how hard it is to find somebody only who wants to anonymize 20 DRK ?
Have you tried , man it takes FOREVER (if you are not lucky) and with the trading it would be the same or even worth !

clearer ?

yes, clearer :) thanks. You're right. Pitty we don't have the volume yet. But maybe the first decentralised exchange would give us that?

ok, I'll go back to thinking how to leverage the existing exchanges into a decentralised system. Still not clear how to do that :what:
 
This is why I was pushing some kind of crowdfunding/loan to create the site's start-off volume. Once the site has visitors you won't need it anymore, but without it the site will look dead.
 
Nemo, I didn't know about ATs and I'm very grateful you came here and told us about this exciting stuff. They indeed are an ingenious creation and do have innovative potential for the crypto world.

So the short answer to your question is: yes.

The slightly longer and more technical answer is: I advise against using them, because
1. they add an additional layer of complexity to the system,
2. would take up much more development time just to implement and test everything thoroughly to make them available for our use case in the first place,
3. they carry the potential danger of bloating the blockchain in the long run, and
4. they are not really necessary to build a decentralised exchange, because we have something much better: the masternodes. How is that? See my next post.

It's not too easy to wrap one's head around how Automated Transactions work but to quickly explain at least how I understood the concept and how they could be used, here's the gist:

ATs are "automated transactions", real executable computer programs, byte code, that are put into the blockchain as a special data transaction with OP_RETURN. Think of someone putting a computer program into the blockchain instead of the odd picture of Nelson Mandela, Valentine's day messages or their marriage contract, and then this code is actually executed by the decentralised crypto system.

If I understood the concept correctly the code should be executed by the miners mining the transaction with the AT and checking its state and then updating the latter. But I'm not totally sure how it should work exactly. What's funny and scary at the same time is that they're supposed to do actual currency transactions. Interesting. They have their own address scheme and funds can be sent to them and their code can distribute those funds. In the case of darkcoin their byte code interpreter could be hosted inside the masternodes for quicker and more stable execution. E.g. One chosen execution masternode, aka the executioner, would look up the blockchain for new AT transactions, and in case he found any execute their code. A system could be developed where this process could even be checked by a set of peer masternodes which supervise the execution of the executioner and vote if everything is green or something's fishy. In case the executioner messed up, at least the transactions should be made reversible and the execution masternode banned for life. Or executed.

Some checking mechanism like that would need to be in place, because the byte code interpreter, which executes the AT's instructions, could be changed by anybody messing around with the host masternode's code.

What could make them interesting for our use case of a distributed currency exchange: ATs can be used to implement what is called atomic cross chain trading. https://en.bitcoin.it/wiki/Atomic_cross-chain_trading

Ian Knowles, the inventor of ATs, set up a bounty to do just that: https://bitcointalk.org/index.php?topic=826263.0

A simplified version of the crowdfunding AT http://ciyam.org/at/at_crowdfund.html would be a candidate to do such a atomic cross chain exchange using just ATs and TierNolans algo https://bitcointalk.org/index.php?topic=193281.msg2224949#msg2224949.

Could be a fun thing to play around, but I think we really shouldn't take any risk with experimental stuff and because at this point who can really say what this would entail for the security and stability of the darkcoin network: they might be a Pandora's box. But definitely a cool idea.

Oh my!
 
As I just mentioned on another thread, localbitcoins is offering their platform to franchisees. I wonder whether they'd be happy for BTC/DRK pairing.
 
As I just mentioned on another thread, localbitcoins is offering their platform to franchisees. I wonder whether they'd be happy for BTC/DRK pairing.

Localdarkcoin could be cool !
i only use localbitcoin for BTC purchases !!
 
I guess it comes down to what it would entail. Does anybody know roughly how much the set up costs for an exchange are? Are there any known designers in the area? If we gain get that then we simply need to crowdfund, hire and then buy the server space/domain and so on. From there it is promotion. I know that deep web exchanges have people who set them up for a fee so surely this can be done for sure for cheaper (since, of course, what we are doing is legal). Or perhaps we could talk to the ccedk guy about his site which is a bit flat at the moment and might be open to this new approach.

I am ready to hear more about this, just send me an e-mail on [email protected], or a a pm on this forum.Read your comment on the minimum 100 in withdrawal being high to begin with as someone would want to test it first, and it sounds fair, our intent was not to make it complicated at all, so we chnage accordingly.

Rgds

Ronny
 
I am ready to hear more about this, just send me an e-mail on [email protected], or a a pm on this forum.Read your comment on the minimum 100 in withdrawal being high to begin with as someone would want to test it first, and it sounds fair, our intent was not to make it complicated at all, so we chnage accordingly.

Rgds

Ronny

Will send you a PM here in a bit.
 
Actually, I wouldn’t care too much about volume and how to get right now. We need to build the p2p exchange technology first. Volume will follow.

Nobody in his right mind will ever be able to trust a centralized exchange again. Thanks to Mark K., who really deserves his place in the Guinness Book of Records for being the only faggot in history to perform the stunt of goxxxing all his clients, his entire industry plus himself into his fat hiney with only his tiny little willy. Compared to that, Alex Green is a just wannabe Mark. No matter how much trust they'd ever build up, centralized exchanges intrinsically function as a bank, and that’s just what crypto tech is in the process of rendering useless. Call it what you want, but centralized exchanges are a dying species. They’re fuxxed, passé, done with, period. And nobody will feel sorry for them.

The have a grace period. But there is not much they can do to stop the development towards p2p exchanges. Somebody will build them much sooner than later. If in two year’s time Gavin sees that ATs have established themselves well enough, that they are controlled and there’s no issue about blockain bloat, he might integrate them into Bitcoin. From then onward a Buy or Sell order is just on AT transaction into the blockchain, which can be filled by anyone spotting it first. Atomic cross chain transfer between Bitcoin and any alt that implemented AT. And that’s it. Not even the need for automated brokers anymore helping bring together Alice and Bob. A blockchain explorer listing currency exchange ATs as clickable payment requests, or an exchange wallet that auto-fills the ATs matching its own ATs and the exchange happens from A to B and B to A as easily verifiable as miners mine they’re transaction’s blocks.

Until then it could be a multi-currency wallet that acts as the front door to the p2p exchange. It doesn’t really matter. What matters though and what it all comes down to is:
  • do we as the drk community want to take over existing tech reactively, falling behind innovation and die a slow death like litecoin will.
  • or do we want to shape the future and be perceived as an innovative, proactive and just plain awesome coin?
We have something that as of this moment nobody else has. It's not working as perfectly yet as we want it to, but it’s about time we start planning on how to use our masternodes.
 
Last edited by a moderator:
Ah, Stonehedge, now I know why I've had so much indigestion!

As he stated here: https://en.bitcoin.it/wiki/Atomic_cross-chain_trading
it can only be used with BTC derived coins/chains...

He also mentions an alternative blockchain (which I can see being hosted by MNs) to solve that problem.

Anyway, we are seriously positioned to do this and it needs to get done! LOL. I have no idea on coding it though, I have no skills in that department.

If exchanges could be used to facilitate the transactions without requiring actual possession of any coins, this could seriously be the best of both worlds. exchanges provide tools and options (shorting, etc...) analysis, and things I don't understand, LOL. Let them do that! Businesses built on top of cryptos are great! But the trust factor in all these things must be eliminated!
 
Wow, sorry for being ignorant, but it seems these exchanges are another level of scam, eh? They actually got investors to invest in them, as they build the exchange, and then run off with the money? Why does an online website exchange need 700,000 bitcoins to run? I guess they have to back up each trade or something? Anyway, Cryptsy has so many fees, how could they not make money?

Yes, a trustless exchange is needed NOW!

I'm also worried that these IPOs that have raised small fortunes, are going to die off as well, leaving more bad taste in everyone's mouths.
 
Wow, sorry for being ignorant, but it seems these exchanges are another level of scam, eh? They actually got investors to invest in them, as they build the exchange, and then run off with the money? Why does an online website exchange need 700,000 bitcoins to run? I guess they have to back up each trade or something? Anyway, Cryptsy has so many fees, how could they not make money?

Yes, a trustless exchange is needed NOW!

I'm also worried that these IPOs that have raised small fortunes, are going to die off as well, leaving more bad taste in everyone's mouths.


yes they so are
we really need a decentralized DRK exchange !!
If we had a C++?GUI Developer on hand we could really look into converting our QT Wallets into something like that,
I am looking and looking but can NOT find anybody !!

Any Tips ?!
Am happy to do a fundraiser for a bounty and such !! ...>
 
Hey guys I just noticed that Counterparty wallets have an in-built exchange going on. Could we not try this? Take a look at their wallets to see what I mean.
 
Hey guys I just noticed that Counterparty wallets have an in-built exchange going on. Could we not try this? Take a look at their wallets to see what I mean.

https://counterwallet.io
their wallet is pure online !?
"With Counterwallet, your passphrase is your wallet, and all of your addresses and keys are generated on-the-fly when you log in.
There are no wallet files to backup or keep private, and with your passphrase you can access your wallet from any trusted machine with a web browser."

would not work
but MultiWallet trades straight out of the Wallet with Exchanges
Thats more like it !

XxEfHAC.jpg
 
Oh sure I don't mean the exact wallet, but some variation on the idea of the integrated exchange could be cool.
 
Back
Top