I’m looking for a simple way to detect if any transaction is a Counterparty transaction or not.
From docs (http://counterparty.io/docs/protocol/) :
For identification purposes, every Counterparty transaction’s ‘data’ field is prefixed by the string ‘CNTRPRTY’, encoded in UTF‐8. This string is long enough that transactions with outputs containing pseudo‐random data cannot be mistaken for valid Counterparty transactions . In testing (i.e. using the TESTCOIN Counterparty network on any blockchain), this string is ‘XX’.
Counterparty data may be stored in three different types of outputs, or in some combinations of those formats. All of the data is obfuscated by ARC4 encryption using the public key of the first sender as the encryption key.
Multi‐signature data outputs are one‐of‐three outputs where the first public key is that of the sender, so that the value of the output is redeemable, and the second two public keys encode the data, zero‐padded and prefixed with a length byte.
The data may also be stored in OP_RETURN outputs or as fake pubkeyhashes.
so, if I understand it correct, the ‘data’ could be hidden anywhere inside a transaction, right?
{
“value”:“0.00007800”,
“scriptPubKey”:“1 0304827bc3d968efe82580dca4944f6079ee8f7da1a1a587541de3cbc4db924fc8 023f154c431a5fe2340930a9663f98274f615eaf8401737b68c7df123697f8b237 0284e6a0379c5ff2d66327a7f2cf754695a81a2b186821033ddf2ccd0e6de39d82 3 OP_CHECKMULTISIG”
},
Is this a ‘data’ output?
And where’s the "CNTRPRTY (1c434e545250525459) marker then?
Check out https://github.com/pinheadmz/Counterparty-Data-Decoder. (I haven't used it myself).
Edit: I'm not sure why there's no code in your transaction. Is that a Bitcoin send tx (i.e. a Counterwallet, but not a Counterparty tx)?
Thanks for your answer.
This is a Counterparty tx made from Counterwallet.