mastercoin-MSC / mastercore

mastercore info
mastercoin.org
MIT License
24 stars 11 forks source link

Possible confusion with revokes when reference address exists. #279

Closed achamely closed 9 years ago

achamely commented 9 years ago

Discovered during grant/revoke/tx70 testing (Testing output available https://docs.google.com/a/mastercoin.org/spreadsheets/d/1_DZ_sO2q9y2E5xmkVrqs2gkMjPER-awf7xV2tDt4U84/edit#gid=0)

When creating a revoke (tx56) it is possible to specify a reference address. Instead of invalidating the tx (for trying to revoke property assets the user can not) core instead recognizes the reference address, ignores it , and revokes the assets (if exist) from the users own balance.

parseTransaction(block=321806, 2015-02-02 22:55:58 idx= 50); txid: 612ef7c782431103463f90df57afdaca787b9481c4224c19b4937beec6c2733b version: 0, Class B type: 56 (Revoke Property Tokens) property: 45 (SP token: 45) value: 10 update_tally_map(n1NZHR8pmp1mQWKxJ7LvgDqLkwT4P6cept, 45=0x2D, -10, ttype=0); before=170, after=160 Updated LevelDB with SP data successfully BLOCK: 321806 =txid: 612ef7c782431103463f90df57afdaca787b9481c4224c19b4937beec6c2733b =fee: 0.00004501 sender: n1NZHR8pmp1mQWKxJ7LvgDqLkwT4P6cept ; receiver: mfmGJgiyX2W43ykhZzP2DgA782L9vKRGeC pkt: 000000380000002d000000000000000a4f776e6572204372656174650000 recordTX(612ef7c782431103463f90df57afdaca787b9481c4224c19b4937beec6c2733b, valid=YES, block= 321806, type= 56, value= 10) AddToWallet 2b003368569b7377f090233407f6e60c402bde0aabc0b6b5680af7b4c53b0d6f

dexX7 commented 9 years ago

The log does not necessarily reflect what's happening: the parsing, and in this case the line stating a "receiver", actually happens before the "interpretation" of data packets - it's also dumped, if the transaction doesn't use a reference at all.

Other outputs in a transaction, whether it's junk or something that looks like a reference address, are allowed and simply ignored. It should not be possible to revoke or grant tokens of "another" address, other than the one "managing" the property.

If you publish a story (e.g. A created managed property, then does this, than that), I could craft a spock test to verify results.

zathras-crypto commented 9 years ago

As per discussion on Skype. [8:24:26 AM] zathrasc: that's kind of normal behaviour [8:24:36 AM] zathrasc: any transaction can have a reference address, because a ref address is simply a BTC output in the TX [8:24:54 AM] Adam Chamely: truth [8:25:06 AM] zathrasc: so revokes, sell offers, metadex trades, sto's and so on all don't use reference addresses [8:25:44 AM] zathrasc: FYI we 'identify' a reference address for every transaction, but we only use it for transactions where it's required (as it's assumed to be wrong eg a change address or something in transactions where it's not required)

achamely commented 9 years ago

resolved via skype chat.