Giter Club home page Giter Club logo

Comments (8)

rbndg avatar rbndg commented on July 1, 2024 1

I believe it's implying that you should set the output.address to the wallet address you want to get the change for.

from coinselect.

dcousens avatar dcousens commented on July 1, 2024 1

I'll update this example to be more complete in future; and will use the new bip32 module.

Traditionally, getChangeAddress will simply be a wrapper around

bip32.fromSeed(seed).derivePath(`m/0'/1'/${k}`).getAddress()

or some other path, where k is the offset into that account, and k should increment by 1 for each output.address.

from coinselect.

dcousens avatar dcousens commented on July 1, 2024 1

@rbndg you can do whatever you like.
I can only recommend that you keep backups of any private keys you generate 😝 - but even then, up to you!

from coinselect.

j3ko avatar j3ko commented on July 1, 2024

Thanks for the quick reply @dcousens, If I can ask for a bit more help. I've been trying to implement this, it looks like bip32.fromSeed() is so new, it hasn't made it into any bip32 releases?

I tried adding the package directly from master but it looks like master is also missing a file: let ecc = require('./ecc').

It might be too bleeding edge for my purposes, how was this accomplished before the new bip32 module?

from coinselect.

dcousens avatar dcousens commented on July 1, 2024

Apologies, yes that module is not ready yet, but it will be where you want to look in about a months time.

For now, see
https://github.com/bitcoinjs/bitcoinjs-lib/blob/master/src/hdnode.js#L31

bitcoinjs.HDNode.fromSeedBuffer(seed).derivePath(`m/0'/1'/${k}`).getAddress()

from coinselect.

rbndg avatar rbndg commented on July 1, 2024

@dcousens is it incorrect to set any bitcoin address as the changeAddress or do we have to use deterministic wallet?

from coinselect.

rbndg avatar rbndg commented on July 1, 2024

Yeah, dealing with deterministic wallets seeds is much better 😊

from coinselect.

j3ko avatar j3ko commented on July 1, 2024

thanks @rbndg works like a charm! 😁

from coinselect.

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.