Bitcoin shower thought:

It's a failure of bitcoin's model that sighashing serializes inputs and outputs in a particular order.

The ordering of inputs and outputs has no meaning (which is why we have, in the past, had rather tedious discussions about BIP69 or random ordering, for coinjoins) to the actual effect of A pays B.

So the sighashing (the process by which we define what exact chunk of data must be signed to validate the tx) shouldn't need to know about the ordering.

Left as an exercise to the reader: how can we encode the full set of information about the tx into a string of bytes (i.e. sighashing) in such a way that it's the same, no matter the order of inputs and outputs.

Reply to this note

Please Login to reply.

Discussion

How about alphabetizing the inputs and outputs?

i think that dtill counts as ordering.

It does, but there is information in the ordering that wasn’t already there

Is no*

🤔🤔🤔

I mean...you can use some kind of algo to add all the tx data together and then hash it ?

Would like XOR ing it all together before hashing work ?

Make the consensus algorithm consistently sort them first.

Could you hash rhe inputs one by one and xor the hashes? Same for outputs?