Pages:
Author

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

legendary
Activity: 1260
Merit: 1031
Rational Exuberance
Bitoy sent his address via PM:

Hi dacoinminster,

Here is my msc address
1Fq37GNfyxSvnmye3QdxH6GpPAQ3enarfs

Thank you for including mymastercoins  Smiley

It may be a couple of days yet before I send the MSC. I've got a ton of other stuff to catch up on.
hero member
Activity: 938
Merit: 1000
BitBoy some of those transactions are wrong at my site as well. You might actually parse them correctly.

Guys I need to amend the validation spec a bit. But to do so I need your opinions.

Right now Bitboy and I deal differently with addresses.

When Mastercoin-explorer displays the addresses for a certain currency_id and an address has not received any transactions for the given currency_id it omits the address from the results. As far as my application is concerned the address does not exist so it can't display it.

BitBoy's implementation however returns the address with a zero balance. Which is technically also correct.

Anybody has a reason to pick one over the other?

I think bitboy's approach is better (same behaviour of blockchain.info).
It means that I will have to change my implementation as well.

The problem is that I have no clue how I can find something that doesn't exist. I can't supply addresses that I don't know exist. I could query all currencies (there might be a lot in the future) and use data based on that but that would only bloat the verification-api without any real benefit.

I still vote to omit addresses that have no transactions for a certain currency_id.


The code news however is that this is already proven useful.

Quote
Mastercoin explorer has 2617.47620688 for 1AGFxUanxnWnrTiwLsY4NyvNZTv3RWFnfT but Bitboy has 2617.48620688
Mastercoin explorer has 200 for 1MBrNtFBw9QQ1owGsTs6Nd1iL1Err2H4yp but Bitboy has 199.99
Mastercoin explorer has 757.23987298 for 1Q1sFqsi8S5DxV5hz6sWLamGBp9To93iG7 but Bitboy has 752.23987298

Much easier to find which transactions to fix now.

I will join the comparison game whenever my sell offer/accept parsing is done.
That's a great tool.

Once I finished the code I will put the site online. It should display an overview of all transactions that are parsed differently on all sites, we should all be able to use this.
sr. member
Activity: 284
Merit: 250
Guys I need to amend the validation spec a bit. But to do so I need your opinions.

Right now Bitboy and I deal differently with addresses.

When Mastercoin-explorer displays the addresses for a certain currency_id and an address has not received any transactions for the given currency_id it omits the address from the results. As far as my application is concerned the address does not exist so it can't display it.

BitBoy's implementation however returns the address with a zero balance. Which is technically also correct.

Anybody has a reason to pick one over the other?

I think bitboy's approach is better (same behaviour of blockchain.info).
It means that I will have to change my implementation as well.


The code news however is that this is already proven useful.

Quote
Mastercoin explorer has 2617.47620688 for 1AGFxUanxnWnrTiwLsY4NyvNZTv3RWFnfT but Bitboy has 2617.48620688
Mastercoin explorer has 200 for 1MBrNtFBw9QQ1owGsTs6Nd1iL1Err2H4yp but Bitboy has 199.99
Mastercoin explorer has 757.23987298 for 1Q1sFqsi8S5DxV5hz6sWLamGBp9To93iG7 but Bitboy has 752.23987298

Much easier to find which transactions to fix now.

I will join the comparison game whenever my sell offer/accept parsing is done.
That's a great tool.

sr. member
Activity: 449
Merit: 250

Quote
Mastercoin explorer has 2617.47620688 for 1AGFxUanxnWnrTiwLsY4NyvNZTv3RWFnfT but Bitboy has 2617.48620688
Mastercoin explorer has 200 for 1MBrNtFBw9QQ1owGsTs6Nd1iL1Err2H4yp but Bitboy has 199.99
Mastercoin explorer has 757.23987298 for 1Q1sFqsi8S5DxV5hz6sWLamGBp9To93iG7 but Bitboy has 752.23987298

Much easier to find which transactions to fix now.

Thanks Tachikoma,

I'll fix the the missing transactions.

Btw the "peek and decode" is already approved.  I'll update and run checks again.

hero member
Activity: 938
Merit: 1000
Guys I need to amend the validation spec a bit. But to do so I need your opinions.

Right now Bitboy and I deal differently with addresses.

When Mastercoin-explorer displays the addresses for a certain currency_id and an address has not received any transactions for the given currency_id it omits the address from the results. As far as my application is concerned the address does not exist so it can't display it.

BitBoy's implementation however returns the address with a zero balance. Which is technically also correct.

Anybody has a reason to pick one over the other?

The code news however is that this is already proven useful.

Quote
Mastercoin explorer has 2617.47620688 for 1AGFxUanxnWnrTiwLsY4NyvNZTv3RWFnfT but Bitboy has 2617.48620688
Mastercoin explorer has 200 for 1MBrNtFBw9QQ1owGsTs6Nd1iL1Err2H4yp but Bitboy has 199.99
Mastercoin explorer has 757.23987298 for 1Q1sFqsi8S5DxV5hz6sWLamGBp9To93iG7 but Bitboy has 752.23987298

Much easier to find which transactions to fix now.
hero member
Activity: 938
Merit: 1000
That would be an invalid transaction. I've had a night to sleep on it and I'm not sure how much I like it. I still do not like the random chance but changing the procol might be too drastic. Unless somebody really loves it let's drop it.
zbx
member
Activity: 64
Merit: 10
W.r.t. block lag, what if an address has an insufficient balance to send X mastercoins until the block in which he attempts to send them?
legendary
Activity: 1358
Merit: 1003
Ron Gross
I think I'll be disabling notifications on this thread.
Too much stuff happening.

We might need a semi-official position whose role is to coordinate with all the developers since we're unable to keep track.
I think J.R is doing that right now.
We need to get him to quit his job at cozi and do this full time.

Go J.R go!

Anyway this is just random thoughts before I unwatch the thread, not sure if it's needed or not at this point.
sr. member
Activity: 266
Merit: 250
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)

Ah fantastic, I was wondering when those exodus sends would occur, I've got some dev code I'm keen to test before it makes it into the next major Masterchest update (next update is a big one) - of course I'm very happy to be getting some MSC also! Smiley
legendary
Activity: 1666
Merit: 1010
he who has the gold makes the rules
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




legendary
Activity: 1666
Merit: 1010
he who has the gold makes the rules
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.
legendary
Activity: 1260
Merit: 1031
Rational Exuberance
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)
sr. member
Activity: 284
Merit: 250
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.

sr. member
Activity: 266
Merit: 250
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
legendary
Activity: 1260
Merit: 1031
Rational Exuberance
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).
hero member
Activity: 938
Merit: 1000
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
sr. member
Activity: 284
Merit: 250
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

hero member
Activity: 938
Merit: 1000
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
legendary
Activity: 1260
Merit: 1031
Rational Exuberance
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
legendary
Activity: 1260
Merit: 1031
Rational Exuberance
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
Pages:
Jump to: