Pages:
Author

Topic: 300 BTC Coding Contest: Distributed Exchange (MasterCoin Developer Thread) - page 51. (Read 129207 times)

legendary
Activity: 1666
Merit: 1010
he who has the gold makes the rules
Quote
Note that after you send this purchase offer and it's accepted by the site you will have to send the proper amount in Bitcoin from your MasterCoin address. Make sure your address is funded and that you send the coins from this address.

Isn't this already a part of the sendrawtransaction?  Or am I mistaken? 

Also in the "Amount" in the "Building new purchase offer"  what does this mean?

 I understood it to mean how many MSC I want to buy from the offer but perhaps I got it wrong because the sell offer wanted 0.0001 btc and my total out btc was 0.0025, and I put in 4 as the amount (assumed it would be 4 MSC).

thanks!
legendary
Activity: 1666
Merit: 1010
he who has the gold makes the rules
ok another issue (I probably am doing something wrong but I cannot figure it out)

so i did sendrawtransaction

and got this




but a few blocks have passed now and none of those tx have any confirmation

also I have a question about the 0.00012 amount where is that going?
legendary
Activity: 1666
Merit: 1010
he who has the gold makes the rules
hey guys I am writing the tutorial for making buy and sell offers.

http://wp.me/p40n6G-1h (work in progress)


right now I am working on the buy side, since i do not have any test msc.  and i came up to one issue thus far.

when I created a purchase offer i got this

Code:
01000000011bfb75ae8a4327c54c74e8c5f8793b054ab36603786bc64ba56a08f3834dc57c0400000000ffffffff0438ae9600000000001976a914157d5a4d561c5e36e37037ec962971aa0f761cbf88ac70170000000000001976a91419fd7459d1c21227f3e87582fa1de350b1549ae288ac70170000000000001976a914946cb2e08075bcbaf157e47bcb67eb2b2339d24288ace02e00000000000047512102c21e89b7366d902a18632d86c788bc1fd5d4432a8decc23f742ff2ea3ec86cc22102e53e090dad2a9813ae5583a18dde08642f932bb00d1f877482d17d5251fcafa252ae00000000

then I went here, because the instructions say to decode the raw tx to do a check

http://mastercoin-explorer.com/raw/transactions/new

i got this page





but if i went here

https://coinb.in/decode-raw-transaction.html

I get

Code:
Array
(
    [txid] => 4dfb874fc5123e88f8042a4a072086506895c49eedb767bd12b8eebb39bab033
    [version] => 1
    [locktime] => 0
    [vin] => Array
        (
            [0] => Array
                (
                    [txid] => 7cc54d83f3086aa54bc66b780366b34a053b79f8c5e8744cc527438aae75fb1b
                    [vout] => 4
                    [scriptSig] => Array
                        (
                            [asm] =>
                            [hex] =>
                        )

                    [sequence] => 4294967295
                )

        )

    [vout] => Array
        (
            [0] => Array
                (
                    [value] => 0.09875
                    [n] => 0
                    [scriptPubKey] => Array
                        (
                            [asm] => OP_DUP OP_HASH160 157d5a4d561c5e36e37037ec962971aa0f761cbf OP_EQUALVERIFY OP_CHECKSIG
                            [hex] => 76a914157d5a4d561c5e36e37037ec962971aa0f761cbf88ac
                            [reqSigs] => 1
                            [type] => pubkeyhash
                            [addresses] => Array
                                (
                                    [0] => 12xdMh16KkH34YKbzoPZmn5Ai6i3jzfVwX
                                )

                        )

                )

            [1] => Array
                (
                    [value] => 6.0E-5
                    [n] => 1
                    [scriptPubKey] => Array
                        (
                            [asm] => OP_DUP OP_HASH160 19fd7459d1c21227f3e87582fa1de350b1549ae2 OP_EQUALVERIFY OP_CHECKSIG
                            [hex] => 76a91419fd7459d1c21227f3e87582fa1de350b1549ae288ac
                            [reqSigs] => 1
                            [type] => pubkeyhash
                            [addresses] => Array
                                (
                                    [0] => 13NRX88EZbS5q81x6XFrTECzrciPREo821
                                )

                        )

                )

            [2] => Array
                (
                    [value] => 6.0E-5
                    [n] => 2
                    [scriptPubKey] => Array
                        (
                            [asm] => OP_DUP OP_HASH160 946cb2e08075bcbaf157e47bcb67eb2b2339d242 OP_EQUALVERIFY OP_CHECKSIG
                            [hex] => 76a914946cb2e08075bcbaf157e47bcb67eb2b2339d24288ac
                            [reqSigs] => 1
                            [type] => pubkeyhash
                            [addresses] => Array
                                (
                                    [0] => 1EXoDusjGwvnjZUyKkxZ4UHEf77z6A5S4P
                                )

                        )

                )

            [3] => Array
                (
                    [value] => 0.00012
                    [n] => 3
                    [scriptPubKey] => Array
                        (
                            [asm] => 1 02c21e89b7366d902a18632d86c788bc1fd5d4432a8decc23f742ff2ea3ec86cc2 02e53e090dad2a9813ae5583a18dde08642f932bb00d1f877482d17d5251fcafa2 2 OP_CHECKMULTISIG
                            [hex] => 512102c21e89b7366d902a18632d86c788bc1fd5d4432a8decc23f742ff2ea3ec86cc22102e53e090dad2a9813ae5583a18dde08642f932bb00d1f877482d17d5251fcafa252ae
                            [reqSigs] => 1
                            [type] => multisig
                            [addresses] => Array
                                (
                                    [0] => 12xdMh16KkH34YKbzoPZmn5Ai6i3jzfVwX
                                    [1] => 1GHQdVP8vpF8JrtrmXwE7kqLoMmLrqfDRR
                                )

                        )

                )

        )

)
full member
Activity: 201
Merit: 100
I guess something is not quite right.  My purchase of 0.2 Test MSC on 18xEZx3po1iJWP5H2aM3Do11dCGQyaebnT is not showing up at masterchest.info but does show up at mastercoin-explorer.com

Also, masterchest.info does not yet recognize tx c7103de53a8ea3a20cec9a74543132f98302f75ab1868092e911dd5516f322a5  (sorry if I'm pointing out the obvious Zathras)
full member
Activity: 201
Merit: 100
Good news! I will update my codebase and know that I can move forward in safety now Smiley

Funny...I think I was in the middle of a transaction as you updated the codebase as I saw the previous purchases vanish from one moment to the next.  I've completed a new order against my original sell and it went through just fine by adding the amount to Exodus.  Let me know if anything looks odd.

Will it be somehow possible to set up bids? Or can purchase offers only be made against existing sell offers?  Just wondering if it would be usefull to setup multiple offers to create data points for anyone looking to develop a ticker with bid, ask, depth charts etc..
sr. member
Activity: 266
Merit: 250
Since Class B seems to be working so well now Smiley I've made a couple of minor changes to the amendment (eg removed the requirement for the sender public key to be compressed in a multisig) - I'd say it's pretty much on point now, if you're happy with it can you let me know and I'll ask JR to perhaps link it from the OP or something (or of course suggest any further changes).

Thanks! Smiley
hero member
Activity: 938
Merit: 1000
We were mostly doing the groundwork, updating our internal libraries to support the new calls. The next step will be to implement it in our wallet-like applications. These can be tested once they are updated. I think that would be a good point to jump in Smiley
legendary
Activity: 1834
Merit: 1019
awesome to hear Smiley can those of us less technically capable help you with anything in any way?
hero member
Activity: 938
Merit: 1000
Good news! I will update my codebase and know that I can move forward in safety now Smiley
sr. member
Activity: 266
Merit: 250
Are you at a point where you can confirm that my Selling/Purchase offers are valid? I don't really want to move forward until I know I'm actually creating valid messages.

Not yet, sorry (I really only have a mish-mash of half written code at the mo) - give me a day or so Smiley

Sure thing! Thanks :}

OK, I've had a bit of time to put my code in order - from a decoding and formatting perspective I think it's all to spec:

Code:
Dim testsell As mastercointx_selloffer = mlib.getmastercointransaction(bitcoin_con, "e3c07141024a392899f63cb1a4b0af3cfc1d4f1c8392f782157260a1ee7cb5c5", "selloffer")
Console.WriteLine("SELLER ADDRESS: " & testsell.fromadd & vbCrLf & "CURRENCY ID: " & testsell.curtype & vbCrLf & "SELL AMOUNT: " & testsell.saleamount & vbCrLf & "SELL PRICE (TOTAL): " & testsell.offeramount & vbCrLf & "SELL PRICE (PER MSC): " & (testsell.offeramount / testsell.saleamount).ToString("0.00######") & vbCrLf & "TIME LIMIT (BLOCKS): " & testsell.timelimit & vbCrLf & "MIN FEE REQUIRED: " & testsell.minfee)

Code:
SELLER ADDRESS: 13NRX88EZbS5q81x6XFrTECzrciPREo821
CURRENCY ID: 2
SELL AMOUNT: 1000000000
SELL PRICE (TOTAL): 10000
SELL PRICE (PER MSC): 0.00001
TIME LIMIT (BLOCKS): 10
MIN FEE REQUIRED: 1000

Code:
Dim testaccept As mastercointx_acceptoffer = mlib.getmastercointransaction(bitcoin_con, "06be47514c46b7e3afd63e98a2c850a9a346cc63f482bec9f7d90d54317b5c49", "acceptoffer")
Console.WriteLine("BUYER ADDRESS: " & testaccept.fromadd & vbCrLf & "CURRENCY ID: " & testaccept.curtype & vbCrLf & "SELLER ADDRESS: " & testaccept.toadd & vbCrLf & "BUY AMOUNT (TOTAL): " & testaccept.purchaseamount)

Code:
BUYER ADDRESS: 13shGFpdbWEjoQ2gMN9MxJY7tQ5tUDNaq7
CURRENCY ID: 2
SELLER ADDRESS: 13NRX88EZbS5q81x6XFrTECzrciPREo821
BUY AMOUNT (TOTAL): 1000000000

The selling address had sufficient funds.  The buying address sent the funds within the time limit.  So far it's all looking good - there's just the question of the missing output to exodus when funding the trade answered above

Awesome! Smiley
hero member
Activity: 938
Merit: 1000
Wooops! My bad. I will update my verification to reflect this and reparse the transactions.
sr. member
Activity: 266
Merit: 250
Hey Tachikoma - just a quick one while coding the validity rules - I notice there is no output to Exodus when you sent the bitcoins to fund your example trade - in the spec it says:

Quote
Update 9/8/2013: In order to make parsing MasterCoin transactions easier, you must also include an output to the Exodus Address when sending the bitcoins to complete a purchase of MasterCoins. The output can be for any amount, but should be above the dust threshold.

Thoughts?  Thanks! Smiley


I assumed this would make parsing easier. Please let me know if that isn't the case. My thought for this was that you could get the complete state of the MasterCoin universe by looking only at transactions which output to 1Exodus, and the rest could be safely ignored by a MasterCoin client.

I'm of the same view (at the moment for example in my code logic the first thing I do is call 'ismastercointx()' which looks to see if the transaction has an output to Exodus).  It would be good to keep that logic when looking for the transaction that funded the trade.
legendary
Activity: 1260
Merit: 1031
Rational Exuberance
Hey Tachikoma - just a quick one while coding the validity rules - I notice there is no output to Exodus when you sent the bitcoins to fund your example trade - in the spec it says:

Quote
Update 9/8/2013: In order to make parsing MasterCoin transactions easier, you must also include an output to the Exodus Address when sending the bitcoins to complete a purchase of MasterCoins. The output can be for any amount, but should be above the dust threshold.

Thoughts?  Thanks! Smiley


I assumed this would make parsing easier. Please let me know if that isn't the case. My thought for this was that you could get the complete state of the MasterCoin universe by looking only at transactions which output to 1Exodus, and the rest could be safely ignored by a MasterCoin client.
sr. member
Activity: 266
Merit: 250
Hey Tachikoma - just a quick one while coding the validity rules - I notice there is no output to Exodus when you sent the bitcoins to fund your example trade - in the spec it says:

Quote
Update 9/8/2013: In order to make parsing MasterCoin transactions easier, you must also include an output to the Exodus Address when sending the bitcoins to complete a purchase of MasterCoins. The output can be for any amount, but should be above the dust threshold.

Thoughts?  Thanks! Smiley
sr. member
Activity: 266
Merit: 250
You know I may have been operating on a bad assumption re the above; being as an unconfirmed transaction propagated throughout the network it would be added to the bottom of the (currently being mined) block template, thus transactions broadcast earlier would have a better chance of being first in the block.  It sounds like you're saying this is not the case? (Is there some kind of block reorganization etc?)  As I mentioned early on I'm quite new on this cryptocurrency 'scene' and have just been teaching myself by reading as much bitcoin literature (wikis, papers, forum posts etc) as I can get my hands on - so I'm certainly more than happy to be corrected if my interpretation is wrong! Smiley

I'm not saying I'm an expert yet, so as far as I know it could be that transactions are added 'to the bottom' but I don't think that is the case. And even if it is, there is no 'one block'. Every miner or pool is working on his own version of a block based on the transactions he saw during the last block. There is no 100% propagation per transaction so a lot of time a node only learns about transactions because they have been added to the block. This being the case it does not even matter where the transaction gets added. The only importance is where it got added by the block that wins the race. I would like to learn how transactions get added though. Initial searches didn't give me the answer so I'm afraid I need to dive into the source code.

Thanks for the additional info Smiley I'm just going to throw out an idea I've been playing with to see what you guys think (feel free to tear it apart if it's not a good idea!).  What about an additional optional message.  An 'acknowledge' if you will.   MSC/BTC exchange could function as per the discussion so far but have additional support for the user that created the sell to broadcast a message to 'acknowledge' a specific accept/Purchase Offer before it's confirmed in a block.  So:

Wallet broadcasts sell offer > Wallet sees a valid accept/Purchase offer in the block template > Wallet broadcasts an 'acknowledge' including the ID of the accept/Purchase offer it's agreeing to > Trade is considered locked in & waiting to be funded > Other parties see no point trying to accept this sell now and move on to the next

All of that can happen intra-block, as long as the user (specifically their wallet) participating in trading stays online.

Of course a wallet can also simply post a sell, go offline and have it bought by the first accept/Purchase in a block as per the current spec if their is no 'acknowledge' in that block sent by the seller.

I am concerned that perhaps doing anything at all with unconfirmed messages at a fundamental level regardless of how we structure it is a bad idea because we can't be 100% sure those unconfirmed transactions will be included in the next block.  Appreciate your thoughts Smiley

I like the idea but I wouldn't want to spend time on it right now. There are so many things to build and it will be some time before we will need such a feature. It might help solve the scalability issues in the long term though.

There is just one major problem with it. Like I explained before there will never be 100% propagation, so there is a huge chance the buyer will never see the acknowledge before it ends up in a block. I really think we should try to steer away from doing messages on unconfirmed transactions.

Re 'bottom of the block' - I think that's just a colloquial term I read during research - essentially referring to the bottom of the list of transactions you'll see with getblocktemplate.

Re the acknowledge idea, yeah I'm going to put that on hold for now and just focus on doing this as defined so far.  It was really helpful to know day traders weren't our target audience right now as that means I can stop chasing speed (which I've kind of been fixating on a little if I'm honest!).
sr. member
Activity: 266
Merit: 250

Thanks for the additional info Smiley I'm just going to throw out an idea I've been playing with to see what you guys think (feel free to tear it apart if it's not a good idea!).  What about an additional optional message.  An 'acknowledge' if you will.   MSC/BTC exchange could function as per the discussion so far but have additional support for the user that created the sell to broadcast a message to 'acknowledge' a specific accept/Purchase Offer before it's confirmed in a block.  So:

Wallet broadcasts sell offer > Wallet sees a valid accept/Purchase offer in the block template > Wallet broadcasts an 'acknowledge' including the ID of the accept/Purchase offer it's agreeing to > Trade is considered locked in & waiting to be funded > Other parties see no point trying to accept this sell now and move on to the next

All of that can happen intra-block, as long as the user (specifically their wallet) participating in trading stays online.

Of course a wallet can also simply post a sell, go offline and have it bought by the first accept/Purchase in a block as per the current spec if their is no 'acknowledge' in that block sent by the seller.

I am concerned that perhaps doing anything at all with unconfirmed messages at a fundamental level regardless of how we structure it is a bad idea because we can't be 100% sure those unconfirmed transactions will be included in the next block.  Appreciate your thoughts Smiley


Ooooo! Interesting idea!

I don't see any problem with doing it this way, as long as it is optional. However, I think this should probably not be a version 1 feature, for a couple reasons:

1) I anticipate that most people will not be online when their sell order clears - they will post the order at some high price and forget about it for a few weeks until the market finally gets there
2) I don't want to encourage high-frequency trading. There is nothing stopping people from creating traditional website-based exchanges for people who want to do a lot of "day trading" of MSC, but I'd rather those short-term speculations not end up in the block chain for all of eternity. My goal is to make it easy on people who are doing a large purchase in or out of MSC, but not too friendly for overly-caffeinated chart monkeys.

I think the most important thing is for the UI on the websites to be really clear when you are confirmed as the first to accept an offer and it is safe to send the BTC. It would be BAD to base that advice on an ACK message that might not be included in the block chain for some reason (that would create an attack vector for fraud). The ACK message (if we create one) should only be to discourage other people from attempting to buy the same MSC.

Thanks.  Point 2 largely clears it up I think, at least for now - I've been of the mindset that it will be difficult to compete with centralized exchanges if we're substantially slower (users often sacrifice security/decentralization for speed/usability) but if day traders aren't our target audience (for now at least) then speed is much less of an issue Smiley
hero member
Activity: 938
Merit: 1000
You know I may have been operating on a bad assumption re the above; being as an unconfirmed transaction propagated throughout the network it would be added to the bottom of the (currently being mined) block template, thus transactions broadcast earlier would have a better chance of being first in the block.  It sounds like you're saying this is not the case? (Is there some kind of block reorganization etc?)  As I mentioned early on I'm quite new on this cryptocurrency 'scene' and have just been teaching myself by reading as much bitcoin literature (wikis, papers, forum posts etc) as I can get my hands on - so I'm certainly more than happy to be corrected if my interpretation is wrong! Smiley

I'm not saying I'm an expert yet, so as far as I know it could be that transactions are added 'to the bottom' but I don't think that is the case. And even if it is, there is no 'one block'. Every miner or pool is working on his own version of a block based on the transactions he saw during the last block. There is no 100% propagation per transaction so a lot of time a node only learns about transactions because they have been added to the block. This being the case it does not even matter where the transaction gets added. The only importance is where it got added by the block that wins the race. I would like to learn how transactions get added though. Initial searches didn't give me the answer so I'm afraid I need to dive into the source code.

Thanks for the additional info Smiley I'm just going to throw out an idea I've been playing with to see what you guys think (feel free to tear it apart if it's not a good idea!).  What about an additional optional message.  An 'acknowledge' if you will.   MSC/BTC exchange could function as per the discussion so far but have additional support for the user that created the sell to broadcast a message to 'acknowledge' a specific accept/Purchase Offer before it's confirmed in a block.  So:

Wallet broadcasts sell offer > Wallet sees a valid accept/Purchase offer in the block template > Wallet broadcasts an 'acknowledge' including the ID of the accept/Purchase offer it's agreeing to > Trade is considered locked in & waiting to be funded > Other parties see no point trying to accept this sell now and move on to the next

All of that can happen intra-block, as long as the user (specifically their wallet) participating in trading stays online.

Of course a wallet can also simply post a sell, go offline and have it bought by the first accept/Purchase in a block as per the current spec if their is no 'acknowledge' in that block sent by the seller.

I am concerned that perhaps doing anything at all with unconfirmed messages at a fundamental level regardless of how we structure it is a bad idea because we can't be 100% sure those unconfirmed transactions will be included in the next block.  Appreciate your thoughts Smiley

I like the idea but I wouldn't want to spend time on it right now. There are so many things to build and it will be some time before we will need such a feature. It might help solve the scalability issues in the long term though.

There is just one major problem with it. Like I explained before there will never be 100% propagation, so there is a huge chance the buyer will never see the acknowledge before it ends up in a block. I really think we should try to steer away from doing messages on unconfirmed transactions.
legendary
Activity: 1260
Merit: 1031
Rational Exuberance

Thanks for the additional info Smiley I'm just going to throw out an idea I've been playing with to see what you guys think (feel free to tear it apart if it's not a good idea!).  What about an additional optional message.  An 'acknowledge' if you will.   MSC/BTC exchange could function as per the discussion so far but have additional support for the user that created the sell to broadcast a message to 'acknowledge' a specific accept/Purchase Offer before it's confirmed in a block.  So:

Wallet broadcasts sell offer > Wallet sees a valid accept/Purchase offer in the block template > Wallet broadcasts an 'acknowledge' including the ID of the accept/Purchase offer it's agreeing to > Trade is considered locked in & waiting to be funded > Other parties see no point trying to accept this sell now and move on to the next

All of that can happen intra-block, as long as the user (specifically their wallet) participating in trading stays online.

Of course a wallet can also simply post a sell, go offline and have it bought by the first accept/Purchase in a block as per the current spec if their is no 'acknowledge' in that block sent by the seller.

I am concerned that perhaps doing anything at all with unconfirmed messages at a fundamental level regardless of how we structure it is a bad idea because we can't be 100% sure those unconfirmed transactions will be included in the next block.  Appreciate your thoughts Smiley


Ooooo! Interesting idea!

I don't see any problem with doing it this way, as long as it is optional. However, I think this should probably not be a version 1 feature, for a couple reasons:

1) I anticipate that most people will not be online when their sell order clears - they will post the order at some high price and forget about it for a few weeks until the market finally gets there
2) I don't want to encourage high-frequency trading. There is nothing stopping people from creating traditional website-based exchanges for people who want to do a lot of "day trading" of MSC, but I'd rather those short-term speculations not end up in the block chain for all of eternity. My goal is to make it easy on people who are doing a large purchase in or out of MSC, but not too friendly for overly-caffeinated chart monkeys.

I think the most important thing is for the UI on the websites to be really clear when you are confirmed as the first to accept an offer and it is safe to send the BTC. It would be BAD to base that advice on an ACK message that might not be included in the block chain for some reason (that would create an attack vector for fraud). The ACK message (if we create one) should only be to discourage other people from attempting to buy the same MSC.
sr. member
Activity: 266
Merit: 250
I wouldn't do that if I were you. The problem is that just because somebody else did a Purchase Offer already does not mean he will end up getting it. The position of your transaction in the block could still be above the one send earlier.
It doesn't necessarily have to be a hide, it can be a highlight/color change etc - just something to let the user know that there is already an accept visible on the blockchain for this sell and thus their accept is likely to be invalidated.  

You're correct in that there is nothing stopping the user (protocol wise) from sending their own accept and hoping it gets included earlier in the block than the accept already visible.

That's essentially the crux of the scalability problem - an exchange where the lowest ask sell can only be bought once every (on average) 10 minutes just doesn't scale. To avoid everyone trying to accept the same sell we need a way to consider that lowest sell 'pending acceptance' (or 'Purchase Offered') and have users look to the next lowest sell intra-block to make it scalable in my opinion.

A color indication would be a great idea. I personally would still try to get the cheapest option since I have just as much chance of getting it then the person who already submitted an offer. All I wanted to convey is that the first message seen by a certain node has no increased chance of being the first one in the block. I would prefer the cheapest option, even if I need to fight for it. But by coloring it you at least give people an option to decide what is important for them.

You know I may have been operating on a bad assumption re the above; being as an unconfirmed transaction propagated throughout the network it would be added to the bottom of the (currently being mined) block template, thus transactions broadcast earlier would have a better chance of being first in the block.  It sounds like you're saying this is not the case? (Is there some kind of block reorganization etc?)  As I mentioned early on I'm quite new on this cryptocurrency 'scene' and have just been teaching myself by reading as much bitcoin literature (wikis, papers, forum posts etc) as I can get my hands on - so I'm certainly more than happy to be corrected if my interpretation is wrong! Smiley


An interesting dynamic will come out of this, where MSC buyers will have to decide whether they want to go for the best price (and maybe/probably not get it) or pay a bit more for an offer in order to have a better chance of being first to accept.

When we do the distributed eschange messages between MSC and other MSC-derived currencies like smart property and GoldCoins, the buyer doesn't have to specify which seller they are buying from - we can just match up buy/sell offers which happen to match automatically. Currently the spec doesn't state this very well (I need to fix that).

Unfortunately, the scalability problem will always remain when exchanging MSC/BTC. Once someone has purchased MSC and is completely in the MSC ecosystem, everything gets way easier.

Thanks for the additional info Smiley I'm just going to throw out an idea I've been playing with to see what you guys think (feel free to tear it apart if it's not a good idea!).  What about an additional optional message.  An 'acknowledge' if you will.   MSC/BTC exchange could function as per the discussion so far but have additional support for the user that created the sell to broadcast a message to 'acknowledge' a specific accept/Purchase Offer before it's confirmed in a block.  So:

Wallet broadcasts sell offer > Wallet sees a valid accept/Purchase offer in the block template > Wallet broadcasts an 'acknowledge' including the ID of the accept/Purchase offer it's agreeing to > Trade is considered locked in & waiting to be funded > Other parties see no point trying to accept this sell now and move on to the next

All of that can happen intra-block, as long as the user (specifically their wallet) participating in trading stays online.

Of course a wallet can also simply post a sell, go offline and have it bought by the first accept/Purchase in a block as per the current spec if there is no 'acknowledge' already sent by the seller.

I am concerned that perhaps doing anything at all with unconfirmed messages at a fundamental level regardless of how we structure it is a bad idea because we can't be 100% sure those unconfirmed transactions will be included in the next block.  Appreciate your thoughts Smiley
legendary
Activity: 1260
Merit: 1031
Rational Exuberance
I wouldn't do that if I were you. The problem is that just because somebody else did a Purchase Offer already does not mean he will end up getting it. The position of your transaction in the block could still be above the one send earlier.
It doesn't necessarily have to be a hide, it can be a highlight/color change etc - just something to let the user know that there is already an accept visible on the blockchain for this sell and thus their accept is likely to be invalidated.  

You're correct in that there is nothing stopping the user (protocol wise) from sending their own accept and hoping it gets included earlier in the block than the accept already visible.

That's essentially the crux of the scalability problem - an exchange where the lowest ask sell can only be bought once every (on average) 10 minutes just doesn't scale. To avoid everyone trying to accept the same sell we need a way to consider that lowest sell 'pending acceptance' (or 'Purchase Offered') and have users look to the next lowest sell intra-block to make it scalable in my opinion.

A color indication would be a great idea. I personally would still try to get the cheapest option since I have just as much chance of getting it then the person who already submitted an offer. All I wanted to convey is that the first message seen by a certain node has no increased chance of being the first one in the block. I would prefer the cheapest option, even if I need to fight for it. But by coloring it you at least give people an option to decide what is important for them.

An interesting dynamic will come out of this, where MSC buyers will have to decide whether they want to go for the best price (and maybe/probably not get it) or pay a bit more for an offer in order to have a better chance of being first to accept.

When we do the distributed eschange messages between MSC and other MSC-derived currencies like smart property and GoldCoins, the buyer doesn't have to specify which seller they are buying from - we can just match up buy/sell offers which happen to match automatically. Currently the spec doesn't state this very well (I need to fix that).

Unfortunately, the scalability problem will always remain when exchanging MSC/BTC. Once someone has purchased MSC and is completely in the MSC ecosystem, everything gets way easier.
Pages:
Jump to: