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
832 B
Plaintext
1 line
832 B
Plaintext
010000000238640cf5a9145a6f500b46873aa9fd3a2dac848073c3ed54cdd7601a218311150000000000ffffffff38640cf5a9145a6f500b46873aa9fd3a2dac848073c3ed54cdd7601a218311150100000000ffffffff02614e310c0200000000001976a9142a2477b99d373bdacced385296aac3e460dcbe0488ac32c3d9360000000000001976a9142bfb1fb15fe42c05e6b6ebbb131c2f22ece400d988ac000000000000000002461cfd0402000000ef860100030000006a47304402203d35b91c1d3cba46ae309fe1ca587626a4b67ba18b23290f984f8387fb966cc60220599491381753aa037707f34f92bbbdcb0078ebf91afc48d5740210fe3c5c661a0121031c1bf96ee8411bf9c161b75d85f28c1477a614a329b98644f1b9557b6d1700a3055a143e00000000ef860100030000006b483045022100cc3933d9e353540c8f1408a113f98b0a33477503ec194e29b84b75f8c9c40f3902201b9c525f1dd0563d0264bbf732adba7b130baa603117ad90ce9d49a2652dd0ea012102eaa596fb5894c2860867fa97445e6be68a79f978f3060d2ae70d59b184de1e29 |