Giter Club home page Giter Club logo

Comments (5)

mhanne avatar mhanne commented on August 23, 2024

According to #8, the Node doesn't carry its network information around with it anymore. This way you can use the same key tree for multiple networks, and you decide which network you want when you ask it to encode the address.

node = MoneyTree::Node.from_bip32(master_node).node_for_path(node_path)
node.to_address(true, network: :bitcoin_testnet)

I think it's unfortunate that the network information encoded in the bip32 is just lost. Maybe it could be preserved and used as the default network for #to_address?

from money-tree.

thedoctor avatar thedoctor commented on August 23, 2024

@mhanne is correct – moneytree aims to be a currency-agnostic library.
Magic prefixes like xpub and tpub

  • don't scale well if there are arbitrarily many networks
  • can be misleading if you want to use one wallet for multiple currencies
  • and have no effect on the behavior of the actual HD wallet – only network-specific serialization which is subject to change

We find it better to use the path structure to indicate network per bip44 unless you're running in a constrained environment where the key derivation operation is very expensive (and if that's the case, why use ruby?) and to be explicit when (de)serializing.

from money-tree.

jvergeldedios avatar jvergeldedios commented on August 23, 2024

That's also why this was released as a minor version with a breaking change.

from money-tree.

davout avatar davout commented on August 23, 2024

Ok, I'll guess I'll stick with a sane version of the gem then.

It's still not very clear why such a breaking change was released as a minor version bump, because being backwards-compatible usually means "the same stuff will keep working", and not "you'll still be able to achieve similar functionality by doing things in different way" as it seems implied here.

from money-tree.

thedoctor avatar thedoctor commented on August 23, 2024

Per semver.org:

4. Major version zero (0.y.z) is for initial development. Anything may change at any time. The public API should not be considered stable.

We use minor versions to indicate breaking changes for all versions < 1.0.0 — sorry for your confusion.

from money-tree.

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.