Bitcoin Forum
May 14, 2024, 12:22:21 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 [23] 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 »
  Print  
Author Topic: 300 BTC Coding Contest: Distributed Exchange (MasterCoin Developer Thread)  (Read 129136 times)
This is a self-moderated topic. If you do not want to be moderated by the person who started this topic, create a new topic.
bluemeanie1
Sr. Member
****
Offline Offline

Activity: 280
Merit: 257


bluemeanie


View Profile WWW
November 11, 2013, 05:34:01 AM
 #441

Time to buy some MSC:

Smiley

ok where exactly is it explained as to how you will construct this Distributed Exchange?

it seems the winners of this Distributed Exchange contest are making anything but a Distributed Exchange. (appears to be wallets and other tools analogous to past Color Coin efforts).

if you have a Distributed Exchange, I would be very interested to see what you have done.

Please provide some information.  Thanks.

Just who IS bluemeanie?    On NXTautoDAC and a Million Stolen NXT

feel like your voice isn't being heard? PM me.   |   stole 1M NXT?
1715646141
Hero Member
*
Offline Offline

Posts: 1715646141

View Profile Personal Message (Offline)

Ignore
1715646141
Reply with quote  #2

1715646141
Report to moderator
1715646141
Hero Member
*
Offline Offline

Posts: 1715646141

View Profile Personal Message (Offline)

Ignore
1715646141
Reply with quote  #2

1715646141
Report to moderator
"You Asked For Change, We Gave You Coins" -- casascius
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715646141
Hero Member
*
Offline Offline

Posts: 1715646141

View Profile Personal Message (Offline)

Ignore
1715646141
Reply with quote  #2

1715646141
Report to moderator
1715646141
Hero Member
*
Offline Offline

Posts: 1715646141

View Profile Personal Message (Offline)

Ignore
1715646141
Reply with quote  #2

1715646141
Report to moderator
Tachikoma
Hero Member
*****
Offline Offline

Activity: 938
Merit: 1000



View Profile WWW
November 11, 2013, 09:37:47 AM
 #442

It seems you might have misunderstood what a distributed exchange means. In this case it's not a place you go to exchange. It's a feature of Mastercoin build into the protocol. In order to sell/buy coins you need to send a crafted Mastercoin message with information on what you want to buy/sell. These wallets you talk about offer to do this for you and thus implement the distributed exchange functionality. 

Electrum: the convenience of a web wallet, without the risks | Bytesized Seedboxes BTC/LTC supported
Tachikoma
Hero Member
*****
Offline Offline

Activity: 938
Merit: 1000



View Profile WWW
November 11, 2013, 01:48:47 PM
Last edit: November 11, 2013, 06:09:55 PM by Tachikoma
 #443

Something has been bothering me when coding up my Mastercoin implementation these last few weeks. There is one thing in the spec that makes coding up Mastercoin implementations a lot harder and, because of this, less reliable then it has to be.

The position of a certain transaction in a given block. You constantly have to do two separate checks, 'is there a transaction in this block that has a position lower then the current one that can influence this message?' if not 'query all previous blocks for the information' that you need. It also contributes to the 'random chance' effect I already spoke about. Depending on the position of your transaction in a given block it might be either invalid or valid.

I hate chance, and I would like to eliminate it as a factor for Mastercoin.

My proposal would make everything a lot cleaner and easier to work with but would introduce a 1 block lag.

Current situation
User A creates a 'Selling Offer' of 1 MSC for 0.1 BTC in block 25
User B creates a 'Purchase Offer' of this 1 MSC while User A modifies it's original order to now sell 1 MSC for 0.9 MSC. Both transactions end up in block 26 but the modified 'Selling offer' ends up above the 'Purchase Offer'.

If user B still wants to buy user a's offer he now needs to pay 0.9 while if luck was different he could have paid 0.1 BTC.

Artificial 1 Block lag
User A creates a 'Selling Offer' of 1 MSC for 0.1 BTC in block 25
User B creates a 'Purchase Offer' of this 1 MSC while User A modifies it's original order to now sell 1 MSC for 0.9 MSC. Both transactions end up in block 26.

However to get all information this time we skip checking the current block and only look at what happend before this block. The offer gets matched up to the original one regardless of which position the changed 'Selling Offer' ended up with.

I understand if this is a controversial topic but I want to bring it up anyway because I really believe this will make everything better.  

Opinions!?

Electrum: the convenience of a web wallet, without the risks | Bytesized Seedboxes BTC/LTC supported
Bitoy
Sr. Member
****
Offline Offline

Activity: 449
Merit: 250


View Profile
November 11, 2013, 02:42:19 PM
 #444

Something has been bothering me when coding up my Mastercoin implementation these last few weeks. There is one thing in the spec that makes coding up Mastercoin implementations a lot harder and, because of this, less reliable then it has to be.

The position of a certain transaction in a given block. You constantly have to do two separate checks, 'is there a transaction in this block that has a position lower then the current one that can influence this message?' if not 'query all previous blocks for the information' that you need. It also contributes to the 'random chance' effect I already spoke about. Depending on the position of your transaction in a given block it might be either invalid or valid.

I hate chance, and I would like to eliminate it as a factor for Mastercoin.

My proposal would make everything a lot cleaner and easier to work with but would introduce a 1 block lag.

Current situation
User A creates a 'Selling Offer' of 1 MSC for 0.1 BTC in block 25
User B creates a 'Purchase Offer' of this 1 MSC while User A modifies it's original order to now sell 1 MSC for 0.9 MSC. Both transactions end up in block 26 but the modified 'Selling offer' ends up above the 'Purchase Offer'.

If user B still wants to buy user a's offer he now needs to pay 0.9 while if luck was different he could have paid 0.1 BTC.

Artificial 1 Block lag
User A creates a 'Selling Offer' of 1 MSC for 0.1 BTC in block 25
User B creates a 'Purchase Offer' of this 1 MSC while User A modifies it's original order to now sell 1 MSC for 0.9 MSC. Both transactions end up in block 26.

However to get all information this time we skip checking the current block and only look at what happend before this block. The offer gets matched up to the original one regardless of which position the changed 'Selling Offer' ended up with.

I understand if this is a controversial topic but I want to bring it up anyway because I really believe this will make everything better. 


We can give priority to purchase offer over selling offer is they have the same block time.
That way user b will get the price at .1
Tachikoma
Hero Member
*****
Offline Offline

Activity: 938
Merit: 1000



View Profile WWW
November 11, 2013, 02:46:41 PM
 #445

I wouldn't want to make an exception for just one message, it needs to be protocol wide if we want to even consider this.

FYI: I made a small change to the Verification Spec; I changed the url from mastercoin-verify to mastercoin_verify. I also tried checking out your urls but http://mymastercoins.com/jtransaction.aspx?Address=1QF9Hag3nyjAcXRd6mFrL5KyM3r71hVu2T doesn't seem to work.

My verification API is online.

http://mastercoin-explorer.com/mastercoin_verify/addresses
http://mastercoin-explorer.com/mastercoin_verify/transactions/17UDyggWFP6T3tUPTUEHMU8gxRtLZHG322

As soon as I have some tools available I will create a small comparison service.

Electrum: the convenience of a web wallet, without the risks | Bytesized Seedboxes BTC/LTC supported
Bitoy
Sr. Member
****
Offline Offline

Activity: 449
Merit: 250


View Profile
November 11, 2013, 03:02:45 PM
 #446

I wouldn't want to make an exception for just one message, it needs to be protocol wide if we want to even consider this.

FYI: I made a small change to the Verification Spec; I changed the url from mastercoin-verify to mastercoin_verify. I also tried checking out your urls but http://mymastercoins.com/jtransaction.aspx?Address=1QF9Hag3nyjAcXRd6mFrL5KyM3r71hVu2T doesn't seem to work.

My verification API is online.

http://mastercoin-explorer.com/mastercoin_verify/addresses
http://mastercoin-explorer.com/mastercoin_verify/transactions/17UDyggWFP6T3tUPTUEHMU8gxRtLZHG322

As soon as I have some tools available I will create a small comparison service.

I now got your idea. Your delay 1 block will work to fix this issue.


Try (missing  s)
http://mymastercoins.com/jtransactions.aspx?Address=1QF9Hag3nyjAcXRd6mFrL5KyM3r71hVu2T
Tachikoma
Hero Member
*****
Offline Offline

Activity: 938
Merit: 1000



View Profile WWW
November 11, 2013, 03:15:30 PM
 #447

Thanks, that worked! Your feed is not valid JSON yet however. Strings and keys need to be surrounded in quotes, I think it should be valid after that.

You can always check your feed using: http://jsonlint.com/

Electrum: the convenience of a web wallet, without the risks | Bytesized Seedboxes BTC/LTC supported
rbdrbd
Sr. Member
****
Offline Offline

Activity: 462
Merit: 250



View Profile
November 11, 2013, 04:08:35 PM
 #448

Hi guys, quick question on the distributed exchange: as Mastercoin is becoming much more valuable now, is there a way to create buy and sell offers from a totally "offline" machine?

I was planning on moving to an offline armory-based setup (with cheapo laptop with no internet connection) for BTC, and wanted to use this same kind of setup with MSC as well...i.e. comprise the trade on the offline machine (that has wallet.dat), then sneakernet/email some trade code/key/trade token to the connected machine to actually input into the MSC network (that does not have wallet.dat). It seems that currently one can not do simple sends with an offline setup like this (from my own experimentation), but I wanted to check on the distributed exchange features.

If this is not possible, then any ideas when someone may get around to it? If MSC raises another 10-30x, you'll have several MSC millionaires in the bunch. If I was one of those guys, I'd be very concerned with doing any trades out of a wallet connected to the internet.

I am no expert on Armory but I believe it can sign raw transactions. If this is indeed the case you can use mastercoin-explorer.com to create the offers then sign the raw transactions with your own client and relay them through Eligius or Blockhain.info. I also have plans to implement seedless addresses into my wallet software but that's a long term plan. This can be used right now.

Thank you, I am getting an offline system in a few days and will try that out. I'll document whatever works and send it to Ron to make part of the FAQ.
Bitoy
Sr. Member
****
Offline Offline

Activity: 449
Merit: 250


View Profile
November 11, 2013, 04:14:34 PM
 #449

Thanks, that worked! Your feed is not valid JSON yet however. Strings and keys need to be surrounded in quotes, I think it should be valid after that.

You can always check your feed using: http://jsonlint.com/

Ok json is validated.
dacoinminster (OP)
Legendary
*
Offline Offline

Activity: 1260
Merit: 1031


Rational Exuberance


View Profile WWW
November 11, 2013, 08:09:24 PM
 #450

I know I've been promising (and promising and promising) to update the spec. Well, I finally did:

OK - Ron has gotten about a billion balls rolling all at once, and I can't keep up. Smiley

What I can do, and did, was get most of the changes I promised ready for version 1.2 of the spec. It's a giant pull request, but I agree that future pull requests should be smaller: https://github.com/mastercoin-MSC/spec/pull/3

This version of the spec, which I labeled 1.2, has dividend payments, CFD betting, spending rate-limits for savings wallets, and distributed e-commerce. Many people will probably use the latter feature as a distributed silk road, but I used selling contraband Bibles as my example Smiley

I haven't done proof-of-stake voting yet, although that should be easy. I decided against a kickstarter feature, since someone who can be trusted to run a kickstarter can also be trusted to give the money back if the target isn't raised.

FYI here is the full 1.2 spec on J.R's repository:

https://github.com/dacoinminster/spec

This doesn't affect anything you guys are currently working on - just fleshing out a bunch of stuff I had promised to add.

This is one giant pull request, but expect to see smaller ones in the future, and originating from other people besides myself Smiley

dacoinminster (OP)
Legendary
*
Offline Offline

Activity: 1260
Merit: 1031


Rational Exuberance


View Profile WWW
November 11, 2013, 08:11:49 PM
 #451

Oh, and Zathras, your documentation is now Appendix A. Would you mind taking a look? I broke some of the formatting, but I hope I at least got all the text correct. Feel free to make pull requests yourself Smiley

Tachikoma
Hero Member
*****
Offline Offline

Activity: 938
Merit: 1000



View Profile WWW
November 11, 2013, 08:21:10 PM
 #452

There are actually threediscussions going on that might affect the spec. Block-lag, reserved funds and the validation api. I already did a quick glance through the new docs and so far it looks good Smiley

Electrum: the convenience of a web wallet, without the risks | Bytesized Seedboxes BTC/LTC supported
grazcoin
Sr. Member
****
Offline Offline

Activity: 284
Merit: 250



View Profile
November 11, 2013, 08:23:56 PM
 #453

Something has been bothering me when coding up my Mastercoin implementation these last few weeks. There is one thing in the spec that makes coding up Mastercoin implementations a lot harder and, because of this, less reliable then it has to be.

The position of a certain transaction in a given block. You constantly have to do two separate checks, 'is there a transaction in this block that has a position lower then the current one that can influence this message?' if not 'query all previous blocks for the information' that you need. It also contributes to the 'random chance' effect I already spoke about. Depending on the position of your transaction in a given block it might be either invalid or valid.

I hate chance, and I would like to eliminate it as a factor for Mastercoin.

My proposal would make everything a lot cleaner and easier to work with but would introduce a 1 block lag.

Current situation
User A creates a 'Selling Offer' of 1 MSC for 0.1 BTC in block 25
User B creates a 'Purchase Offer' of this 1 MSC while User A modifies it's original order to now sell 1 MSC for 0.9 MSC. Both transactions end up in block 26 but the modified 'Selling offer' ends up above the 'Purchase Offer'.

If user B still wants to buy user a's offer he now needs to pay 0.9 while if luck was different he could have paid 0.1 BTC.

Artificial 1 Block lag
User A creates a 'Selling Offer' of 1 MSC for 0.1 BTC in block 25
User B creates a 'Purchase Offer' of this 1 MSC while User A modifies it's original order to now sell 1 MSC for 0.9 MSC. Both transactions end up in block 26.

However to get all information this time we skip checking the current block and only look at what happend before this block. The offer gets matched up to the original one regardless of which position the changed 'Selling Offer' ended up with.

I understand if this is a controversial topic but I want to bring it up anyway because I really believe this will make everything better. 


We can give priority to purchase offer over selling offer is they have the same block time.
That way user b will get the price at .1

Giving priority to purchase offer over selling offer in the same block is a better name for "Artificial 1 Block lag".
This solution means that any increase in price (or even a try to cancel the offer), could be easily attacked by listening to unconfirmed tx, and sending accept immediately.
I still like the original "random" way that Bitcoin imposes, but I will not insist on it Smiley


Tachikoma
Hero Member
*****
Offline Offline

Activity: 938
Merit: 1000



View Profile WWW
November 11, 2013, 08:28:57 PM
 #454

I'm not even sure I'm 100% behind it, but it would make parsing much more straight forward.

The thing I might not have explained enough is that I think this artificial lag should be protocol wide if we would even consider doing it. This would mean that Simple Sends that receive and send coins in the same block would also be invalid if the proper amount of the outgoing coins was not sufficient before this block, etc.

Grazcoin, Zathras, Bitboy could you please join the discussion on PR #1 here https://github.com/mastercoin-MSC/spec/pull/1

Electrum: the convenience of a web wallet, without the risks | Bytesized Seedboxes BTC/LTC supported
dacoinminster (OP)
Legendary
*
Offline Offline

Activity: 1260
Merit: 1031


Rational Exuberance


View Profile WWW
November 11, 2013, 09:48:28 PM
 #455

I'm not even sure I'm 100% behind it, but it would make parsing much more straight forward.

The thing I might not have explained enough is that I think this artificial lag should be protocol wide if we would even consider doing it. This would mean that Simple Sends that receive and send coins in the same block would also be invalid if the proper amount of the outgoing coins was not sufficient before this block, etc.

Grazcoin, Zathras, Bitboy could you please join the discussion on PR #1 here https://github.com/mastercoin-MSC/spec/pull/1

I replied on that pull request thread (After some thought, I support the pull request for reasons detailed in the discussion thread there, although I don't feel strongly about it).

zathras
Sr. Member
****
Offline Offline

Activity: 266
Merit: 250



View Profile
November 11, 2013, 10:37:24 PM
 #456

I'm not even sure I'm 100% behind it, but it would make parsing much more straight forward.

The thing I might not have explained enough is that I think this artificial lag should be protocol wide if we would even consider doing it. This would mean that Simple Sends that receive and send coins in the same block would also be invalid if the proper amount of the outgoing coins was not sufficient before this block, etc.

Grazcoin, Zathras, Bitboy could you please join the discussion on PR #1 here https://github.com/mastercoin-MSC/spec/pull/1

I need to reflect on this a little further but I'm not sure I'm supportive of the 'artificial lag' at first look.

If the change to the sell offer gets into the blockchain before the purchase offer/accept then so be it - that's the nature of transaction ordering.  Our UI's need to be smart enough to adapt to scenarios where the purchase offer doesn't match the original purchase intent (different price, different amount of coins etc) as there are various scenarios in which this can and will happen.

My methodology is to scan the entire blockchain and dump all Mastercoin transactions, in order, into a table of known transactions.  Those transactions are then processed to arrive at final values for balances & whether the various types of transaction are valid.  As such (at first glance at a high level) I'm quite 'anti' anything that artificially re-orders transactions away from how they are stored in the blockchain.

Oh, replied to PR#1 also.

Thanks! Smiley

Smart Property & Distributed Exchange: Master Protocol for Bitcoin
grazcoin
Sr. Member
****
Offline Offline

Activity: 284
Merit: 250



View Profile
November 11, 2013, 11:47:29 PM
 #457

I'm not even sure I'm 100% behind it, but it would make parsing much more straight forward.

The thing I might not have explained enough is that I think this artificial lag should be protocol wide if we would even consider doing it. This would mean that Simple Sends that receive and send coins in the same block would also be invalid if the proper amount of the outgoing coins was not sufficient before this block, etc.

Grazcoin, Zathras, Bitboy could you please join the discussion on PR #1 here https://github.com/mastercoin-MSC/spec/pull/1

I replied on that pull request thread (After some thought, I support the pull request for reasons detailed in the discussion thread there, although I don't feel strongly about it).

On https://github.com/mastercoin-MSC/spec/pull/1 I went on option 2 (like ripper234). I started implementing it, and we'll see if there are any complications.

Quote
Thinking about it again - I changed my mind, and I am for option 2.
Adding the "reserved funds" seems like a wrong architecture decision.
I don't think avoiding it increases the complexity of implementation too much, but it sure simplifies the user actions side and opens new dynamics.
The protocol takes care of all the required calculations and the UI gives the users the correct state at any moment.


dacoinminster (OP)
Legendary
*
Offline Offline

Activity: 1260
Merit: 1031


Rational Exuberance


View Profile WWW
November 12, 2013, 12:30:31 AM
 #458

Bitoy, can I have a MSC address for you please? I think you should be included when I send the devs some MSC from the Exodus Address.

I was going to send 1500 between you all, and it seems that I had better get a move on before that becomes worth more than our current contest!

(This is a fun little incentive I mentioned before to make sure all our web clients recognize dev Mastercoins)

prophetx
Legendary
*
Offline Offline

Activity: 1666
Merit: 1010


he who has the gold makes the rules


View Profile WWW
November 12, 2013, 12:42:18 AM
 #459

I haven't pushed to git for a while. I will finish my rspec testsuite and push the code, they are almost human-readable and should be easy enough to understand Smiley

i'm almost human so I should be able to read it  Wink

looking forward to seeing it.
prophetx
Legendary
*
Offline Offline

Activity: 1666
Merit: 1010


he who has the gold makes the rules


View Profile WWW
November 12, 2013, 01:15:27 AM
 #460

I have tried to upload all of your repo's to ohloh.net, which is a repo analytics tool

you can claim them, and also use them for stats to compare and view individual projects. probably not very useful now, but perhaps will be helpful later as you look to see how many dev's are supporting a particular project, what's being worked on and so forth.

this one for example compares the 3 wallet sites
https://www.ohloh.net/p/compare?project_0=mastercoin-wallet&project_1=BMX-2&project_2=masterchest-wallet




Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 [23] 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 »
  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!