OK transactions:
f0862dda475d17383e7c3c63ad5a015e8dfd77d627ca45ec2e1ba2579c29e0f9
8175fcd0221ee5cda1808f48861bef5c2d5e8b9acf91a7b0fade5768d35f6665
Are not considered Mastercoin transactions by my implementation.
This is because my implementation enforces a literal interpretation of the spec, being that only one additional output is allowed for change in Class A. Both those transactions are attemping Class A but have two additional change outputs.
Technically speaking I can allow those through, but I'm trying to take myself out of the equation as I really don't think it's right for an individual developer to decide whether someone gets their money or not. This is why I'm very literal with the spec.
We can perhaps do a pull that changes the spec for Class A to allow multiple change addresses as follows:
An additional output is permitted for the remainder of the input (the 'change' address)
to
Multiple additional outputs are permitted for the remainder of the input (the 'change' addresses)
But before saying yay/nay to that I'd want to do some due diligence to see if that has any other impact I'm not seeing at first glance (ie like all of a sudden validating other past transactions that may previously have been seen as invalid and thus resent etc).
Thanks!
Isn't the transaction covered by "peek and decode"?
Potentially - peek and decode is there to avoid ambiguity following rules for sequence numbers (eg to prevent users who used MastercoinAdviser to send from having a random chance of a sequence number collision (6 in 255 if change amount = other output amounts)).
Considering the wording, it's open to interpretation I think. "Following the above rules" was intended to mean the rules covering sequence numbers and outputs being the same (ie the rules under "The following conditions must also be satisfied for the transaction to be considered decode-able:").
It wasn't intended to cover the general rules (eg stating an output to exodus is required and an output for change is permitted etc) as if we applied that last resort peek & decode statement to
all rules then technically even a Mastercoin transaction without an output to Exodus would be valid as long as it could be decoded via peek & decode.
But I do agree it's open to interpretation, so we should agree consensus between us all and I'll submit a pull to remove any ambiguity.
What do you guys think?
Thanks!
EDIT: TL:DR for an abundance of clarity as this won't be clear for those not familiar with the spec.
Long story short, peek and decode was not intended to allow the rules in the preceding paragraph to be optional. I do agree for the need for a clarification, whichever way we go however. Hope this helps make my particular perspective a bit clearer.
To allow multiple change outputs (still not ready to comment on whether we
should allow this) we would either:
a) Change the wording to state multiple change outputs are allowed as I mentioned a couple of posts back, or
b) Move the change output statement into the next paragraph where peek & decode is applicable
From the spec, I've highlighted in navy what my intention was with regard to the purple-highlighted text:
The transaction data is encoded into said fake Bitcoin address which is then used as an output in a single Bitcoin transaction satisfying the following requirements:
- Has a single or the largest input signed by the sending address
- Has an output for the recipient address (the 'reference' address)
- Has an output for the exodus address
- Has an output for the encoded fake address (the 'data' address)
- Has all output values equal & above the 'dust' threshold (currently 0.00005430 BTC)
- An additional output is permitted for the remainder of the input (the 'change' address)
The following conditions must also be satisfied for the transaction to be considered decode-able:
- The reference address sequence number must be the data address sequence number + 1
- Ideally, all outputs should be the same (except the change). In fringe cases where the change output value is equal to the other output values the change address can be identified by sequence number, which must not equal or be +/-1 of the sequence number for either the reference address or the data address
- 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). These byte checks are defined as:
- Bytes two to eight must equal 00
- Byte nine must equal 01 or 02
- Should there still be packet ambiguity or 'peek and decode' reveals more than one packet (simple sends are always one packet) the transaction is considered invalid.