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
010000000238bfc4cb7a113965c5900bab47c6a173c0518ccccb781f4a9d2631eed331bec00200000001ffffffff6b18ccc85a89f295f0d0e2857c4e3c89dcc40a120f7cc8c9cdccbceb0d2701650200000001ffffffff02662e1cc10100000000001976a91440f707f4bfc8cf72ae85dd8421a5373620ea30be88acb4c7f9030100000000001976a914ef37b9b87c37b9c763139213f873bf96dcd143a588ac000000000000000002e34c8b6201000000f1480200030000006b483045022100951ad93886f803cde233124092cda96c72e5d495e11d6e9516489bce9f1ee2e402207201535ead0fb38ed204e8963eb3fc38a4b5b77e7cfb77319ffe56181697d600012102fe94d31a0113ca0912f66e3dfa692582813160f197beaadc759b1ad3a955ed36e34c8b6201000000ec480200030000006a473044022029b5ad475a04177676bdb5ac0936809f207c0659d30adbcfce8ff30c1cfbe1f50220379ec78c5256e3e82885649b05a492675d135543d957b41ff04962e822810538012103cb6e114550adeb99a9e32ce88608f301f66a60e018697dae4258e7534f1aae8a |