1

Suppose I generate a transaction with 5 outputs.

Is there a deterministic way to know how the outputs will be ordered on chain (their .n values) or will they simply appear in the order in which I arranged them when created my rawTxn that I signed?

4

If you create a raw transaction yourself, then that is the raw transaction. Whatever you put in it is exactly what the transaction will be, in the same order.

There are some conventions around output ordering. Some software will randomly permute the outputs; other software uses BIP69 which specifies a deterministic ordering. There is however no requirement to follow either rule.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.