Bitcoin Forum
November 19, 2024, 06:00:27 AM *
News: Latest Bitcoin Core release: 28.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 129204 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.
zathras
Sr. Member
****
Offline Offline

Activity: 266
Merit: 250



View Profile
November 02, 2013, 09:31:54 PM
 #301


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.


Smart Property & Distributed Exchange: Master Protocol for Bitcoin
superfluouso
Full Member
***
Offline Offline

Activity: 201
Merit: 100


View Profile
November 02, 2013, 09:52:53 PM
 #302



Quote
What if I dont have the mastercoins on my bitcoin-qt wallet but on the blockchain's wallet ? will I still manaage to broadcast the transaction ?

https://www.facebook.com/groups/213147185526904/214802042028085/?comment_id=214808968694059&notif_t=group_comment


========EDIT=======

Nevermind I found the answer to this

https://blockchain.info/pushtx

I saw that also but could not figure out how to sign the raw transaction.  Would be nice if blockchain.info could also be used in addition to the console but I couldn't find a way to do it.
puck2
Full Member
***
Offline Offline

Activity: 234
Merit: 105



View Profile
November 03, 2013, 01:43:57 AM
 #303

I am trying to create a sell order for a few fractions of Test Mastercoins. I find the following labels in the "Building new selling offer " page confusing and/or ambiguous:

* Amount
* Amount desired

Do these refer to total Test Mastercoins for sale and total amount desired?
These should read, perhaps, for clarity

* Amount for sale
* Total sale price

or

* Number of (Test) Mastercoins for sale
* Price per (Test) Mastercoin
Tachikoma
Hero Member
*****
Offline Offline

Activity: 938
Merit: 1000



View Profile WWW
November 03, 2013, 09:57:19 AM
 #304

I am trying to create a sell order for a few fractions of Test Mastercoins. I find the following labels in the "Building new selling offer " page confusing and/or ambiguous:

* Amount
* Amount desired

Do these refer to total Test Mastercoins for sale and total amount desired?
These should read, perhaps, for clarity

* Amount for sale
* Total sale price

or

* Number of (Test) Mastercoins for sale
* Price per (Test) Mastercoin

Which browser are you using? The placeholder text should offer more information. Amount says: "Total amount of MSC to sell" and the amount desired says "Total amount of Bitcoin". I figured most browser support placeholder text by now but if not I can probably add some hints to the fields to make it more clear.

A little sidenote, I orginally build this just for developers so they had an easy way to compare implementation outputs. I did not really expect consumer to use it.


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.)

1EdAjiApS5cCpHdH4RKPMab1xmMVRWjLvk to buy 20 test MSC from 13NRX88EZbS5q81x6XFrTECzrciPREo821
Just successfully sent my first test transaction on the BTC to MSC decentralized exchange.

At first nothing happened so I entered the transaction hash into Mastercoin explorer:
http://mastercoin-explorer.com/transactions/33644e6f24b29e1ef170d78ff04eab6f7e19368908edc6d477f9902697a71d67

It seems that the process could be more streamlined but it does seem to work. Now I'll wait to see if I receive 20 test MSC

Complete success:
http://mastercoin-explorer.com/addresses/1EdAjiApS5cCpHdH4RKPMab1xmMVRWjLvk

Now the selling offer:
e1a53bf47d64391294d07110f6cc9f94e56963e960829ad45886c9800047a6bf

It should broadcast here:
http://mastercoin-explorer.com/order_books

Congrats! Awesome that you managed to get it all to work. Now I have some more coins to buy for my own tests since buying from yourself is just silly.

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 03, 2013, 12:27:13 PM
 #305


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.



I'm getting

6107.4878641923424

Seconds in a year: (60*60*24*365) 31536000
End of funding: 9/1/2013
Total Reward Mastercoins: 6107.4878641923424

My code is

Dim Gencoins2 As Double = (1 - (0.5 ^ (DateDiff(DateInterval.Second, #9/1/2013#, #10/31/2013 10:45:45 AM#) / 31536000))) * 0.1 * 563162.36


Bitoy
Sr. Member
****
Offline Offline

Activity: 449
Merit: 250


View Profile
November 03, 2013, 01:03:12 PM
 #306

I would like to make a suggestion

Regarding the time limit, Currently the timelimit is  in # blocks.   My suggestion is to set it to days so that user will know when his offer will expire.


When making a payment,Seller sends payment in BTC to Buyer Address and a dust amount (ex. 0.00007)  to the exodus address.   

This will make parsing of payments easier.
 
Tachikoma
Hero Member
*****
Offline Offline

Activity: 938
Merit: 1000



View Profile WWW
November 03, 2013, 01:39:29 PM
 #307

I would like to make a suggestion

Regarding the time limit, Currently the timelimit is  in # blocks.   My suggestion is to set it to days so that user will know when his offer will expire.

Timelimit is not for the seller; it's for the person sending an Accept Offer message.
 
When making a payment,Seller sends payment in BTC to Buyer Address and a dust amount (ex. 0.00007)  to the exodus address.   

This will make parsing of payments easier.
 

This is already in 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
November 03, 2013, 02:12:11 PM
 #308

I would like to make a suggestion

Regarding the time limit, Currently the timelimit is  in # blocks.   My suggestion is to set it to days so that user will know when his offer will expire.

Timelimit is not for the seller; it's for the person sending an Accept Offer message.
 
When making a payment,Seller sends payment in BTC to Buyer Address and a dust amount (ex. 0.00007)  to the exodus address.   

This will make parsing of payments easier.
 

This is already in the spec.

Yes the time limit is for the seller.  What if the seller would like to place a time limit on his offer? Ie price is valid 7 days from now.  Anyway it is just a thought.  Thank you for your response.

Is there already a transaction Id with a confirmed payment?


Tachikoma
Hero Member
*****
Offline Offline

Activity: 938
Merit: 1000



View Profile WWW
November 03, 2013, 02:13:00 PM
 #309

This transaction is valid according to my code. Give it a go Smiley

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

Activity: 1666
Merit: 1010


he who has the gold makes the rules


View Profile WWW
November 03, 2013, 04:22:28 PM
 #310

Seems the fee was not set properly. I'm investigating.

Edit: I'm guessing you kept the fee set to 0.00001 ? This is lower then the required network fee. I've updated the code to force the fee to 0.0001 when it's set lower so other users don't make this mistake.

That is correct I did not change anything else other then the amount of test MSC to buy.

So is this TX just going to hang out on the network with 0 confirms until the fees are lowered or something?? 
Bitoy
Sr. Member
****
Offline Offline

Activity: 449
Merit: 250


View Profile
November 03, 2013, 04:23:06 PM
 #311


The transaction "48d09647a8b233dbd2eecf16873bdcd99afa73ecbcd3c8b5ca39d79f0abfa1d5" is valid but there is no payment confirmation to the seller (13NRX88EZbS5q81x6XFrTECzrciPREo821).

I was expecting a send to many transaction ie.
1. 13NRX88EZbS5q81x6XFrTECzrciPREo821  0.000101 Btc  (Payment for 1 Test MSC coin)
2. Exodus Address   .00006 btc


Code:

Seller
13NRX88EZbS5q81x6XFrTECzrciPREo821

Currency for Sale  
#. Time, Amount
1. 11/2/2013 2:54:18 PM, 20  
2. 11/2/2013 1:53:12 PM, 20   note: zero amount not valid
3. 10/28/2013 7:46:57 PM, 10
4. 10/28/2013 11:48:56 AM, 10  
5. 10/25/2013 2:25:07 PM, 1  


Accepted
Time,Amount
11/2/2013 8:17:50 PM, 20  (Accepted 4@#3 16@#2 )
11/2/2013 2:16:37 PM, 1   (Accepted 1@#3 )
10/28/2013 9:50:50 PM, 10 (Accepted 7@#4 and 3@#3 )
10/28/2013 4:15:23 PM, 2  (Accepted 2@#4)    
10/28/2013 3:58:55 PM, 2  (Accepted 1@#5 and 1@#4)


Tachikoma
Hero Member
*****
Offline Offline

Activity: 938
Merit: 1000



View Profile WWW
November 03, 2013, 04:27:32 PM
 #312



Quote
What if I dont have the mastercoins on my bitcoin-qt wallet but on the blockchain's wallet ? will I still manaage to broadcast the transaction ?

https://www.facebook.com/groups/213147185526904/214802042028085/?comment_id=214808968694059&notif_t=group_comment


========EDIT=======

Nevermind I found the answer to this

https://blockchain.info/pushtx

I saw that also but could not figure out how to sign the raw transaction.  Would be nice if blockchain.info could also be used in addition to the console but I couldn't find a way to do it.

I need to go and do a bunch of updates to the tutorial, and set up a blockchain wallet  but I think you may be able to use this

https://blockchain.info/pushtx
That's only for sending a transaction. Not signing it.

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

Activity: 1666
Merit: 1010


he who has the gold makes the rules


View Profile WWW
November 03, 2013, 05:08:18 PM
 #313



Quote
What if I dont have the mastercoins on my bitcoin-qt wallet but on the blockchain's wallet ? will I still manaage to broadcast the transaction ?

https://www.facebook.com/groups/213147185526904/214802042028085/?comment_id=214808968694059&notif_t=group_comment


========EDIT=======

Nevermind I found the answer to this

https://blockchain.info/pushtx

I saw that also but could not figure out how to sign the raw transaction.  Would be nice if blockchain.info could also be used in addition to the console but I couldn't find a way to do it.

I need to go and do a bunch of updates to the tutorial, and set up a blockchain wallet  but I think you may be able to use this

https://blockchain.info/pushtx
That's only for sending a transaction. Not signing it.

Sorry I had misread that.
 
Could they use this to sign the tx in bitcoin-qt? the 3rd option is for a base58 private key, which can be exported from blockchain.info wallet advanced settings

signrawtransaction <hex string> [{"txid":txid,"vout":n,"scriptPubKey":hex},...] [<privatekey1>,...] [sighash="ALL"]
Tachikoma
Hero Member
*****
Offline Offline

Activity: 938
Merit: 1000



View Profile WWW
November 03, 2013, 05:32:48 PM
 #314

x-post from General thread.

Quote
I've spend the last few days working on updating my Mastercoin-wallet (running on OS X and Unix-like, windows is possible as well) to supported distributed exchange messages and gave it it's own topic. For those who want to help test things this would be a great opportunity.




Quote
What if I dont have the mastercoins on my bitcoin-qt wallet but on the blockchain's wallet ? will I still manaage to broadcast the transaction ?

https://www.facebook.com/groups/213147185526904/214802042028085/?comment_id=214808968694059&notif_t=group_comment


========EDIT=======

Nevermind I found the answer to this

https://blockchain.info/pushtx

I saw that also but could not figure out how to sign the raw transaction.  Would be nice if blockchain.info could also be used in addition to the console but I couldn't find a way to do it.

I need to go and do a bunch of updates to the tutorial, and set up a blockchain wallet  but I think you may be able to use this

https://blockchain.info/pushtx
That's only for sending a transaction. Not signing it.

Sorry I had misread that.
 
Could they use this to sign the tx in bitcoin-qt? the 3rd option is for a base58 private key, which can be exported from blockchain.info wallet advanced settings

signrawtransaction <hex string> [{"txid":txid,"vout":n,"scriptPubKey":hex},...] [<privatekey1>,...] [sighash="ALL"]

That could work, never done it myself though.

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 03, 2013, 06:24:40 PM
 #315

MyMastercoins.com

http://mymastercoins.com/Default.aspx

show MSC and test MSC balance per address
transactions per address  (checked with mastercoin-explorer,masterchest,masterchain)
calculates and validates MSC dev coins
vb.net
sql server




TKeenan
Hero Member
*****
Offline Offline

Activity: 874
Merit: 1000



View Profile
November 03, 2013, 07:16:46 PM
 #316

MyMastercoins.com

http://mymastercoins.com/Default.aspx

show MSC and test MSC balance per address
transactions per address  (checked with mastercoin-explorer,masterchest,masterchain)
calculates and validates MSC dev coins
vb.net
sql server
Awesome!!!  Way to go.  Very cool work.
Bitoy
Sr. Member
****
Offline Offline

Activity: 449
Merit: 250


View Profile
November 04, 2013, 12:44:59 AM
 #317

Thanks TKeenan.

Btw I haven't turned on the transaction processing (data as of nov 4 only) because of  debugging on distributed exchange.

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



MyMastercoins.com

http://mymastercoins.com/Default.aspx

show MSC and test MSC balance per address
transactions per address  (checked with mastercoin-explorer,masterchest,masterchain)
calculates and validates MSC dev coins
vb.net
sql server
Awesome!!!  Way to go.  Very cool work.
Bitoy
Sr. Member
****
Offline Offline

Activity: 449
Merit: 250


View Profile
November 04, 2013, 03:49:36 AM
 #318

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 =)
Bitoy
Sr. Member
****
Offline Offline

Activity: 449
Merit: 250


View Profile
November 04, 2013, 08:26:26 AM
 #319


For the transaction above, is the btc payment( for the test btc) in the multi sig ?

superfluouso
Full Member
***
Offline Offline

Activity: 201
Merit: 100


View Profile
November 04, 2013, 08:35:41 AM
 #320

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?
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!