This adds a new package under dcrutil named txsort which implements a standard lexicographical sort order of transaction inputs and outputs. This is useful to standardize transactions for faster multi-party agreement as well as preventing information leaks in a single-party use case. It is a modified form of BIP69 which has been updated to account for differences with Decred-specific transactions. The sort order for transaction inputs is defined as follows: - Previous transaction tree in ascending order - Previous transaction hash (treated as a big-endian uint256) lexicographically in ascending order - Previous output index in ascending order The sort order for transaction outputs is defined as follows: - Amount in ascending order - Public key script version in ascending order - Raw public key script bytes lexicographically in ascending order
1 line
762 B
Plaintext
1 line
762 B
Plaintext
01000000021cc18ddfbb9b9443cb99f47e42bd94a80565a4af55b61af74d6d947cd376a5b10000000001ffffffff6f26aa199ccc861398721ebef77df295177ab75f8525c30dc6a85dcd7f743fd80000000000ffffffff01c0131bc00000000000001976a914bda31b8a2ca698838a212093f14a92a7685824d788ac000000000000000002d0143cba00000000728b0100050000006b48304502210096c6a72dcd1624175db16edc90cd97d97b9aa1cc7a255385301212370a685899022008b15f7d0df7eccd6d0a53f0a05ace59864b34bc8c6b4e55e8ed4441b3290e4c012102a5a61606366ba5f99169f50253dadc906cd4efc5fe31f8fb09d0adeeafb5f6c83283e5050000000082890100070000006b48304502210081ede639fc933f4ca6845d8e063499684a170b2e1a1d12b90af7f21f03542b1802202e2ae968a0af6fdf5c05b3517d65f8344c32357888ce79e2f56bd4dd43985130012102a5a61606366ba5f99169f50253dadc906cd4efc5fe31f8fb09d0adeeafb5f6c8 |