Comments (8)
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.
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.
@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.
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.
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.
@dcousens is it incorrect to set any bitcoin address as the changeAddress or do we have to use deterministic wallet?
from coinselect.
Yeah, dealing with deterministic wallets seeds is much better π
from coinselect.
thanks @rbndg works like a charm! π
from coinselect.
Related Issues (20)
- TransactionBuilder is now deprecated HOT 5
- No inputs or outputs generated HOT 6
- Consider Output Address Types HOT 5
- Proposal For Segwit Update PR HOT 5
- PR #49 + npm HOT 1
- What is the best way to handle user selection of virtual bytes in coinselect? HOT 1
- BIP 125 selection for replacement HOT 2
- No solution found if many inputs HOT 3
- Can the coinSelect recognize that my utxos are from segwit? HOT 1
- inputs and outputs returning unidefined when pending balance HOT 5
- CoinSelect using multiple small UTXOs instead of one big HOT 3
- Segwit workaround safe to use? HOT 2
- "coinselect" always expose the largest UTXO no matter how small the payment is because it sorts by descending value. HOT 5
- Inputs nor outputs are returned when a certain condition is met HOT 4
- type error in typescript project HOT 1
- Is this project dead? HOT 1
- Check out trezor/trezor-suite/packages/utxo-lib/src/coinselect for any ideas HOT 1
- Module cannot be found , npm I βdev-save @types/coinselect HOT 2
- Reevaluating 'Dust' Considerations When Adding Change in Transactions HOT 5
- Library breaks with float feeRate
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from coinselect.