diff --git a/README.md b/README.md index cbbe0e7..58f2fd1 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,15 @@ -Mastercoin Complete Specification +Mastercoin Complete Specification ================================= -vs1.1 (Smart Property Edition) +vs1.2 (Tons of New Features Edition) -dacoinminster (j DOT r DOT willett AT gmail.com) +dacoinminster (jr DOT willett AT gmail DOT com) -The Mastercoin Foundation - info@mastercoin.org - [mastercoin.org](http://mastercoin.org) +The Mastercoin Foundation - info@mastercoin.org # Summary -We claim that _the_ _existing bitcoin network can be used as a protocol layer, on top of which new currency layers with new rules can be built_ _without changing the foundation_. We further claim that the new protocol layers described in this document: +We claim that the existing bitcoin network can be used as a protocol layer, on top of which new currency layers with new rules can be built without changing the foundation. We further claim that the new protocol layers described in this document: * Will fix the two biggest barriers to widespread bitcoin adoption: instability and insecurity. * Will financially benefit the entire bitcoin user community, including those who don’t use the new protocol layers. @@ -34,7 +34,7 @@ Our claims are built on the following assumptions: The proposed protocol layers can be visualized as follows, with arrows representing users exchanging between currencies: -![Mastercoin Protocol Layers](https://raw.github.com/mastercoin-MSC/spec/master/images/layers.png) +![Mastercoin Protocol Layers](images/layers.png) @@ -42,13 +42,14 @@ Note that all transfers of value are still stored in the normal bitcoin block ch # Document History -1. Version 0.5 released 1/6/2012 (No packet definitions, overly-complicated currency stabilization) -2. Version 0.7 released 7/29/2013 (Preview of 1.0, but without revealing the Exodus Address) -3. Version 1.0 released 7/31/2013 (Version used during the fund-raiser) -4. Version 1.1 (Smart Property. Also, improvements for easier parsing and better escrow fund health) +* Version 0.5 released 1/6/2012 (No packet definitions, overly-complicated currency stabilization) +* Version 0.7 released 7/29/2013 (Preview of 1.0, but without revealing the Exodus Address) +* Version 1.0 released 7/31/2013 (Version used during the fund-raiser) +* Version 1.1 released 9/9/2013 (Smart Property. Also, improvements for easier parsing and better escrow fund health) +* Version 1.2 released 11/11/2013 (Added "Pay Dividend" message, spending limits for savings wallets, contract-for-difference bets, and distributed e-commerce messages. Also added Zathras' new appendix (description of class B and class C methods of storing Mastercoin data.) -Previous versions of this document can be found at https://sites.google.com/site/2ndbtcwpaper/ +Pre-github versions of this document (prior to version 1.2) can be found at https://sites.google.com/site/2ndbtcwpaper/ # Mastercoin Design @@ -56,53 +57,33 @@ The “Mastercoins” protocol layer between the existing bitcoin protocol and u ## The “Exodus Address” -Perhaps you have heard of the “Genesis Block” which launched the bitcoin protocol. The Mastercoin protocol has a similar starting point in the block chain, called the “Exodus Address” - the bitcoin address from which the first Mastercoins will be sold. The Exodus Address is: **[1EXoDusjGwvnjZUyKkxZ4UHEf77z6A5S4P](https://blockchain.info/address/1EXoDusjGwvnjZUyKkxZ4UHEf77z6A5S4P)** (please read the “Special Considerations” section below before sending bitcoins to this address!) +Perhaps you have heard of the “Genesis Block” which launched the bitcoin protocol. The Mastercoin protocol has a similar starting point in the block chain, called the “Exodus Address” - the bitcoin address from which the first Mastercoins were sold during the month of August 2013. The Exodus Address is: **[1EXoDusjGwvnjZUyKkxZ4UHEf77z6A5S4P](https://blockchain.info/address/1EXoDusjGwvnjZUyKkxZ4UHEf77z6A5S4P)** -Initial distribution of Mastercoins will essentially be a fundraiser to provide money to pay developers to write the software which fully implements the protocol. The distribution is very simple, and will proceed as follows: +Initial distribution of Mastercoins was essentially a fundraiser to provide money to pay developers to write the software which fully implements the protocol. The distribution was very simple, and proceeded as follows: -1. Anyone sending bitcoins to the Exodus Address before August 31st, 2013 is recognized by the protocol as owning 100x that number of Mastercoins. For instance, if I send 100 bitcoins to the Exodus Address before August 31st, my bitcoin address owns 10,000 Mastercoins after August 31st. -2. Early buyers get additional Mastercoins. In order to encourage adoption momentum, buyers will get an additional 10% bonus Mastercoins if they make their purchase a week before the deadline, 20% extra if they purchase two weeks early, and so on, including partial weeks. Thus, if I send 100 bitcoins to the exodus address 1.5 weeks before August 31st, the protocol recognizes my bitcoin address as owning 11,500 Mastercoins (10000 + 15% bonus). -3. Attempts to send funds to the Exodus Address on or after September 1st 2013 (as determined by bitcoin block chain records) will not be considered Mastercoin purchases. (**Update 9/8/2013: **Transactions sent before the deadline but not included in a block until after the deadline may be included. This is still under discussion at the time of this writing) +1. Anyone who sent bitcoins to the Exodus Address before August 31st, 2013 was recognized by the protocol as owning 100x that number of Mastercoins. For instance, if I sent 100 bitcoins to the Exodus Address before August 31st, my bitcoin address owns 10,000 Mastercoins after August 31st. +2. Early buyers got additional Mastercoins. In order to encourage adoption momentum, buyers got an additional 10% bonus Mastercoins if they made their purchase a week before the deadline, 20% extra if they purchased two weeks early, and so on, including partial weeks. Thus, if I sent 100 bitcoins to the exodus address 1.5 weeks before August 31st, the protocol recognized my bitcoin address as owning 11,500 Mastercoins (10000 + 15% bonus). +3. Attempts to send funds to the Exodus Address on or after September 1st 2013 (after block #255365) were not considered Mastercoin purchases, and were refunded to the sender. +In the event that a purchase had multiple inputs, the input address contributing the most funds was recognized as owning the Mastercoins. -In the event that a purchase has multiple inputs, the input address contributing the most funds is recognized as owning the Mastercoins. +Note that anyone who purchased Mastercoins also received the same number of “Test Mastercoins” which are being used for testing new features before they are available for use in the Mastercoin protocol. -Note that anyone who purchases Mastercoins also receives the same number of “Test Mastercoins” which will be used for testing new features before they are available for use in the Mastercoin protocol. +Initially, the only valid Mastercoin transaction was a “simple send” (defined later in this document), but the additional features described in this document are being implemented, and can be used once they are fully tested. -Initially, the only valid Mastercoin transaction will be a “simple transfer” (defined later in this document), but the additional features described in this document will also become valid in the future (at specific pre-announced block milestones) once they are fully tested. +## Dev Mastercoins -## Reward Mastercoins +For every 10 Mastercoins sold, an additional “dev Mastercoin” was also created, which are being awarded to the Exodus Address slowly over the years following the fundraiser. These delayed Mastercoins will ensure that we (the Mastercoin Foundation) have funding to complete the features desired by users. The reward is be structured so that we receive 50% of the reward by one year after the initial sale, 75% by a year later, 87.5% by a year later, and so on: -For every 10 Mastercoins sold, an additional “reward Mastercoin” will also be created, which will be awarded to the Exodus Address slowly over the following years. These delayed Mastercoins will ensure that we have plenty of motivation to increase the value of Mastercoins by completing the features desired by users. The reward will be structured so that we receive 50% of the reward by one year after the initial sale, 75% by a year later, 87.5% by a year later, and so on: - -![Reward Mastercoins](https://raw.github.com/mastercoin-MSC/spec/master/images/reward-mastercoin-formula.png) +![Reward Mastercoins](images/reward-mastercoin-formula.png) ## Hiding Mastercoin Protocol Data in the Block Chain Bitcoin has some little-known advanced features (such as scripting) which many people imagine will enable it to perform fancy new tricks someday. Mastercoin uses exactly NONE of those advanced features, because support for them is not guaranteed in the future, and Mastercoin doesn't need them anyway. -Mastercoin transactions are defined as a series of bitcoin payments from a bitcoin address where the payments match this pattern: - -1. A “reference” payment (of any amount) to another bitcoin address (called the reference address), such as the person being paid Mastercoins -2. One or more “data” payments (of any amount) to fake bitcoin addresses. (A fake bitcoin address can contain 20 bytes of arbitrary data, not including overhead such as the version number and check-sum of the address.) This is data used by the protocol, such as the number of Mastercoins being paid -3. A “marker” payment (of any amount) to the Exodus Address marking this series of payments to be interpreted as a Mastercoin transaction. - - -~~These payments may be sent one at a time or all at once (via bitcoin's “sendmany” function), and in any order (even if we sent them in a particular order, there is no way to force miners to keep them in that order). The only requirement is they cannot have long time gaps between them (not more than 6 blocks apart in the block chain), and they must be distinguishable from other Mastercoin transactions by using a 6-block time gap or the “sendmany” function. (see update below)~~ - -**Update 9/8/2013:** Current implementations of Mastercoin only recognize “sendmany” transactions. We may someday support transactions sent one-at-a-time, but please don’t count on it. Also, at the request of bitcoin core devs, we are working on alternate ways of storing the “data address” packets which do not create unspendable bitcoins. Gavin Andresen has assured us that there are multiple alternate ways to store the data, and once we settle on a better way, this spec will be updated, and we will use the new method for any features beyond the “simple send” transaction. “Simple Send” must remain in its current form so that people can transfer their Mastercoins out of basic unmodified bitcoin wallets. - -## Putting Data Packets in Order - -Since the packets are stored unordered, some consideration must be made to how to tell these payments apart and put data packets in their proper order. - -For ordering data packets, each 20-byte payload starts with a 1-byte sequence number which is incremented for each data packet. +Mastercoin was originally specified to hide data in the block chain using fake bitcoin addresses (Class A), but we've since come up with a more blockchain friendly method which hides data in a bitcoin multi-signature transaction (Class B). Once bitcoin miners start supporting the new OP_RETURN opcode, we'll be able to use that opcode to make Mastercoin data completely prunable (Class C). -In order to distinguish data packets from the reference address, the data packet sequence numbers start at n+1 where n is the sequence number of the reference packet if it were treated as a data packet. Any additional data packets can continue to use up sequence numbers n+2, n+3, and so on until all sequence numbers are used except for n-1. - -As an example of how this works, let's imagine a Mastercoin transaction that has two data packets. If the reference address happens to have a sequence number of 62, then the first data packet has a sequence number of 63 and the second has a sequence number of 64. Note that sequence number 255 is followed by 0. - -The theoretical limit on the amount of protocol data that could be stored in one Mastercoin transaction is therefore 254 data payments * 19 bytes = 4826 bytes, but we expect that most common transactions should only need one or two data payments. All numbers are stored big-endian (most significant digits first). +The technical details for both Class A and Class B transactions can be found in Appendix A. ## Special Considerations to Avoid Invalid Transactions @@ -110,15 +91,12 @@ Not every wallet lets you choose which address bitcoins come from when you make Wallets which do not allow you to consolidate to one address and send from that address (such as online web wallet providers) will not work for Mastercoin unless they are modified to do so. For this reason, **attempting to purchase Mastercoins from an online web wallet will likely result in the permanent loss of those Mastercoins.** -All transaction outputs should be for the same amount, which should be above the “dust” threshold, and should include an appropriate fee to ensure that miners include them in the block chain in a timely manner. For instance, the first Mastercoin transactions had three outputs of 0.00006 BTC each, with a 0.0001 BTC transaction fee. -If these recommendations are not followed, the Mastercoin transaction may be malformed and therefore invalid. +## Transferring Mastercoins (Simple Send) -## Transferring Mastercoins +Say you want to transfer 1 Mastercoin to another address. Only 16 bytes are needed. The data stored is: -Say you want to transfer 1 Mastercoin to another address. Only 16 bytes are needed, which fits into a single data payment. The data stored is: - -1. Transaction type = 0 for simple transfer (32-bit unsigned integer, 4 bytes) +1. Transaction type = 0 for simple send (32-bit unsigned integer, 4 bytes) 2. Currency identifier = 1 for Mastercoin (32-bit unsigned integer, 4 bytes) 3. Amount to transfer = 100,000,000 (1.00000000 Mastercoins) (64-bit unsigned integer, 8 bytes, should not exceed number owned, but if it does, assume user is transferring all of them) @@ -127,42 +105,71 @@ Note that the amount to transfer is multiplied by 100,000,000 before it is store Note that if the transfer comes from an address which has been marked as “Savings”, there is a time window in which the transfer can be undone. Otherwise Mastercoin transactions are not reversible. + + ## Marking an Address as “Savings” -Say you want to back up your savings wallet in the cloud, but if someone manages to hack into it, you want transactions out of that wallet to be reversible for up to 30 days. Doing this takes 8 bytes, which fits into a single data payment: +Say you want to back up your savings wallet in the cloud, but if someone manages to hack into it, you want transactions out of that wallet to be reversible for up to 30 days. Doing this takes 8 bytes: 1. Transaction type = 10 for marking savings (32-bit unsigned integer, 4 bytes) 2. Reversibility period = 2,592,000 seconds (30 days) (32-bit unsigned integer, 4 bytes) - The maximum reversibility period is 365 days (1,892,160,000 seconds) to avoid accidents. Marking an address as savings is PERMANENT and cannot be undone. If an address is marked as savings, the reversibility rules affect not only Mastercoins, but any Mastercoin-derived child currency stored at that address. -When marking an address as savings, the reference payment should point to a “guardian” address authorized to reverse fraudulent transactions. The guardian address should preferably be from an unused offline or paper wallet. +When marking an address as savings, the reference payment should point to a “guardian” address authorized to reverse fraudulent transactions. The guardian address should preferably be from an unused offline or paper wallet. The sending address should be the address to be marked as savings. When a fraudulent transaction is reversed, any pending funds go to the guardian address, rather than going back to the compromised savings address. Also, any funds which remain in the compromised address also go to the guardian wallet. An address marked as savings can only do simple transfers (transaction type=0). All other transaction types require addresses without a reversibility time window. + ## Marking a Savings Address as Compromised -Say you notice that the address you marked as savings has been compromised, and you want to reverse transactions and transfer everything to the guardian address. Doing this takes 4 bytes, which fits into a single data payment +Say you notice that the address you marked as savings has been compromised, and you want to reverse transactions and transfer everything to the guardian address. Doing this takes 4 bytes: 1. Transaction type = 11 for marking a compromised savings address (32-bit unsigned integer, 4 bytes) - This transaction must be sent from the guardian address. The reference payment must be to the compromised savings address. Funds from any pending transactions and any remaining funds will then be transferred to the guardian address, both Mastercoins and any currencies derived from Mastercoins. + ## Advantages of the Savings/Guardian Model The savings/guardian model is intended to allow the user to take extreme precautions against accidental loss of the savings address (for instance, by storing lots of backups, including in the cloud), and extreme precautions against theft of the guardian address. Although reasonable precautions should be taken, if your savings address gets hacked, or the key to your guardian address gets lost or destroyed, the coins can still be recovered. This model also facilitates estate planning. You simply give your heir(s) a paper copy to the private key of your savings address, but you keep the guardian address key to yourself. If you die, your heirs can simply transfer the funds out of your savings (they will have to wait for the reversibility period to pass), but they can't steal from you while you are alive since you are the only one with the key to the guardian address and can reverse their transaction if they try. -It should be obvious that anyone accepting Mastercoins or Mastercoin-derived currencies for payment should check that the payment is not reversible before completing the transaction! +It should be obvious that anyone parsing Mastercoin transactions for payment should check that the payment is not reversible before completing the transaction! + + +## Marking an Address as Rate-Limited + +Say you want to enforce a spending limit of 1 Mastercoin per Month on one of your addresses. Doing this takes 20 bytes: + +1. Transaction type = 12 for rate limitation (32-bit unsigned integer, 4 bytes) +2. Currency identifier = 1 for Mastercoin (32-bit unsigned integer, 4 bytes) +3. Spending Limit = 100,000,000 (1.00000000 Mastercoins) (64-bit unsigned integer, 8 bytes) +4. Limitation Reset period = 2,592,000 seconds (30 days) (32-bit unsigned integer, 4 bytes) + +Marking an address as rate-limited only affects the specified currency. Other currencies stored in the address are not rate-limited. The limitation reset period begins once the protected address makes a send. Attempting to send beyond the rate limit results in the maximum send possible under the limit. + +When marking an address as rate-limited, the reference payment should point to a “guardian” address authorized to remove the limitation. The guardian address should preferably be from an unused offline or paper wallet. The sending address should be the address to be marked as rate-limited. Note that an address could be marked as savings AND rate limited, with the same or different guardian addresses. + +An address marked as rate limited can only do simple transfers (transaction type=0). All other transaction types require addresses without a rate limitation. + + +## Removing a rate limitation + +Removing the rate limitation above takes 8 bytes: + +1. Transaction type = 14 for removing rate limitation (32-bit unsigned integer, 4 bytes) +2. Currency identifier = 1 for Mastercoin (32-bit unsigned integer, 4 bytes) + +This transaction must be sent from the guardian address in charge of the rate limitation. The reference payment must be to the rate-limited address. Removing the limit only affects the specified currency, and not any other rate-limited currencies stored at that address. + ## Selling Mastercoins for Bitcoins -Say you want to publish an offer to sell 1.5 Mastercoins for 1000 bitcoins. Doing this takes 33 bytes, which fits into two data payments: +Say you want to publish an offer to sell 1.5 Mastercoins for 1000 bitcoins. Doing this takes 33 bytes: 1. Transaction type = 20 for currency trade offer for bitcoins (32-bit unsigned integer, 4 bytes) 2. Currency identifier for sale = 1 for Mastercoin (32-bit unsigned integer, 4 bytes) @@ -171,27 +178,15 @@ Say you want to publish an offer to sell 1.5 Mastercoins for 1000 bitcoins. Doin 5. Time limit = 10 (10 blocks in which to send payment after counter-party accepts these terms) (8-bit unsigned integer, 1 byte) 6. Minimum bitcoin transaction fee = 10,000,000 (require that the buyer pay a hefty 0.1 BTC transaction fee to the miner, discouraging fake offers) (64-bit unsigned integer, 8 bytes) - -## Selling Mastercoins for Other Mastercoin-Derived Currencies - -Say you want to publish an offer to sell 2.5 Mastercoins for 50 GoldCoins (coins which each represent one ounce of gold, derived from Mastercoins and described later in this document). For the sake of example, we'll assume that GoldCoins have currency identifier 3. Doing this takes 28 bytes, which fits into two data payments: - -1. Transaction type = 21 for currency trade offer for another Mastercoin-derived currency (32-bit unsigned integer, 4 bytes) -2. Currency identifier for sale = 1 for Mastercoin (32-bit unsigned integer, 4 bytes) -3. Amount for sale = 250,000,000 (2.50000000 Mastercoins) (64-bit unsigned integer, 8 bytes, should not exceed the number owned, but if it does, assume the user is selling all of them) -4. Currency identifier desired = 3 for GoldCoin (32-bit unsigned integer, 4 bytes) -5. Amount of GoldCoins desired = 5,000,000,000 (50.00000000 GoldCoins) (64-bit unsigned integer, 8 bytes) - - ## Changing an Offer Say you decide you want to change the number of coins you are offering for sale, or change the asking price. Simply re-send the offer with the new details. If your change gets into the block chain before someone accepts your old offer, your offer has been updated. If you decide you want to cancel an offer, simply send the offer again, but enter the number of coins for sale as zero. -## Purchasing a Currency Offered For Sale +## Purchasing Mastercoins with Bitcoins -Say you see an offer such as those listed above, and wish to accept it. Doing so takes 16 bytes, which fits into 1 data payment: +Say you see an offer such as the one listed above, and wish to initiate a purchase of those Mastercoins. Doing so takes 16 bytes: 1. Transaction type = 22 for accepting currency trade offer (32-bit unsigned integer, 4 bytes) 2. Currency identifier you are purchasing = 1 for Mastercoin (32-bit unsigned integer, 4 bytes) @@ -200,17 +195,27 @@ Say you see an offer such as those listed above, and wish to accept it. Doing so The reference address should point to the seller's address, to identify whose offer you are accepting. -If you are purchasing with bitcoins, make sure your total expenditures on bitcoin transaction fees while accepting the purchase meet the minimum fee requested! +Note: Make sure your total expenditures on bitcoin transaction fees while accepting the purchase meet the minimum fee requested! -You will need to send the appropriate amount of bitcoins before the time limit expires to complete the purchase. Note that you must send the bitcoins from the same address which initiated the purchase. If you send less than the correct amount of bitcoins, your purchase will be for that amount. **Update 9/8/2013:** In order to make parsing Mastercoin transactions easier, you must also include an output to the Exodus Address when sending the bitcoins to complete a purchase of Mastercoins. The output can be for any amount, but should be above the dust threshold. +You will need to send the appropriate amount of bitcoins before the time limit expires to complete the purchase. Note that you must send the bitcoins from the same address which initiated the purchase. If you send less than the correct amount of bitcoins, your purchase will be for that amount. In order to make parsing Mastercoin transactions easier, you must also include an output to the Exodus Address when sending the bitcoins to complete a purchase of Mastercoins. The output can be for any amount, but should be above the dust threshold. -If you are purchasing with Mastercoin or a Mastercoin-derived currency such as GoldCoins, your purchase is complete as soon as you accept the offer (assuming you are recorded in the block chain as the first to accept the offer). If you have less than the correct amount on hand, your purchase will be for that amount. +## Selling Mastercoins for Other Mastercoin-Derived Currencies + +Say you want to publish an offer to sell 2.5 Mastercoins for 50 GoldCoins (coins which each represent one ounce of gold, derived from Mastercoins and described later in this document). For the sake of example, we'll assume that GoldCoins have currency identifier 3. Doing this takes 28 bytes: + +1. Transaction type = 21 for currency trade offer for another Mastercoin-derived currency (32-bit unsigned integer, 4 bytes) +2. Currency identifier for sale = 1 for Mastercoin (32-bit unsigned integer, 4 bytes) +3. Amount for sale = 250,000,000 (2.50000000 Mastercoins) (64-bit unsigned integer, 8 bytes, should not exceed the number owned, but if it does, assume the user is selling all of them) +4. Currency identifier desired = 3 for GoldCoin (32-bit unsigned integer, 4 bytes) +5. Amount of GoldCoins desired = 5,000,000,000 (50.00000000 GoldCoins) (64-bit unsigned integer, 8 bytes) + +To accept the offer above, simply publish the same message type with an inverse offer (selling Goldcoins for Mastercoins) at a price which matches or beats the seller's price. The protocol simply finds orders that match and the coins from matching orders are considered transfered at the price specified by the earlier of the two offers. Note that when only some coins are purchased, the rest are still for sale with the same terms. ## Registering a Data Stream -Say you decide you would like to start publishing the price of Gold in the block chain. Registering your data stream takes a varying number of bytes due to the use of null-terminated strings. This example uses 57 bytes, which fits in 3 data payments: +Say you decide you would like to start publishing the price of Gold in the block chain. Registering your data stream takes a varying number of bytes due to the use of null-terminated strings. This example uses 57 bytes: 1. Transaction type = 30 for registering a data stream (32-bit unsigned integer, 4 bytes) 2. Parent Currency Identifier = 1 for Mastercoin (32-bit unsigned integer, 4 bytes) (Meaning that the price of Gold will be published in units of Mastercoin) @@ -221,7 +226,7 @@ Say you decide you would like to start publishing the price of Gold in the block 7. Display Multiplier = 10,000 (if the ticker publishes 0.00150000, the price of an ounce of gold is currently 15.0000 Mastercoins. (32-bit unsigned integer, 4 bytes) -The reference payment should be to the bitcoin address which will be publishing the data. Only the first payment sent from that address in a given day (as determined by block-chain timestamps) will be considered ticker data. **Update 9/8/2013:** Data published by a ticker should also have an output to the Exodus Address – this will make it easier to find ticker data in the block chain data. The output can be for any amount, but should be above the dust threshold. +The reference payment should be to the bitcoin address which will be publishing the data. Only the first payment sent from that address in a given day (as determined by block-chain timestamps) will be considered ticker data. Data published by a ticker should also have an output to the Exodus Address – this will make it easier to find ticker data in the block chain data. The output can be for any amount, but should be above the dust threshold. Each data stream gets a unique identifier, determined by the order in which they were registered. For instance, if your data stream was the third data stream ever registered, your data stream identifier would be 3. @@ -231,19 +236,20 @@ If you ever need to change the description/notes for your data stream (for insta ## Offering a Bet -Say you want to use USDCoins (another hypothetical currency derived from Mastercoin, each USDCoin being worth one U.S. Dollar) to bet $200 that the gold ticker will not rise above 20 Mastercoins/Ounce in the next 30 days at 2:1 odds. For the sake of example, we will assume that USDCoins have currency identifier 5. Creating this bet takes 36 bytes which fits into 2 data payments +Say you want to use USDCoins (another hypothetical currency derived from Mastercoin, each USDCoin being worth one U.S. Dollar) to bet $200 that the gold ticker will not rise above 20 Mastercoins/Ounce in the next 30 days at 2:1 odds. For the sake of example, we will assume that USDCoins have currency identifier 5. Creating this bet takes 36 bytes: 1. Transaction type = 40 for creating a bet offer (32-bit unsigned integer, 4 bytes) 2. Bet Currency identifier = 5 for USDCoin (32-bit unsigned integer, 4 bytes) 3. Data Stream identifier = 3 for the Gold ticker, per our data stream example (32-bit unsigned integer, 4 bytes) 4. Bet Type = 35 for “Will not exceed on or before” (See table below) (16-bit unsigned integer, 2 bytes) -5. Bet threshold = 200,000 (0.00200000 BTC, which equates to a ticker value of 20 per our data stream example) (32-bit unsigned integer, 4 bytes) +5. Bet threshold (Non-CFDs only) = 200,000 (0.00200000 BTC, which equates to a ticker value of 20 per our data stream example) **OR** Leverage (CFDs only) = 65536 (1x leverage) (32-bit unsigned integer, 4 bytes) 6. Days out = 30 (16-bit unsigned integer, 2 bytes) 7. Amount of wager = 20,000,000,000 (200.00000000 USDCoins) (64-bit unsigned integer, 8 bytes) 8. Amount of counter-wager = 10,000,000,000 (100.00000000 USDCoins) (64-bit unsigned integer, 8 bytes) +Since this bet is not a CFD (described later) "bet threshold" is used rather than "leverage". -By offering $200 against $100, the desired 2:1 odds are implied. It is not possible to change a bet (you must cancel and then broadcast a new bet). To cancel your bet, rebroadcast it with all the same data except set the amount of wager to zero. +By offering $200 against $100, the desired 2:1 odds are implied. Since one address might want to have multiple similar wagers, it is not possible to change a bet (you must cancel and then broadcast a new bet). To cancel your bet, rebroadcast it with all the same data except set the amount of wager to zero. **Table of Bet Types** @@ -284,8 +290,26 @@ By offering $200 against $100, the desired 2:1 odds are implied. It is not possi
REFERENCE ADDRESS | {1CdighsfdfRcj4ytQSskZgQXbUEamuMUNF } | +
SHA256 HASH (S TIMES) OF ADDRESS | {1D9A3DE5C2E22BF89A1E41E6FEDAB54582F8A0C3AE14394A59366293DD130C }59 | +
CLEARTEXT MASTERCOIN PACKET | 02{ 0100000000000000010000000002faf0800000000000000000000000000000 }XX | +
OBFUSCATED MASTERCOIN PACKET | 02{ 1C9A3DE5C2E22BF89B1E41E6FED84FB502F8A0C3AE14394A59366293DD130C }XX | +