Is it possible to set TxType to an arbitrary value other than "pay" when posting a transaction?

When posting transactions that update the notes field only, it would be nice to have TxType set to a custom value other than “pay.” For example, if using the notes field for a token, if TxType was set to the token name, it would be easier to create automation that can find all transactions for the a given token. Currently finding token transfers involves decoding the base64 notes field for every transaction.

1 Like

The TxType affects core validation logic, and can either be a payment or a keyreg transaction. If we validated one of these transactions against the wrong txtype we might have duplicate money in the system or somehow affect sortition/consensus/cause-a-fork. These are the core Algorand functionalities.

The functionality you describe is not validation critical at the protocol-layer.

I believe the notes field is the only field that you are free to set right now, without worrying too much about the validity of the transaction. bytes are generic and you can encode/decode into it however you want. I can see why we want additional lubricant for manipulating the notes field (or a generic state) and that is certainly in the pipeline. However, I don’t think we should add another arbitrary txLayer2Type field without designing a bigger picture around interacting with the blockchain (barring a very obvious need).