Bitcoin Forum
May 04, 2024, 01:24:12 PM *
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 129135 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.
ripper234
Legendary
*
Offline Offline

Activity: 1358
Merit: 1003


Ron Gross


View Profile WWW
January 10, 2014, 12:48:00 AM
 #801

I already got the chance to say it in person but I will say it again: Awesome news Cheesy

Indeed!

While I did promise not to comment again on the main Mastercoin thread, and I do not intend to post on / follow the bounty thread a lot ... I want to say - this is so very great! We are building a real dream team here.

Welcome aboard zathras!

Please do not pm me, use ron@bitcoin.org.il instead
Mastercoin Executive Director
Co-founder of the Israeli Bitcoin Association
1714829052
Hero Member
*
Offline Offline

Posts: 1714829052

View Profile Personal Message (Offline)

Ignore
1714829052
Reply with quote  #2

1714829052
Report to moderator
1714829052
Hero Member
*
Offline Offline

Posts: 1714829052

View Profile Personal Message (Offline)

Ignore
1714829052
Reply with quote  #2

1714829052
Report to moderator
Make sure you back up your wallet regularly! Unlike a bank account, nobody can help you if you lose access to your BTC.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714829052
Hero Member
*
Offline Offline

Posts: 1714829052

View Profile Personal Message (Offline)

Ignore
1714829052
Reply with quote  #2

1714829052
Report to moderator
prophetx
Legendary
*
Offline Offline

Activity: 1666
Merit: 1010


he who has the gold makes the rules


View Profile WWW
January 10, 2014, 12:56:23 AM
 #802

Here's the latest dev update:

Master Protocol & #Mastercoin: Development Update 2 http://ow.ly/srmwa

Quote
Developer Communications Mediums

Key Development Statistics

CTO Opening and Search

Security Auditor Opening and Search

QA and Testing of Wallets

Research & Development Updates
Bitoy
Sr. Member
****
Offline Offline

Activity: 449
Merit: 250


View Profile
January 10, 2014, 01:57:14 AM
 #803

Congrats Zathras!

Looks like mastercoin will be moving at a faster pace this year with the additional full timers  Smiley
Bitoy
Sr. Member
****
Offline Offline

Activity: 449
Merit: 250


View Profile
January 10, 2014, 02:36:38 AM
 #804

Bitoy (and others). The spec mentions that the amount used in a Selling Order should be reserved and thus removed from the balance. I did a consensus check between us and I think you are not doing that yet. Because of this its harder to compare numbers; could you check your output and see if you could build in reserved funds to your solution?

Hi Tachikoma,

I've deducted the selling order from the balance.   Please check again.   
http://mymastercoins.com/jaddress.aspx?CurrencyID=2


btw where is your test MSC json  ?

Bitoy
Sr. Member
****
Offline Offline

Activity: 449
Merit: 250


View Profile
January 10, 2014, 05:36:06 AM
Last edit: January 10, 2014, 06:27:23 AM by Bitoy
 #805

99.78 % consensus check.
https://masterchest.info/consensus.aspx

I'll recheck my exodus calculations.

Edit
exodus address dev msc is now recalculated based on the latest block.
only 4 valid msc send transaction as of 1/10/14
zathras
Sr. Member
****
Offline Offline

Activity: 266
Merit: 250



View Profile
January 10, 2014, 08:28:59 AM
 #806

I already got the chance to say it in person but I will say it again: Awesome news Cheesy
Indeed!

While I did promise not to comment again on the main Mastercoin thread, and I do not intend to post on / follow the bounty thread a lot ... I want to say - this is so very great! We are building a real dream team here.

Welcome aboard zathras!
Congrats Zathras!

Looks like mastercoin will be moving at a faster pace this year with the additional full timers  Smiley
I'm so happy I . . .

 . . . I think I just wet myself.

Thanks for all the kind words guys (and the lol JR), good times ahead! Smiley

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

Activity: 266
Merit: 250



View Profile
January 10, 2014, 09:22:20 AM
Last edit: January 11, 2014, 01:29:42 AM by zathras
 #807

OK - hopefully have my head on straight with this (but bear with me, it's been a long day!).  

Tachikoma, the way you've laid it out is great - I had a slightly different approach (same endgame) in mind when I brought it up - for clarity I've just gone ahead and drawn up the sort of spec simplification I had in mind (kind of more focused on rules than methodology) - can you have a look and I'd appreciate your thoughts?  

Regarding the specific levels/order of testing is it necessary to lock in the rule evaluation method/order?  I think the approach can be left up to the implementation providing the rules are clear enough - if we need to specify a methodology for interpreting the rules then the rules are not clear enough.

Original
Quote
The transaction data is encoded into said fake Bitcoin address which is then used as an output in a single Bitcoin transaction satisfying the following requirements:

* Has a single or the largest input signed by the sending address
* Has an output for the recipient address (the 'reference' address)
* Has an output for the exodus address
* Has an output for the encoded fake address (the 'data' address)
* Has all output values above the 'dust' threshold (currently 0.00005430 BTC) and preferable be equal.
* Additional outputs are permitted for the remainder of the input (the 'change' address)

The following conditions must also be satisfied for the transaction to be considered decode-able:

* The reference address sequence number must be the data address sequence number + 1
* Ideally, all outputs should be the same (except the change). In fringe cases where the change output value is equal to the other output values the change address can be identified by sequence number, which must not equal or be +/-1 of the sequence number for either the reference address or the data address
* A last resort 'peek and decode' method may be used to identify the data packet in the event of ambiguity following the above rules. This involves decoding each packet and looking for the correct bytes for a simple send (the majority of bytes in a Class A simple send do not change). These byte checks are defined as:
     + Bytes two to eight must equal 00
     + Byte nine must equal 01 or 02
* Should there still be packet ambiguity or 'peek and decode' reveals more than one packet (simple sends are always one packet) the transaction is considered invalid.

NOTE: The sequence number for a given address is defined as a 1 -byte integer stored as the first byte of each 'packet'. Sequence numbers are continuous with 0 following 255 (256=0, 255+1=0).

Revised
Quote
The transaction data is encoded into said fake Bitcoin address which is then used as an output in a single Bitcoin transaction satisfying the following requirements:

* Has a single or the largest input signed by the sending address
* Has an output for the recipient address (the 'reference' address)
* Has an output for the exodus address
* Has an output for the encoded fake address (the 'data' address)
* Has all output values above the 'dust' threshold (currently 0.00005430 BTC)
* Has exactly two outputs with a value equal to the Exodus output and/or has exactly one output with a sequence number +1 of the data address for reference output identification
* Additional outputs are permitted for the remainder of the input (the 'change' address)

NOTE: The sequence number for a given address is defined as a 1 -byte integer stored as the first byte of each 'packet'. Sequence numbers are continuous with 0 following 255 (256=0, 255+1=0).

I also took out the byte range stuff too as it seemed a little unnecessary - if the transaction doesn't have a data address that can be decoded it doesn't satisfy 'Has an output for the encoded fake address (the 'data' address)' and thus is already explicitly invalidated by said rule.  What constitutes a valid data address is already defined elsewhere (under the simple send section).  

Can you think of any cases my alternative revision doesn't cover?  Essentially it's anything P&Dable = valid.

I realize this is a different approach to the simplification - as you can see I've been quite aggressive in removing the ambiguity that currently surrounds Class A (so that a transaction either satisfies the rules or it doesn't, no interpretation).  Please let me know your thoughts on this and whether you still prefer to document with decoding methodology (eg levels/order etc) - as always happy to discuss Smiley

I'll be excited to have Class A done & dusted!

Thanks
Zathras

EDIT just for clarity - in practice I would still just use P&D for all Class A decoding as that is the (imo) simplest implementation methodology for testing against "Has exactly two outputs with a value equal to the Exodus output and/or has exactly one output with a sequence number +1 of the data address for reference output identification".  

Hope the post makes sense! Smiley

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

Activity: 284
Merit: 250



View Profile
January 11, 2014, 03:34:51 PM
 #808

Consensus is nearing!
Let's close it today Smiley

masterchain.info and mastercoin-explorer.com have only one difference - the exodus address.
see https://masterchain.info/general/difference.json

at the moment the exodus address has different values on all 4 implementations:

11016.58589661 on MyMastercoins
11031.52547426 on Masterchain
10812.36900066 on Mastercoin-Explorer
11032.15274926 on Masterchest
         
Description of my calculation:
  • all_reward is 10% of the mastercoins sold during the bootstrap (total of 56316.23576245 MSC)
  • seconds_passed = last_block_timestamp - exodus_bootstrap_deadline
  • years = seconds_passed / seconds_in_one_year
  • part_available = 1 - 0.5 ** years
  • available_reward = all_reward * part_available

The constants are:
exodus_bootstrap_deadline = 1377993600
seconds_in_one_year=31556926

This calculation is also done for the validation of each simple send that exodus address sent (to verify that the amount does not exceed the balance at that moment).

masterchest gets a very close number to masterchain.
I suspect that the minor difference is due to the number of seconds in a year.

This commit is available here:
https://github.com/grazcoin/mastercoin-tools/commit/6e45b1dd7592e6094979044b82b1fc7b7132dd3b


Bitoy
Sr. Member
****
Offline Offline

Activity: 449
Merit: 250


View Profile
January 11, 2014, 04:20:37 PM
 #809

Consensus is almost complete.


Consensus   Address                          MyMastercoins   Masterchain   Mastercoin-Explorer   Masterchest
181k55nxGuqDRpJx3iU43T4wJznf7ZazFN   0.043   0.043   0.043   
182osbPxCo88oaSX4ReJwUr9uAcchmJVaL   376.1846   376.1846   376.1846   376.2706
18ArFG8cPDT5P8NVdjFuSGjkybRTW8VBji   0.043   0.043   0.043   
1EXoDusjGwvnjZUyKkxZ4UHEf77z6A5S4P   11034.92330741   11035.15874017   10812.36900066   11034.92330741
1LjT88X7Zu8BdbqJw8vfRa83NJuzYL9kqm   60.12630845   60.12630845   60.12630845   10.00

Masterchain, mastercoin-explorer and mymastercoins are already synchronized except for the exodus address.

For the exodus address Mymastercoins recalculates based on the time of the latest block.
(Mymastercoins and masterchest has  the same balance)

 
Tachikoma
Hero Member
*****
Offline Offline

Activity: 938
Merit: 1000



View Profile WWW
January 11, 2014, 04:30:58 PM
 #810

Zathras's post about the P&D clarification.

Great post and it might solve our issues; I'm just afraid it might not solve all ambiguity. I think the P&D order is important because depending on what way you try to parse it first the recipient address might differ. I think the best way to see if your clarification holds up is to meet on IRC for the hackathon and discuss the remaining transactions and how the specs(-modifications) would answer them.

Consensus is nearing!
Let's close it today Smiley

masterchain.info and mastercoin-explorer.com have only one difference - the exodus address.
see https://masterchain.info/general/difference.json

at the moment the exodus address has different values on all 4 implementations:

11016.58589661 on MyMastercoins
11031.52547426 on Masterchain
10812.36900066 on Mastercoin-Explorer
11032.15274926 on Masterchest
         
Description of my calculation:
  • all_reward is 10% of the mastercoins sold during the bootstrap (total of 56316.23576245 MSC)
  • seconds_passed = last_block_timestamp - exodus_bootstrap_deadline
  • years = seconds_passed / seconds_in_one_year
  • part_available = 1 - 0.5 ** years
  • available_reward = all_reward * part_available

The constants are:
exodus_bootstrap_deadline = 1377993600
seconds_in_one_year=31556926

This calculation is also done for the validation of each simple send that exodus address sent (to verify that the amount does not exceed the balance at that moment).

masterchest gets a very close number to masterchain.
I suspect that the minor difference is due to the number of seconds in a year.

This commit is available here:
https://github.com/grazcoin/mastercoin-tools/commit/6e45b1dd7592e6094979044b82b1fc7b7132dd3b

The reason I'm probably not matching is because I do it per second. I think we agreed somewhere in the thread Exodus should be calculated per on each block found using the block-date. I'm not doing that yet. I will be doing that during the coming hours so hopefully it should be online before the hackathon starts.

I will be in #mastercoin / ##mastercoin in a few minutes to work on the consensus stuff. If you are already available please drop by as well so we can discuss things there.

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
January 11, 2014, 04:47:39 PM
 #811


The reason I'm probably not matching is because I do it per second. I think we agreed somewhere in the thread Exodus should be calculated per on each block found using the block-date. I'm not doing that yet. I will be doing that during the coming hours so hopefully it should be online before the hackathon starts.

I will be in #mastercoin / ##mastercoin in a few minutes to work on the consensus stuff. If you are already available please drop by as well so we can discuss things there.

I don't think that calculating "per second" is the issue, since such a calculation would end up to a higher sum, and you have got a lower sum.


grazcoin
Sr. Member
****
Offline Offline

Activity: 284
Merit: 250



View Profile
January 11, 2014, 04:51:27 PM
 #812

https://masterchest.info/consensus.aspx shows now -129.34% (negative number)
It seems like MyMastercoins is way out of sync.


grazcoin
Sr. Member
****
Offline Offline

Activity: 284
Merit: 250



View Profile
January 11, 2014, 05:00:05 PM
 #813

Consensus is almost complete.


Consensus   Address                          MyMastercoins   Masterchain   Mastercoin-Explorer   Masterchest
181k55nxGuqDRpJx3iU43T4wJznf7ZazFN   0.043   0.043   0.043   
182osbPxCo88oaSX4ReJwUr9uAcchmJVaL   376.1846   376.1846   376.1846   376.2706
18ArFG8cPDT5P8NVdjFuSGjkybRTW8VBji   0.043   0.043   0.043   
1EXoDusjGwvnjZUyKkxZ4UHEf77z6A5S4P   11034.92330741   11035.15874017   10812.36900066   11034.92330741
1LjT88X7Zu8BdbqJw8vfRa83NJuzYL9kqm   60.12630845   60.12630845   60.12630845   10.00

Masterchain, mastercoin-explorer and mymastercoins are already synchronized except for the exodus address.

For the exodus address Mymastercoins recalculates based on the time of the latest block.
(Mymastercoins and masterchest has  the same balance)


BitBoy/Zathras -
Can you please give a link to the source code that calculates the available reward of exodus address?
I would like to compare and nail those differences.


Tachikoma
Hero Member
*****
Offline Offline

Activity: 938
Merit: 1000



View Profile WWW
January 11, 2014, 05:06:36 PM
 #814

I'm on IRC now.

I think we need to pick a source and write down in the spec the source we use for the amount of seconds in a year.

I used: 60 * 60 * 24 * 365.25 but I guess we need to decide on the seconds amount. 

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
January 11, 2014, 05:13:21 PM
 #815

I'm on IRC now.

I think we need to pick a source and write down in the spec the source we use for the amount of seconds in a year.

I used: 60 * 60 * 24 * 365.25 but I guess we need to decide on the seconds amount. 

Why not just take the exact number and not an estimation?
http://wiki.answers.com/Q/How_many_seconds_are_there_in_a_year
31556926


Tachikoma
Hero Member
*****
Offline Offline

Activity: 938
Merit: 1000



View Profile WWW
January 11, 2014, 05:17:43 PM
 #816

Agreed; that's fine. I will make a pull request to add it to the spec.

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
January 11, 2014, 05:19:24 PM
 #817

https://masterchest.info/consensus.aspx shows now -129.34% (negative number)
It seems like MyMastercoins is way out of sync.



Sorry accidentally pushed the "reset database" button.  It's now back    


For the Exodus Coins Generated I used the following formula

        Time1 = $Time of latest block in seconds
        dBlockDateTime = DateAdd(DateInterval.Second, Time1, New DateTime(1970, 1, 1, 0, 0, 0))

'Calculate number of seconds from September 1,2013 to Latest Block Time
        SecondsFromSept12013 = DateDiff(DateInterval.Second, #9/1/2013#, dBlockDateTime)

        Dim Gencoins As Double = (1 - (0.5 ^ (SecondsFromSept12013 / 31557600))) * 56316.23576222
        Gencoins = Round(Gencoins) to the nearest 8 decimal

Edit

OK will change   31557600 to 31556926

Tachikoma
Hero Member
*****
Offline Offline

Activity: 938
Merit: 1000



View Profile WWW
January 11, 2014, 05:30:06 PM
 #818

Graz; difference between us is really small now.

Code:
      time_difference = (exodus_time.to_i - Mastercoin::END_TIME.to_i) / 31556926.0
      self.balance += ((1-(0.5**time_difference)) * BigDecimal.new("56316.23576222")).round(8)

Where exodus_time is the time from the latest block and Mastercoin::END_TIME is 1377993600.

Bitoy: We are actually synced up, so I guess we might both be wrong Wink

I'm stepping out to get some dinner; bbiab Smiley

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
January 11, 2014, 05:43:17 PM
Last edit: January 11, 2014, 05:55:39 PM by Bitoy
 #819

Yes Tachikoma, finally we are synched to the last msc.
11040.08115172

Grazcoin I think is just a block time away from synching 11039.54172323

( It's 2am here.  I'm going to zzzz =)

Edit
Grazcoin the difference is only 0.000000004.  Maybe you rounded to 7 digit instead of 8?
11040.7003806
11040.70038056
Tachikoma
Hero Member
*****
Offline Offline

Activity: 938
Merit: 1000



View Profile WWW
January 11, 2014, 06:53:10 PM
 #820

Dev Mastercoin clarifications pull is here: https://github.com/mastercoin-MSC/spec/pull/34

Electrum: the convenience of a web wallet, without the risks | Bytesized Seedboxes BTC/LTC supported
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!