-
Notifications
You must be signed in to change notification settings - Fork 378
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cleanup TODOs in transaction_utils.rs #66
Comments
cc @TheBlueMatt tagging you in case you didn't get a notification about this issue, and questions I had. |
Its already been moved to utils/made a standable function (it was previously in Channel), but it may need a second function to sort inputs (I think most uses are only one input, but maybe I'm wrong). As for the sort order, it should match https://github.com/lightningnetwork/lightning-rfc/blob/master/03-transactions.md#transaction-input-and-output-ordering which appears to not reference length and only sort based on the data itself, but BIP 69 is underspecified so its unclear. |
Honestly probably best to rewrite BOLT 3 to not reference BIP 69 since the BIP is underspecified and just write what is intended there. |
ah, cool, should've checked the BOLTs. It says "the respective output scriptPubKeys (as a byte-array) will be compared lexicographically, in ascending order". Looking at the btcd implementation (https://git.io/fNCx8), they use I'm not convinced its better for BOLT 3 to have its own spec of tx ordering. Then, the bitcoin ecosystem will have to deal with both BIP 69 and the BOLT3 versions, which could diverge over time. Feels better to add clarity to BIP69. At the least, provide a test-case where tx.amount are equal but the tx.scriptPubKeys are different. |
Generally, BIP69 is a bad idea. In any case where it's possible, input/output ordering should be randomized, not deterministic. Lightning can't do that, so needs something specified, but BIP 69 isn't clear, so just working around it seems fine to me.
…On July 20, 2018 7:22:32 PM UTC, savil ***@***.***> wrote:
ah, cool, should've checked the BOLTs. It says "the respective output
scriptPubKeys (as a byte-array) will be compared lexicographically, in
ascending order". Looking at the btcd implementation
(https://git.io/fNCx8), they use `Bytes.compare`, and I can find the
rust-equivalent of that for now.
I'm not convinced its better for BOLT 3 to have its own spec of tx
ordering. Then, the bitcoin ecosystem will have to deal with both BIP
69 and the BOLT3 versions, which could diverge over time. Feels better
to add clarity to BIP69. At the least, provide a test-case where
tx.amount are equal but the tx.scriptPubKeys are different.
--
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub:
#66 (comment)
|
…0.110 Update to LDK v0.0.110
I was looking into doing this as an easy starter task, but had some questions. https://github.com/rust-bitcoin/rust-lightning/blob/master/src/util/transaction_utils.rs
transaction_utils::sort_outputs
. Is there anything else to do (except implementsort_inputs
)?The text was updated successfully, but these errors were encountered: