The cashtokens proposal was humongous in size and a new signing method slipped in without much discussion. I’m thinking most people assumed someone else vetted the idea. The dreadful “someone”
The tech:
SIGHASH_UTXOS does not in actual fact add any data hashed that wasn’t hashed before.
It adds all prev-outs (the transaction outputs collectively being spend in this tx) as a whole, but this is not extra information since signing with SignAllInputs (default) includes the txid’s of the previous transactions. A txid is a hash of the entire transaction, so it’s already there.
So this is not “more secure” in any cryptographic sense. The exact same amount of content is covered by the signature with or without this sighash.
As the proposal also states, this new signing method is about covering a certain type of wallets. Hints are made towards hardware wallets. Not sure why, the proposal doesn’t go into details.
Specifically, the proposal concedes, there is no benefit at all to this sighash type for wallets that have full information. Where ‘full information’ means the previous-transactions (being spent).
So, what is the entire point, you may ask?
Well, since introspection opcodes got introduced, what other inputs get funded with may be relevant to your script too. Signing input 1 you would want to check for correctness what that other guy is doing on input 2 and output 2. And that implies you need to have the full script (including token data) that is being spent in input 2. Can’t verify that otherwise.
The simple solution to that is you request that transaction from the party that signed input 2. They have it in their wallet, so they can share it with you. And since the input 2 includes the txid, you can trivially hash the transaction you received to verify they gave you the real info.
So, the entire point seems to be to avoid sending a full transaction but instead allow them to only send you a smaller amount of bytes (the utxo).
Downsides:
The SIGHASH_UTXOS is clearly trying to solve a problem that can be solved in multiple ways by end-user wallets. Case in point: if your payment protocol can send all utxos, your payment protocol can send a full transaction or two. It is merely a matter of more bytes. And designing your wallets well.
So, the main downside is that a tiny tiny percentage of unnamed wallets forced this new feature that the entire ecosystem has to care about.
The second downside is that those transactions stand out like a sore-thumb on the blockchain. (nobody uses this). This makes anonimity worse for them.
A 3rd downside is that dsproof does not work for them.
A 4th downside is that if introspection is unlikely to care about more than one or two other input/output pairs. Fetching the full transaction for those you care about scales to need. This signing method on the other hand forces you to fetch ALL utxo’s the transaction spends. This is almost always more of them, most of which you don’t care about.
Let’s deprecate this and make people build proper wallets instead.
The entire idea is based on the premise that some wallets are not capable of fetching the full transaction data from prev-outs they care about.
On top of that, this is only relevant for wallets that are used to build transactions in cooperation with multiple-parties (no need to distrust yourself).
On top of that, this is only relevant for transactions where you’d lose money if someone else lies. (coinjoin doesn’t have this problem, for instance).
I don’t think it makes sense to just blindly believe this is a relevant problem that actually exists. Backed up by only hand-waving statements on who would hit this issue. I mean, writing “hardware wallets” is just insulting our collective intelligence, that is simply not how they work. And, btw, if your internet-facing app is utterly compromised then this scheme doesn’t help you either. And, also, that internet facing part can just download the full transactions to feed the hardware.
I’d say we should make this transaction-type non-standard and give out the message to not use this as it has a lot of downsides.
And we really should be better at splitting massive CHIPs into smaller ones and avoiding the crap being enabled where it can never be removed.