Bitcoin Forum
June 21, 2024, 08:13:09 AM *
News: Voting for pizza day contest
 
   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 ... 65 »
  Print  
Author Topic: 300 BTC Coding Contest: Distributed Exchange (MasterCoin Developer Thread)  (Read 129144 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
October 24, 2013, 09:51:32 AM
 #161

I've updated the amendment to include the changes we've discussed.  If viewing in browser you may need to refresh.

Anything we're missing, anything unclear?

Thanks! Smiley

Should we perhaps specify the rules what 'peek and decode' means? Other than that it looks good Smiley

I've got:

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

Perhaps specify the bytes that we'll want to look for?  Eg first byte must be 01 and so on?

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

Activity: 938
Merit: 1000



View Profile WWW
October 24, 2013, 09:53:23 AM
 #162

Yeah that was what I meant.

I think currency_id and transaction_type are the most important to check. The change of those two being valid values in a random address are very slim.

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
October 24, 2013, 09:53:46 AM
 #163

hahahahaahaha, duh. Is one way better then the other, or the default?

Don't think it matters as long as we explicitly define which way we're going - for me it's as easy as changing an X to an x in the string format so if there is either that is easier or default for you I'm happy either way Smiley

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

Activity: 938
Merit: 1000



View Profile WWW
October 24, 2013, 10:00:30 AM
 #164

I did some googling and I think using upcase is more dominant. Unless somebody has a reason not to upcase I suggest we use this for now.

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
October 24, 2013, 10:21:41 AM
 #165

I did some googling and I think using upcase is more dominant. Unless somebody has a reason not to upcase I suggest we use this for now.
Great.  Again updated the amendment to add the byte checks & that we run multiple hash passes against an uppercase hex representation of the previous hash.

I've set the byte checks at byte2 to byte8 = 00 & byte9=01 or 02.  Would you say that's sufficient?  The chances on us having to fall back on 'peek & decode' are very slim, and if we do then the chances of then getting a random collission on those bytes with an address that isn't a Mastercoin packet are astronomically low (one in 70,110,209,207,109,376 to be specific). 


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

Activity: 938
Merit: 1000



View Profile WWW
October 24, 2013, 10:23:38 AM
 #166

In the future new currencies could be created that could be sent using a Class A transaction. So I think in the future the currency id should be one of the created currency ids, for now 01 or 02 should suffice.

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
October 24, 2013, 10:56:05 AM
 #167

In the future new currencies could be created that could be sent using a Class A transaction. So I think in the future the currency id should be one of the created currency ids, for now 01 or 02 should suffice.
I currently have this in the amendment:
Quote
NOTE: Class A transactions are restricted to the ‘simple send’ transaction type only. All other Mastercoin transaction types are supported by Class B transactions only. Client implementations should utilize Class B for all transaction types, including ‘simple send’.
I had envisaged us using Class A transactions only for backwards compatibility (for example to allow people to transfer Mastercoins out of certain web wallets) and implementing Class B for everything from now on - thus Class A simple send would only ever need to support currencies 01 & 02.

If we want to allow Class A transactions to be used in future with new currencies I guess we can do so, but personally I'd rather discourage their use (bloat) and simply say simple sends for currencies other than mastercoin (& test mastercoin) must be done via Class B.

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

Activity: 938
Merit: 1000



View Profile WWW
October 24, 2013, 10:56:53 AM
 #168

Yeah, why not. As long as people understand this limitation. 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
October 24, 2013, 11:00:30 AM
 #169



For ECDSA validity (I'll also put a check function into the masterchest library) I took my inspiration from the casascius bitcoin address utility - have a read through some of the pubkey and ECDSA stuff to point you in the right direction.

Thanks!


Thanks zathras.  Will get some ecdsa information there.
zathras
Sr. Member
****
Offline Offline

Activity: 266
Merit: 250



View Profile
October 24, 2013, 11:05:49 AM
 #170

Yeah, why not. As long as people understand this limitation. Smiley
Yeah that's just my take on it - I envision wallet software encoding & sending Class B for everything, we shouldn't need to support encoding Class A (only decoding).  Nice and simple.

That way Class A transactions are only used for manual sends of Mastercoins (& test) for those that can't sign a user generated raw transaction (web wallets etc)

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

Activity: 284
Merit: 250



View Profile
October 24, 2013, 02:24:06 PM
 #171

Hi Grazcoin

You are the first to post to the the blockchain using the new multi sig.  Nice work!   ( I was able to parse your transaction  =)   

Data to Parse: 021bf733f7aab3932560cd8e8a3ec11b45ee47f0694a0b61c86ab48e63bba57cd4
OBFUSCATED MASTERCOIN PACKET: 1bf733f7aab3932560cd8e8a3ec11b45ee47f0694a0b61c86ab48e63bba57c
SHA256 HASH: 1af733f7aab3932561cd8e8a3ec1a724a047f0694a0b61c86ab48e63bba57cd0
REFERENCE ADDRESS: 17RVTF3vJzsuaGh7a94DFkg4msJ7FcBYgX
CLEARTEXT MASTERCOIN PACKET: 0100000000000000010000000000bc614e0000000000000000000000000000

01: 1 (01)
Trans Type: 0 (00000000)
Currency ID: 1 (00000001)
Amount for Sale: 12345678 (0000000000bc614e)


Good parsing.
For my parsing, you could check:
https://github.com/grazcoin/mastercoin-tools/blob/master/msc_parse.py

Note: The tx has no "Amount for Sale", but "Amount sent".


Tachikoma
Hero Member
*****
Offline Offline

Activity: 938
Merit: 1000



View Profile WWW
October 24, 2013, 03:42:28 PM
 #172

Hi Grazcoin

You are the first to post to the the blockchain using the new multi sig.  Nice work!   ( I was able to parse your transaction  =)   

Data to Parse: 021bf733f7aab3932560cd8e8a3ec11b45ee47f0694a0b61c86ab48e63bba57cd4
OBFUSCATED MASTERCOIN PACKET: 1bf733f7aab3932560cd8e8a3ec11b45ee47f0694a0b61c86ab48e63bba57c
SHA256 HASH: 1af733f7aab3932561cd8e8a3ec1a724a047f0694a0b61c86ab48e63bba57cd0
REFERENCE ADDRESS: 17RVTF3vJzsuaGh7a94DFkg4msJ7FcBYgX
CLEARTEXT MASTERCOIN PACKET: 0100000000000000010000000000bc614e0000000000000000000000000000

01: 1 (01)
Trans Type: 0 (00000000)
Currency ID: 1 (00000001)
Amount for Sale: 12345678 (0000000000bc614e)


Good parsing.
For my parsing, you could check:
https://github.com/grazcoin/mastercoin-tools/blob/master/msc_parse.py

Note: The tx has no "Amount for Sale", but "Amount sent".

This transaction is no longer valid if you consider we use the sending address for all transactions now.

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

Activity: 938
Merit: 1000



View Profile WWW
October 24, 2013, 03:44:44 PM
 #173

I've just updated mastercoin-explorer to support the new key encoding. However it seems that the obfuscation bit is very tricky and even a small difference in interpretation of the spec can cause very different results.

Could somebody please verify this transaction on mastercoin-explorer?

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
October 24, 2013, 04:22:05 PM
 #174


With each packet:
   * For sequence number 1 we SHA256 the entire length of the address (which could be anywhere from 27 to 34 bytes), result = 32 byte hash.  
   * For sequence numbers 2 onwards, we take the previous 32 byte hash and SHA256 it again (and again), result = 32 byte hash.  

Code:
SEQNUM=1   {D42C390E52F1110412078A9DB148E7A306924666FB10AAAA9BFFCC2E2ECDE3}44
SEQNUM=2   {000EC2C68806819E67A030E82A6AF98376DAC1065D7FE533DAF251D43AA836}3B
SEQNUM=3   {999722F745CC7EA5559D871285A697513D6D1F69294A472AB71499C280CFDA}72
SEQNUM=4   {23C4AC723733621964260EC4639D9DF3469E983E677B083457F325C6F56FA5}D0
SEQNUM=5   {A2989BBA3E4BF3B2995A8573E19450381C94CDE10F95A157756148217B0E37}1B

hash1 is d42c390e52f1110412078a9db148e7a306924666fb10aaaa9bffcc2e2ecde344

I tried

            Dim sha256 As SHA256 = New SHA256Managed()
            Dim hash2 As Byte() = sha256.ComputeHash(hash1)

hash2 came out as 4266395eef8a3a62fb74ed5ff4d6201573fd51318fce9eaf452eecb3ab9a8ba9

(Will check if the capital letter affect sha256)





Tachikoma
Hero Member
*****
Offline Offline

Activity: 938
Merit: 1000



View Profile WWW
October 24, 2013, 04:26:40 PM
 #175


(Will check if the capital letter affect sha256)


They do, check out the discussion me and Zathras had today Wink

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

Activity: 1260
Merit: 1031


Rational Exuberance


View Profile WWW
October 24, 2013, 04:38:54 PM
Last edit: October 24, 2013, 05:21:15 PM by dacoinminster
 #176

I think I may have found a bug. I'm working on setting up another giveaway thread (using money left over from the first MSC giveaway thread), and I noticed that there appears to be some disagreement on the balance of the address holding the giveaway funds:

Over 430 MSC are left on MasterChain:
http://masterchain.info/Address.html?addr=15og4WXZPwkMnnsb3dj6HqgTUfcRLx4J9b&currency=MSC

Less than 400 MSC are left on MasterCoin-Explorer and MasterChest
http://mastercoin-explorer.com/addresses/15og4WXZPwkMnnsb3dj6HqgTUfcRLx4J9b
https://masterchest.info/lookupadd.aspx?address=15og4WXZPwkMnnsb3dj6HqgTUfcRLx4J9b

I think that probably some of the transactions aren't being counted by MasterChain for some reason.

Thanks!

prophetx
Legendary
*
Offline Offline

Activity: 1666
Merit: 1010


he who has the gold makes the rules


View Profile WWW
October 24, 2013, 05:04:12 PM
 #177

hey Gals and Guys,

I am writing the 2nd weekly newsletter tonight and if you have any suggestions to include anything from the previous week please let me know.

For your reference the blog is here:


http://blog.mastercoin.org/
Bitoy
Sr. Member
****
Offline Offline

Activity: 449
Merit: 250


View Profile
October 24, 2013, 05:37:21 PM
 #178


(Will check if the capital letter affect sha256)


They do, check out the discussion me and Zathras had today Wink

We must have a standard for this.  I vote small letters Smiley
dacoinminster (OP)
Legendary
*
Offline Offline

Activity: 1260
Merit: 1031


Rational Exuberance


View Profile WWW
October 24, 2013, 06:01:45 PM
 #179


(Will check if the capital letter affect sha256)


They do, check out the discussion me and Zathras had today Wink

We must have a standard for this.  I vote small letters Smiley

Actually, I believe upper-case has been agreed upon:

I did some googling and I think using upcase is more dominant. Unless somebody has a reason not to upcase I suggest we use this for now.
Great.  Again updated the amendment to add the byte checks & that we run multiple hash passes against an uppercase hex representation of the previous hash.

I've set the byte checks at byte2 to byte8 = 00 & byte9=01 or 02.  Would you say that's sufficient?  The chances on us having to fall back on 'peek & decode' are very slim, and if we do then the chances of then getting a random collission on those bytes with an address that isn't a Mastercoin packet are astronomically low (one in 70,110,209,207,109,376 to be specific). 



superfluouso
Full Member
***
Offline Offline

Activity: 201
Merit: 100


View Profile
October 24, 2013, 06:24:41 PM
 #180

Does anyone have guidance for setting up mastercoin advisor in Mac OS X and/or Ubuntu?
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 ... 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!