Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Send All #313

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,7 @@ This section defines the fields that are used to construct transaction messages.
+ Current Valid values:
* 0: [Simple Send](#transfer-coins-simple-send)
* 3: [Send To Owners](#send-to-owners)
* 4: [Send All](#transfer-all-coins-send-all)
* 20: [Sell Coins for Bitcoins (currency trade offer)](#sell-mastercoins-for-bitcoins)
* 21: [Offer/Accept Omni Protocol Coins for Another Omni Protocol Currency (currency trade offer)](#sell-omni-protocol-coins-for-another-omni-protocol-currency)
* 22: [Purchase Coins with Bitcoins (accept currency trade offer)](#purchase-mastercoins-with-bitcoins)
Expand Down Expand Up @@ -404,6 +405,23 @@ Say you want to transfer 1 Mastercoin to another address. Only 16 bytes are need
|Currency identifier| [Currency identifier](#field-currency-identifier) |1 (Mastercoin)|
|Amount to transfer|[Number of Coins](#field-number-of-coins)|100,000,000 (1.0 coins) |

### Transfer All Coins (Send All)

Description: Transaction type 4 transfers all coins from the sending address to the reference address, defined in [Appendix A](#appendix-a-storing-omni-protocol-data-in-the-blockchain). This transaction can not be used to transfer bitcoins.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

... transfers all coins in the available balances of all smart properties owned by the sending address ...

Items that need consideration:

  1. is this an all or nothing transaction - transfers of all available balances succeed or none of them succeed if at least 1 fails?
    • certain sends may be blocked in the future, e.g. a non-transferable SP (maybe that's just not in the available balance), address can reject receipt of specified SPs
      • for instance, an address may want to divest itself of one or more SPs and prevent any future ownership of those SPs
    • how are failure details reported?
  2. side effects of transfers, e.g. if the reference address has an open crowdsale for a transferred currency, the sending address would be credited with newly issued coins. This can be handled by the fact that this is not a txtype 0 Send, so the protocol can specify that Send All does not invoke the side effects of txtype 0 Send. That needs a decision.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WRT side effects, Send To Owners doesn't invoke crowdsale participation (as far as I know) so there's a precedent. The spec doesn't state that, so that's another clarification to be made.


In addition to the validity constraints on the message field datatypes, the transaction is invalid if any of the following conditions is true:
* the sending address has zero coins in all omni currencies

A Send All to a non-existent address will destroy the coins in question, just like it would with bitcoin.

The data stored is:

| **Field** | **Type** | **Example** |
| ---- | ---- | ---- |
| Transaction version |[Transaction version](#field-transaction-version) | 0 |
| Transaction type | [Transaction type](#field-transaction-type) | 0 |


### Send To Owners

Description: Transaction type 3 transfers coins in the specified currency from the sending address to the current owners of that currency. The current owners are all the addresses, excluding the sender's address, that have a non-zero balance of the specified currency when the transaction message is processed. The Amount to transfer must be divided proportionally among the current owners based upon each owner's current available balance plus reserved amount, excluding the amount owned by the sender.
Expand Down Expand Up @@ -445,6 +463,8 @@ The Omni Protocol allows users to trade coins without trusting a centralized web

Consequently, the messages below are different for mastercoin/bitcoin exchange than they are for exchange between mastercoin and other Omni Protocol currencies, and the resulting UI must also be different, reflecting both the one-sided nature of bitcoin/mastercoin exchange as well as the additional anti-spam fees and race conditions inherent in the system.



### Sell Mastercoins for Bitcoins

Description: Transaction type 20 posts the terms of an offer to sell Mastercoins or Test Mastercoins for bitcoins. A new sell offer is created with Action = 1 (New). Valid currency identifier values for this transaction are 1 for MSC or 2 for Test MSC.
Expand Down