Tutorial: Test MSC – BTC Distributed Exchange Transactions

(please note this is a work in progress, do not test with amounts that you cannot afford to lose)

Broadcasting a raw transaction via the reference Bitcoin-QT client

Note that if you are using blockchain.info you will need to use bitcoin-qt to sign the raw transaction.  Keep in mind that this process is for testing purposes and is not the final end-user / consumer process.

Requirements:

  • Bitcoin-QT client
  • positive BTC balance (to buy and sell MSC)
  • positive MSC balance (to sell MSC)

How to: MSC Sell Offer

  1. Open the Bitcoin client and navigate to help->debug window and press on the ‘console’ tab
  2. First we will verify the transaction. Type decoderawtransaction and paste the raw transaction string you got.
  3. Make sure the values are correct and check that at the bottom your Mastercoin address is visible also make sure it doesn’t say ‘”type” : “nonstandard”‘ somewhere. In the future we will make sure the Mastercoin data itself is encoded correctly as well. But for now these are the checks you should do.
  4. If you are happy with the result sign the transaction using your private key. Begin by unlocking your wallet; type walletpassphrase 15. This will unlock your wallet for 15 seconds.
  5. Type signrawtransaction and paste the raw transaction string in again.
  6. If all goes well you should see something that says: {hex: , completed: true}. Copy the part after hex.
  7. Broadcast the transaction over the network by typing sendrawtransaction and paste in the latest string.
  8. If all went well you should have gotten the transaction hash as output.

How to: MSC Buy Offer

  1. Go to http://mastercoin-explorer.com/order_books and find a sell offer, click on “Buy” under actions.buy msc step 1
  2. The form requires a public key.buy msc step 1.5
  3. To obtain your MSC public key open Bitcoin-QT click on “Help” followed by “Debug window”, and in the window that comes up click on “console”.  Input “validateaddress {somebtcaddress}”  where {somebtcaddress} is the Bitcoin address you wish to use to receive your MSC and has some BTC balance. Copy and paste the “pubkey”. 

    buy msc step 2

  4. Now take the “pubkey” and input it into the form.  And change the amount of MSC that you wish to purchase if it is not the same as the amount offered. Click “Create raw transaction”.buy msc step 1.5
  5. Now copy the string of text from the resulting page.buy msc step 3
  6. Decode the string to ensure that the transaction looks correct.  You can decode the transaction by pasting the the raw transaction string here: https://coinb.in/decode-raw-transaction.html. Make sure the values are correct and check that at the bottom your Mastercoin address is visible also make sure it doesn’t say ‘”type” : “nonstandard”‘ somewhere.
  7. Now go back to Bitcoin-Qt and sign the transaction using your private key. Begin by unlocking your wallet; type walletpassphrase {yourpassphrase} 30. This will unlock your wallet for 30 seconds.

    Blockchain users: currently blockchain.info does not offer a utility to sign a raw transaction, however there may be a work around but it requires exporting a base58 private key and using Bitcoin-QT.  Specifically, for step 8:

    signrawtransaction <hex string> [<privatekey1>,…]

  8. Now enter “signrawtransaction {rawtransactionstring}” where the {rawtransactionstring} is the string you copied in Step 5.buy msc step 4The following text should appear if all went well: {hex: , completed: true}. Copy the long string after hex.
  9. Broadcast the transaction over the Bitcoin network by typing “sendrawtransaction {outputstring}” where {outputstring} is the output string from Step 8.
  10. If all went well you should have gotten the transaction hash as output.  Copy the output string.
  11. Note that after you send this purchase offer and it’s accepted by the site you will have to send the proper amount in Bitcoin from your MasterCoin address. Make sure your address is funded and that you send the coins from this address.
Tutorial: Test MSC – BTC Distributed Exchange Transactions

12 thoughts on “Tutorial: Test MSC – BTC Distributed Exchange Transactions

  1. puck2 says:

    I get the response “You don’t have a big enough output available to create this transaction. Please consolidate some coins and send them to your Mastercoin address.” when trying to sell 0.5 Test Mastercoins from address 188EBEfRT6keiXkXmaEkWVLNbGFmuekU7h

    As far as I can tell, I do have sufficient Test Mastercoins, but perhaps I’m doing something wrong?

Comments are closed.