Bitcoin Forum
May 07, 2024, 08:15:22 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 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.
Bitoy
Sr. Member
****
Offline Offline

Activity: 449
Merit: 250


View Profile
November 04, 2013, 09:08:37 AM
 #321

Here is my implementation of the Distributed Trade processing.

http://mymastercoins.com/Orders.aspx?CurrencyID=2


Some notes
CFSID = Currency for Sale ID.
Available = No of Test MSC left for sale.   
If BTCDesired = 0.  Set  all Available to 0 (for that Currency).

Buying
If AmounttoPurchase > Available
AmountPurchased = Available


Comments are very welcomed =)


This is pretty nice.  I notice that completed transactions all show as "Waiting for payment"  The seller ID's with links are a cool touch - do the existing ID's reference anything specific?

"waiting for payment" means it hasn't  seen a payment made by the buyer to the seller for the purchase transaction. 

The way I understand it is the buyer has to send a btc payment direct to the sellers address and .00006 btc to the exodus address (one transaction 2 sends) before the test msc is transferred.

Clicking sellers Id will redirect you to a link ex.
http://mymastercoins.com/default.aspx?AID=998
Click find
Select test msc.
You will see the buying and selling of that address.

Will try to see if I can automate this Smiley
1715069722
Hero Member
*
Offline Offline

Posts: 1715069722

View Profile Personal Message (Offline)

Ignore
1715069722
Reply with quote  #2

1715069722
Report to moderator
1715069722
Hero Member
*
Offline Offline

Posts: 1715069722

View Profile Personal Message (Offline)

Ignore
1715069722
Reply with quote  #2

1715069722
Report to moderator
1715069722
Hero Member
*
Offline Offline

Posts: 1715069722

View Profile Personal Message (Offline)

Ignore
1715069722
Reply with quote  #2

1715069722
Report to moderator
Transactions must be included in a block to be properly completed. When you send a transaction, it is broadcast to miners. Miners can then optionally include it in their next blocks. Miners will be more inclined to include your transaction if it has a higher transaction fee.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715069722
Hero Member
*
Offline Offline

Posts: 1715069722

View Profile Personal Message (Offline)

Ignore
1715069722
Reply with quote  #2

1715069722
Report to moderator
zathras
Sr. Member
****
Offline Offline

Activity: 266
Merit: 250



View Profile
November 04, 2013, 09:48:07 AM
 #322




Yeah, I think we should use the timestamp of the most recent bitcoin block, rather than the node's local clock.

I guess the full formula is actually (1-(0.5^y)) * 10% * total number of mastercoins bought at 1Exodus before the deadline

Could somebody confirm my vesting calculation is correct?

Let's set the time to 2013-10-31 10:45:45 +0100 the output I get for the Exodus vesting is MSC 6103.51504811.

Just a quick note on this one - I'm getting slightly different amounts, can you let me know what you're using for your fixed values?

I'm using:
* Seconds in a year: 31557600
* End of funding: 1377993600
* Total Reward Mastercoins: 56316.23576222

Using your example time (1383212745) I'm seeing 6099.57209817.

Thanks for checking. This is what I'm using now.

Code:
      time_difference = (tx_date - Mastercoin::END_TIME) / 60 / 60 / 24 / 365.25
      exodus_vesting = (1-(0.5**time_difference)) * 0.1 * 563_162.23576222

tx_date = 1383212745
Mastercoin::END_TIME = 1377993600
time_difference = 5219145

Giving me a total of 6060.791436028762 (I initially used a rounded down value for the total amount of MSC, doh.)


Could I just get you to double check your numbers one more time mate?  I've double checked mine and we're using the same formula but getting different results it seems.

I've expanded out the numbers for clarity:
Code:
Console.WriteLine((1 - (0.5 ^ ((1383212745 - 1377993600) / 31557600))) * 56316.23576222)
6099.57209816932
       
For my implementation of the distributed exchange it'll be a few more days before I open up the wallet for testing and push the new engine up to Masterchest as I still have some areas to fix up from the changes (had to change the way I handled transactions) but I'll start putting some of my tests in the blockchain soon and see how my stuff interops with the stuff you guys have already done Smiley

"waiting for payment" means it hasn't  seen a payment made by the buyer to the seller for the purchase transaction. 

The way I understand it is the buyer has to send a btc payment direct to the sellers address and .00006 btc to the exodus address (one transaction 2 sends) before the test msc is transferred.
That's correct, a payment to Exodus is required when sending the BTC payment (though it doesn't necessarily have to be 0.00006, anything >dust is fine).  There have been some trades already done (see for example 18xEZx3po1iJWP5H2aM3Do11dCGQyaebnT) that appear to be valid Smiley

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

Activity: 449
Merit: 250


View Profile
November 04, 2013, 12:51:25 PM
Last edit: November 04, 2013, 01:07:32 PM by Bitoy
 #323



I've expanded out the numbers for clarity:
Code:
Console.WriteLine((1 - (0.5 ^ ((1383212745 - 1377993600) / 31557600))) * 56316.23576222)
6099.57209816932
     
For my implementation of the distributed exchange it'll be a few more days before I open up the wallet for testing and push the new engine up to Masterchest as I still have some areas to fix up from the changes (had to change the way I handled transactions) but I'll start putting some of my tests in the blockchain soon and see how my stuff interops with the stuff you guys have already done Smiley

"waiting for payment" means it hasn't  seen a payment made by the buyer to the seller for the purchase transaction.  

The way I understand it is the buyer has to send a btc payment direct to the sellers address and .00006 btc to the exodus address (one transaction 2 sends) before the test msc is transferred.
That's correct, a payment to Exodus is required when sending the BTC payment (though it doesn't necessarily have to be 0.00006, anything >dust is fine).  There have been some trades already done (see for example 18xEZx3po1iJWP5H2aM3Do11dCGQyaebnT) that appear to be valid Smiley


Your calculations for msc dev coins looks correct to me.


18xEZx3po1iJWP5H2aM3Do11dCGQyaebnT paid 0.003232 in
2bb54346f7d0ddfcb084451227089665bc1a7ebf8f0a9338d14d713592c268ed

But there is a transfer fee of .001. My implementation is expecting payment of .004232.   Transfer fee paid by the buyer?

http://mymastercoins.com/Orders.aspx?CurrencyID=2

Ok got it the fee is 0.001 will fix the bug.
https://blockchain.info/tx/2bb54346f7d0ddfcb084451227089665bc1a7ebf8f0a9338d14d713592c268ed
Tachikoma
Hero Member
*****
Offline Offline

Activity: 938
Merit: 1000



View Profile WWW
November 04, 2013, 01:46:30 PM
 #324




Yeah, I think we should use the timestamp of the most recent bitcoin block, rather than the node's local clock.

I guess the full formula is actually (1-(0.5^y)) * 10% * total number of mastercoins bought at 1Exodus before the deadline

Could somebody confirm my vesting calculation is correct?

Let's set the time to 2013-10-31 10:45:45 +0100 the output I get for the Exodus vesting is MSC 6103.51504811.

Just a quick note on this one - I'm getting slightly different amounts, can you let me know what you're using for your fixed values?

I'm using:
* Seconds in a year: 31557600
* End of funding: 1377993600
* Total Reward Mastercoins: 56316.23576222

Using your example time (1383212745) I'm seeing 6099.57209817.

Thanks for checking. This is what I'm using now.

Code:
      time_difference = (tx_date - Mastercoin::END_TIME) / 60 / 60 / 24 / 365.25
      exodus_vesting = (1-(0.5**time_difference)) * 0.1 * 563_162.23576222

tx_date = 1383212745
Mastercoin::END_TIME = 1377993600
time_difference = 5219145

Giving me a total of 6060.791436028762 (I initially used a rounded down value for the total amount of MSC, doh.)


Could I just get you to double check your numbers one more time mate?  I've double checked mine and we're using the same formula but getting different results it seems.

I've expanded out the numbers for clarity:
Code:
Console.WriteLine((1 - (0.5 ^ ((1383212745 - 1377993600) / 31557600))) * 56316.23576222)
6099.57209816932
       
For my implementation of the distributed exchange it'll be a few more days before I open up the wallet for testing and push the new engine up to Masterchest as I still have some areas to fix up from the changes (had to change the way I handled transactions) but I'll start putting some of my tests in the blockchain soon and see how my stuff interops with the stuff you guys have already done Smiley

"waiting for payment" means it hasn't  seen a payment made by the buyer to the seller for the purchase transaction. 

The way I understand it is the buyer has to send a btc payment direct to the sellers address and .00006 btc to the exodus address (one transaction 2 sends) before the test msc is transferred.
That's correct, a payment to Exodus is required when sending the BTC payment (though it doesn't necessarily have to be 0.00006, anything >dust is fine).  There have been some trades already done (see for example 18xEZx3po1iJWP5H2aM3Do11dCGQyaebnT) that appear to be valid Smiley


Not sure what changed but I ran the code again now and got a different answer somehow. It's still not a 100% match though.

Code:
1.9.3-p286 :002 > tx_date = Time.parse("2013-10-31 10:45:45 +0100")
 => 2013-10-31 10:45:45 +0100
1.9.3-p286 :003 >   time_difference = (tx_date - Mastercoin::END_TIME) / 60 / 60 / 24 / 365.25
 => 0.1653847250741501
1.9.3-p286 :004 >  exodus_vesting = (1-(0.5**time_difference)) * 0.1 * 563_162.23576222
 => 6099.570778312406

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 04, 2013, 02:29:21 PM
 #325

It maybe a rounding off issue

Zathras
* 56316.23576222

Tachikoma
*.01 * 563162.23576222

Zathras
/31557600

Tachikoma
/ 60 / 60 / 24 / 365.25

Also What is "+0100" in the time
2013-10-31 10:45:45 +0100




Not sure what changed but I ran the code again now and got a different answer somehow. It's still not a 100% match though.

Code:
1.9.3-p286 :002 > tx_date = Time.parse("2013-10-31 10:45:45 +0100")
 => 2013-10-31 10:45:45 +0100
1.9.3-p286 :003 >   time_difference = (tx_date - Mastercoin::END_TIME) / 60 / 60 / 24 / 365.25
 => 0.1653847250741501
1.9.3-p286 :004 >  exodus_vesting = (1-(0.5**time_difference)) * 0.1 * 563_162.23576222
 => 6099.570778312406
Tachikoma
Hero Member
*****
Offline Offline

Activity: 938
Merit: 1000



View Profile WWW
November 04, 2013, 02:37:16 PM
 #326

It maybe a rounding off issue

Zathras
* 56316.23576222

Tachikoma
*.01 * 563162.23576222

Zathras
/31557600

Tachikoma
/ 60 / 60 / 24 / 365.25

Also What is "+0100" in the time
2013-10-31 10:45:45 +0100




Not sure what changed but I ran the code again now and got a different answer somehow. It's still not a 100% match though.

Code:
1.9.3-p286 :002 > tx_date = Time.parse("2013-10-31 10:45:45 +0100")
 => 2013-10-31 10:45:45 +0100
1.9.3-p286 :003 >   time_difference = (tx_date - Mastercoin::END_TIME) / 60 / 60 / 24 / 365.25
 => 0.1653847250741501
1.9.3-p286 :004 >  exodus_vesting = (1-(0.5**time_difference)) * 0.1 * 563_162.23576222
 => 6099.570778312406

It's the timezone. I'm guessing that could be the reason for the small difference. I'm betting that if I would recalculate it with an hour difference we get the same numbers. Will check that out as soon as I can.

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 04, 2013, 02:56:59 PM
 #327

That's correct, a payment to Exodus is required when sending the BTC payment (though it doesn't necessarily have to be 0.00006, anything >dust is fine).  There have been some trades already done (see for example 18xEZx3po1iJWP5H2aM3Do11dCGQyaebnT) that appear to be valid Smiley


3 Payment transaction confirmed =)

http://mymastercoins.com/Orders.aspx?CurrencyID=2
Tachikoma
Hero Member
*****
Offline Offline

Activity: 938
Merit: 1000



View Profile WWW
November 04, 2013, 03:13:11 PM
 #328

That's correct, a payment to Exodus is required when sending the BTC payment (though it doesn't necessarily have to be 0.00006, anything >dust is fine).  There have been some trades already done (see for example 18xEZx3po1iJWP5H2aM3Do11dCGQyaebnT) that appear to be valid Smiley


3 Payment transaction confirmed =)

http://mymastercoins.com/Orders.aspx?CurrencyID=2

Hmm I show some more: http://mastercoin-explorer.com/order_books

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 04, 2013, 03:32:37 PM
Last edit: November 04, 2013, 03:44:15 PM by Bitoy
 #329

Code:
Console.WriteLine((1 - (0.5 ^ ((1383212745 - 1377993600) / 31557600))) * 56316.23576222)
6099.57209816932

Sorry should have addressed this to Zathras =)

DateDiff(DateInterval.Second, #1/1/1970#, #9/1/2013#)
= 1377993600
Correct.

DateDiff(DateInterval.Second, #1/1/1970#, #10/01/2013 10:45:45#)
= 1380624345   
Not the same with your result.
=1383212745

How did you get 1383212745 ?
vokain
Legendary
*
Offline Offline

Activity: 1834
Merit: 1019



View Profile WWW
November 04, 2013, 03:38:45 PM
Last edit: November 04, 2013, 04:00:01 PM by vokain
 #330

I was wondering, would it be possible to build upon the same mechanism for BTC-MSC exchange and add support for LTC/other alt-chain exchanging? I don't use LTC or have any but I do know a decent segment would find it useful to be able to trade back and forth between alt currencies. It could be a good, quick, and easy proof-of-concept and validation for Mastercoin to be used to trade other cryptocurrencies around for each other if there was a way to parse/manipulate two blockchains at once.
Bitoy
Sr. Member
****
Offline Offline

Activity: 449
Merit: 250


View Profile
November 04, 2013, 03:43:06 PM
 #331

3 Payment transaction confirmed =)

http://mymastercoins.com/Orders.aspx?CurrencyID=2

Hmm I show some more: http://mastercoin-explorer.com/order_books
[/quote]

ok.  I will check this out asap.  
Luckybit
Hero Member
*****
Offline Offline

Activity: 714
Merit: 510



View Profile
November 04, 2013, 05:09:18 PM
 #332

I was wondering, would it be possible to build upon the same mechanism for BTC-MSC exchange and add support for LTC/other alt-chain exchanging? I don't use LTC or have any but I do know a decent segment would find it useful to be able to trade back and forth between alt currencies. It could be a good, quick, and easy proof-of-concept and validation for Mastercoin to be used to trade other cryptocurrencies around for each other if there was a way to parse/manipulate two blockchains at once.

Actually thinking about it, it probably would be trivial. If you can do it with BTC I don't see why LTC would be difficult but I'm not an expert.

I think once MSC to BTC is working then LTC and the other altcoins ought to be next.
dacoinminster (OP)
Legendary
*
Offline Offline

Activity: 1260
Merit: 1031


Rational Exuberance


View Profile WWW
November 04, 2013, 06:45:34 PM
 #333

I was wondering, would it be possible to build upon the same mechanism for BTC-MSC exchange and add support for LTC/other alt-chain exchanging? I don't use LTC or have any but I do know a decent segment would find it useful to be able to trade back and forth between alt currencies. It could be a good, quick, and easy proof-of-concept and validation for Mastercoin to be used to trade other cryptocurrencies around for each other if there was a way to parse/manipulate two blockchains at once.

Actually thinking about it, it probably would be trivial. If you can do it with BTC I don't see why LTC would be difficult but I'm not an expert.

I think once MSC to BTC is working then LTC and the other altcoins ought to be next.


LTC will have to wait until we've got LTC tokens stored in the bitcoin block chain. That will either be user-backed smart property, or escrow-backed tokens later. We can do BTC/MSC now because we are living in the BTC block chain.

zathras
Sr. Member
****
Offline Offline

Activity: 266
Merit: 250



View Profile
November 04, 2013, 09:26:47 PM
Last edit: November 04, 2013, 09:36:48 PM by zathras
 #334

It maybe a rounding off issue

Zathras
* 56316.23576222

Tachikoma
*.01 * 563162.23576222

Zathras
/31557600

Tachikoma
/ 60 / 60 / 24 / 365.25

Also What is "+0100" in the time
2013-10-31 10:45:45 +0100




Not sure what changed but I ran the code again now and got a different answer somehow. It's still not a 100% match though.

Code:
1.9.3-p286 :002 > tx_date = Time.parse("2013-10-31 10:45:45 +0100")
 => 2013-10-31 10:45:45 +0100
1.9.3-p286 :003 >   time_difference = (tx_date - Mastercoin::END_TIME) / 60 / 60 / 24 / 365.25
 => 0.1653847250741501
1.9.3-p286 :004 >  exodus_vesting = (1-(0.5**time_difference)) * 0.1 * 563_162.23576222
 => 6099.570778312406

It's the timezone. I'm guessing that could be the reason for the small difference. I'm betting that if I would recalculate it with an hour difference we get the same numbers. Will check that out as soon as I can.

It's not a timezone issue (we're both using the same value for time difference; 5219145).  The discrepancy is in rounding.  Mastercoins are divisible by 8 decimal places only, thus the reward/dev Mastercoin total is 56316.22357622 (not 56316.223576222).

Your method of using 0.1 * total_purchased_MSC results in a reward/dev MSC total with too many decimal places (9), which thus then produces a slightly skewed vested figure.

For example (again expanded numbers to keep simple)

Code:
Console.WriteLine("Testing against a dev MSC total of 56316.23576222:"
Console.WriteLine((1 - (0.5 ^ ((1383212745 - 1377993600) / 31557600))) * 56316.23576222)

Testing against a dev MSC total of 56316.23576222:
6099.57209816932
Code:
Console.WriteLine("Testing against a dev MSC total of 56316.235762222: (note 9 decimal places)"
Console.WriteLine((1 - (0.5 ^ ((1383212745 - 1377993600) / 31557600))) * 0.1 * 563162.23576222)

Testing against a dev MSC total of 56316.235762222: (note 9 decimal places)
6099.57077831241

I know it's only 0.000000002 but as you can see the second example matches your numbers.  I don't believe that 9th decimal place can be counted hence I believe the correct value (as at 1383212745) was 6099.57209817 MSC - hope this helps Smiley

Code:
Console.WriteLine((1 - (0.5 ^ ((1383212745 - 1377993600) / 31557600))) * 56316.23576222)
6099.57209816932


Sorry should have addressed this to Zathras =)

DateDiff(DateInterval.Second, #1/1/1970#, #9/1/2013#)
= 1377993600
Correct.

DateDiff(DateInterval.Second, #1/1/1970#, #10/01/2013 10:45:45#)
= 1380624345   
Not the same with your result.
=1383212745

How did you get 1383212745 ?
1383212745 is unix time for Tachikoma's original example time (2013-10-31 10:45:45 +0100).  Looks like you have the wrong date in there (10/01/2013).

Thanks! Smiley

Smart Property & Distributed Exchange: Master Protocol for Bitcoin
Tachikoma
Hero Member
*****
Offline Offline

Activity: 938
Merit: 1000



View Profile WWW
November 04, 2013, 09:43:42 PM
 #335

It maybe a rounding off issue

Zathras
* 56316.23576222

Tachikoma
*.01 * 563162.23576222

Zathras
/31557600

Tachikoma
/ 60 / 60 / 24 / 365.25

Also What is "+0100" in the time
2013-10-31 10:45:45 +0100




Not sure what changed but I ran the code again now and got a different answer somehow. It's still not a 100% match though.

Code:
1.9.3-p286 :002 > tx_date = Time.parse("2013-10-31 10:45:45 +0100")
 => 2013-10-31 10:45:45 +0100
1.9.3-p286 :003 >   time_difference = (tx_date - Mastercoin::END_TIME) / 60 / 60 / 24 / 365.25
 => 0.1653847250741501
1.9.3-p286 :004 >  exodus_vesting = (1-(0.5**time_difference)) * 0.1 * 563_162.2357622
 => 6099.570778312406

It's the timezone. I'm guessing that could be the reason for the small difference. I'm betting that if I would recalculate it with an hour difference we get the same numbers. Will check that out as soon as I can.

It's not a timezone issue (we're both using the same value for time difference; 5219145).  The discrepancy is in rounding.  Mastercoins are divisible by 8 decimal places only, thus the reward/dev Mastercoin total is 56316.22357622 (not 56316.223576222).


It's late and I don't feel too well but I'm still not getting the right result.

Code:
2.0.0p247 :017 >       time_difference = (tx_date.to_i - Mastercoin::END_TIME.to_i) / 60 / 60 / 24 / 365.25
 => 0.16427104722792607
2.0.0p247 :018 >       exodus_vesting = (1-(0.5**time_difference)) * 0.1 * 563_162.35762218
 => 6060.79274749

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

Activity: 266
Merit: 250



View Profile
November 04, 2013, 09:57:54 PM
 #336

It's late and I don't feel too well but I'm still not getting the right result.
Code:
2.0.0p247 :017 >       time_difference = (tx_date.to_i - Mastercoin::END_TIME.to_i) / 60 / 60 / 24 / 365.25
 => 0.16427104722792607
2.0.0p247 :018 >       exodus_vesting = (1-(0.5**time_difference)) * 0.1 * 563_162.35762218
 => 6060.79274749

Sorry to hear you're not feeling well, please don't feel at all like you need to respond just take it easy for a bit Smiley

Re above, if you took your original code:

Not sure what changed but I ran the code again now and got a different answer somehow. It's still not a 100% match though.

Code:
1.9.3-p286 :002 > tx_date = Time.parse("2013-10-31 10:45:45 +0100")
 => 2013-10-31 10:45:45 +0100
1.9.3-p286 :003 >   time_difference = (tx_date - Mastercoin::END_TIME) / 60 / 60 / 24 / 365.25
 => 0.1653847250741501
1.9.3-p286 :004 >  exodus_vesting = (1-(0.5**time_difference)) * 0.1 * 563_162.23576222
 => 6099.570778312406

And simply change

Code:
1.9.3-p286 :004 >  exodus_vesting = (1-(0.5**time_difference)) * 0.1 * 563_162.23576222

to

Code:
1.9.3-p286 :004 >  exodus_vesting = (1-(0.5**time_difference)) * 56316.22357622

You should be set Smiley  Get well soon Smiley

Smart Property & Distributed Exchange: Master Protocol for Bitcoin
Tachikoma
Hero Member
*****
Offline Offline

Activity: 938
Merit: 1000



View Profile WWW
November 04, 2013, 10:00:11 PM
 #337

Wow I must be having a stroke  Undecided I was using the total amount of MSC not the reward MSC in my calculation... Thanks for pointing that out! I will get to bed now Smiley

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

Activity: 266
Merit: 250



View Profile
November 04, 2013, 10:08:58 PM
 #338

Wow I must be having a stroke  Undecided I was using the total amount of MSC not the reward MSC in my calculation... Thanks for pointing that out! I will get to bed now Smiley

Hehe Smiley you were still doing the right thing (taking 0.1*total_MSC) just getting caught out by that 9th decimal - I'm quite green on Ruby but I think you could correct your original code with .round, so:

Original:
Code:
1.9.3-p286 :004 >  exodus_vesting = (1-(0.5**time_difference)) * 0.1 * 563_162.23576222

Suggested:
Code:
1.9.3-p286 :004 >  exodus_vesting = (1-(0.5**time_difference)) * 56316.22357622

Alternate Suggested:
Code:
1.9.3-p286 :004 >  exodus_vesting = (1-(0.5**time_difference)) * (0.1 * 563_162.23576222).round(8)

Rest easy Smiley

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

Activity: 284
Merit: 250



View Profile
November 04, 2013, 10:36:16 PM
 #339

I am adding now the parsing of sell/buy offers to mastercoin-tools, and I start with this tx:
https://blockchain.info/tx/49f3efe0eba50ea08220c27d3c8174c5fa8a7782615823ab256859562cbd4a34

The first data_hex of the tx, deobfuscated, is:
0001000000140000000200000000773594000000000000004e2006000000000000
and it is parsed to:
[{"tx_hash": "49f3efe0eba50ea08220c27d3c8174c5fa8a7782615823ab256859562cbd4a34", "block": "267950", "tx_type_str": "Sell offer", "from_address": "13NRX88EZbS5q81x6XFrTECzrciPREo821", "index": "311", "currencyId": "00000002", "tx_time": "1383592863000", "invalid": false, "padding": "000000", "tx_method_str": "multisig", "amount": "0000000077359400", "currency_str": "Test Mastercoin", "formatted_amount": "20.00000000", "to_address": "unknown", "baseCoin": "00", "method": "multisig", "dataSequenceNum": "01", "transactionType": "00000014"}]

This fits to http://mastercoin-explorer.com/transactions/49f3efe0eba50ea08220c27d3c8174c5fa8a7782615823ab256859562cbd4a34
but I still need to decipher the following from the second data_hex:
* Price per coin
* Bitcoin amount desired
* Fee required
* Block time limit

The second data_hex of the tx is:
022eadb2cab02d826df0af54e92a352945c9892df6cd77f1a7c390fc82c8b0edb4

And if I try to deobfuscate it (the same way like the first data_hex), I get:
000966b7aba530122804984859bab666d58150b9d5e5cb007953579259fd7c3000

I still didn't find the format definition anywhere.
Can you please give me a link?


zathras
Sr. Member
****
Offline Offline

Activity: 266
Merit: 250



View Profile
November 04, 2013, 10:59:07 PM
 #340

I am adding now the parsing of sell/buy offers to mastercoin-tools, and I start with this tx:
https://blockchain.info/tx/49f3efe0eba50ea08220c27d3c8174c5fa8a7782615823ab256859562cbd4a34

The first data_hex of the tx, deobfuscated, is:
0001000000140000000200000000773594000000000000004e2006000000000000
and it is parsed to:
[{"tx_hash": "49f3efe0eba50ea08220c27d3c8174c5fa8a7782615823ab256859562cbd4a34", "block": "267950", "tx_type_str": "Sell offer", "from_address": "13NRX88EZbS5q81x6XFrTECzrciPREo821", "index": "311", "currencyId": "00000002", "tx_time": "1383592863000", "invalid": false, "padding": "000000", "tx_method_str": "multisig", "amount": "0000000077359400", "currency_str": "Test Mastercoin", "formatted_amount": "20.00000000", "to_address": "unknown", "baseCoin": "00", "method": "multisig", "dataSequenceNum": "01", "transactionType": "00000014"}]

This fits to http://mastercoin-explorer.com/transactions/49f3efe0eba50ea08220c27d3c8174c5fa8a7782615823ab256859562cbd4a34
but I still need to decipher the following from the second data_hex:
* Price per coin
* Bitcoin amount desired
* Fee required
* Block time limit

The second data_hex of the tx is:
022eadb2cab02d826df0af54e92a352945c9892df6cd77f1a7c390fc82c8b0edb4

And if I try to deobfuscate it (the same way like the first data_hex), I get:
000966b7aba530122804984859bab666d58150b9d5e5cb007953579259fd7c3000

I still didn't find the format definition anywhere.
Can you please give me a link?

Hey Grazcoin,

You'll need to look at your multi-packet handling.  From your de-obfuscated packet It looks like you're SHA hashing the second packet only once.  You'll need to hash seqnum times (so in this case 2).

In terms of a 'definition' for Class B I think the closest thing we have at the mo is my suggested amendment here

Hope that helps Smiley

Smart Property & Distributed Exchange: Master Protocol for Bitcoin
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!