Skip to content
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

Generate all addresses from a HEX key? #628

Open
zilveer opened this issue Dec 15, 2022 · 2 comments
Open

Generate all addresses from a HEX key? #628

zilveer opened this issue Dec 15, 2022 · 2 comments

Comments

@zilveer
Copy link

zilveer commented Dec 15, 2022

Hi,
first of all thanks for such a great script, I love it truly!

I wonder if it is possible through the functions you use in this script to actually generate all the addresses belonging to a HEX key (depending of the choosen coin of course).
For i.e the HEX key 0000000000000000000000000000000000000000000000000000000000000001 would give us the following addresses:

P2PKH Compressed: 1BgGZ9tcN4rm9KBzDn7KprQz87SZ26SAMH
BECH32: bc1qw508d6qejxtdg4y5r3zarvary0c5xw7kv8f3t4
P2SH: 3JvL6Ymt8MVWiCNHC7oWU6nLeHNJKLZGLN
P2PKH Uncompressed: 1EHNa6Q4Jz2uvNExL497mE43ikXhwF6kZm

What functions can I use to achieve this?
All kind of help is appreciated.

regards Zilveer

@zilveer
Copy link
Author

zilveer commented Dec 19, 2022

Hi,
so I started with this just to be able to generate an address from a HEX key:

var privateKey = libs.buffer.Buffer.from('0000000000000000000000000000000000000000000000000000000000000001', "hex");
var wifFromPrivKey = libs.bitcoin.ECPair(privateKey, null, {network: libs.bitcoin.networks.bitcoin, compressed: true}).toWif();
var test = libs.bitcoin.ECPair.fromWIF(wifFromPrivKey, libs.bitcoin.networks.bitcoin);

but I am getting error:
Uncaught TypeError: d.signum is not a function

What am I doing wrong? I am trying to follow this example:.

regards Zilveer

@zilveer
Copy link
Author

zilveer commented Apr 16, 2023

Can someone please guide me here ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant