Git Product home page Git Product logo

Comments (6)

TheBlueMatt avatar TheBlueMatt commented on August 18, 2024 1

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.

from rust-lightning.

savil avatar savil commented on August 18, 2024

cc @TheBlueMatt tagging you in case you didn't get a notification about this issue, and questions I had.

from rust-lightning.

TheBlueMatt avatar TheBlueMatt commented on August 18, 2024

Honestly probably best to rewrite BOLT 3 to not reference BIP 69 since the BIP is underspecified and just write what is intended there.

from rust-lightning.

savil avatar savil commented on August 18, 2024

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.

from rust-lightning.

TheBlueMatt avatar TheBlueMatt commented on August 18, 2024

from rust-lightning.

savil avatar savil commented on August 18, 2024

fixed in #84 and #95

from rust-lightning.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.