A command-line tool that derives bip32 addresses and private keys.
This release works with php 8 and above. Older versions of PHP are untested and probably will not work.
This release fixes the Bip32 path preset for LedgerLive.
It's been a while. This release adds:
Only minor changes in this release:
This release adds support for bitcoin-core style key derivation with these two features:
Read the details.
This is a big release. The major new things are:
At this moment, I believe this tool will generate keys/addresses for more blockchains (including testnets, regtest) than any other tool on the planet.
See the readme for details and examples of using segwit keys.
This release adds back support for ethereum addresses. Presently only ethereum mainnet is supported.
example key generation
$ ./hd-wallet-derive.php --coin=ETH --gen-key --format=jsonpretty -g
[
{
"coin": "ETH",
"seed": "dc0396ada2c3e1ce6995820716cf6fea22d54a8b8191cab61fb7540ecf0c3a42fb91a0f68b7ac0ed7555dd3bda05ec2b769491a68f63082f8d4723ce2f085078",
"mnemonic": "athlete alone tent cherry motor able gym lobster mad ahead peanut anger congress segment horn hidden crater host thumb audit sugar casino produce garment tag rose planet law gather human drop analyst tank cabbage casino hybrid fun science wheel bring insect helmet million guide survey grace save top",
"master_priv_key": "xprv9s21ZrQH143K4DQeGofUmKVrfUJi85d6PrnXY9xVerzRha15g4eoXYgvi3RvmwftTUkCvXmU91g35KrYjmTTjLBg2EraDW7EsNPDhgdCzqL",
"path": "m\/44'\/60'\/0'\/0",
"ext_priv_key": "xprvA18QLJYVPaGy4Zyt3zjk41s6heKWAQ4PiTWb4bP16pon5WZMyRv75ggpoYteB8dv9UP9yXWdAG9cQpudfQ4Fcr73AViDMJh4XdXm95fq5ap",
"ext_pub_key": "xpub6E7kjp5PDwqGH44MA2GkR9oqFg9zZrnF5gSBryncfALkxJtWWyEMdV1Jer41xHqX6Afkb8EcwR2aF2H1UCUfgEctYwGbKsLz5FtZJyYvpsJ"
}
]
Example derivation using nmemonic
$ ./hd-wallet-derive.php --coin=ETH --mnemonic="athlete alone tent cherry motor able gym lobster mad ahead peanut anger congress segment horn hidden crater host thumb audit sugar casino produce garment tag rose planet law gather human drop analyst tank cabbage casino hybrid fun science wheel bring insect helmet million guide survey grace save top" --cols=path,address --numderive=3 -g
+------------------+--------------------------------------------+
| path | address |
+------------------+--------------------------------------------+
| m/44'/60'/0'/0/0 | 0x92C4210c2fbC3237efb8a93611d0E61c3936E84b |
| m/44'/60'/0'/0/1 | 0x4b7A3CFc314D92447a8F2Ebe3F7b93D469bC195b |
| m/44'/60'/0'/0/2 | 0x1702ebaA4cD9AD453ea45569e27B877338d48862 |
+------------------+--------------------------------------------+
Example derivation using xprv
./hd-wallet-derive.php --coin=ETH --key=xprvA18QLJYVPaGy4Zyt3zjk41s6heKWAQ4PiTWb4bP16pon5WZMyRv75ggpoYteB8dv9UP9yXWdAG9cQpudfQ4Fcr73AViDMJh4XdXm95fq5ap --cols=path,address --numderive=3 -g
+------+--------------------------------------------+
| path | address |
+------+--------------------------------------------+
| m/0 | 0x92C4210c2fbC3237efb8a93611d0E61c3936E84b |
| m/1 | 0x4b7A3CFc314D92447a8F2Ebe3F7b93D469bC195b |
| m/2 | 0x1702ebaA4cD9AD453ea45569e27B877338d48862 |
+------+--------------------------------------------+```
Changes in this release:
Example of using the new --gen-key flag:
$ ./hd-wallet-derive.php --coin=DOGE --gen-key --format=jsonpretty -g
[
{
"coin": "DOGE",
"seed": "a3adc3e71ac05b3336422e6506d646e995f7bfcb960e6fca48dc13c93fae8ef3dc37a6013791ad1cfe7fe408de0e7676a9fe29b02413c79b988d54c74515d3db",
"mnemonic": "arch hover pen regret priority sugar thunder glimpse west diagram path sword divide spread anger vendor century roof agree know treat drastic allow blind advance oil iron gold skate absorb stem shiver can pear twin helmet loan satisfy fragile admit comfort mercy pelican pupil debate tornado rifle desert",
"master_priv_key": "dgpv51eADS3spNJh8eoSPqujdFPAhBZywAW6KQrR5TqM1Q5NMsrJmFP1hTXvfbUHLQFLmh4jVYZjXtJvKJVakn5YxT48mocEXu7yTNkCYN29cMV",
"path": "m\/44'\/3'\/0'\/0",
"ext_priv_key": "dgpv59SfnUBjPvKLfM453bkxJXHRfNvDQ3zAngt3fpKheqR846z9W1QYzoUz5ss4qtvLU7iBd93nw8ZXcXArpdLjuyudR2uUFH4KeV9Nes8eNeJ",
"ext_pub_key": "dgub8tKh8A7cx4yfxCiE5qNvRNq27wHrEB1t5HfFpvigSxU8cA6qumxKe6tdf7TkUPFBoj6C8eBxofiydXy5hGf471zWZkYiy4tQ6vWqRwETdGA"
}
Example of using --bch-format flag:
./hd-wallet-derive.php --coin=BCH --bch-format=cash --key=xpub6EJnEgHvi29eVL5tsJvBJjLamiCa8tGmH3Jog3XjgF4GsVpyJ7ZV1EwEnekpFEspXup5mkcyMB9saEr9h1HXtVCBA6J5arX4wDLkPpG5Vm9 --numderive=3 --cols=path,address -g
+------+--------------------------------------------------------+
| path | address |
+------+--------------------------------------------------------+
| m/0 | bitcoincash:qrld9tflxwdsm6qzzrkclh7v0j84cutjdgqq9xzy5d |
| m/1 | bitcoincash:qq3flt3ketuw0euvmpkt4hqm06x6ec0585qqs3g4zy |
| m/2 | bitcoincash:qz7lskgn36kfdl93frra5aaznsfcahf5lyqqsmvsw2 |
+------+--------------------------------------------------------+
$ ./hd-wallet-derive.php --coin=BCH --bch-format=legacy --key=xpub6EJnEgHvi29eVL5tsJvBJjLamiCa8tGmH3Jog3XjgF4GsVpyJ7ZV1EwEnekpFEspXup5mkcyMB9saEr9h1HXtVCBA6J5arX4wDLkPpG5Vm9 --numderive=3 --cols=path,address -g
+------+------------------------------------+
| path | address |
+------+------------------------------------+
| m/0 | 1QEP1oWNm4cUhJqXCT1SgSfvNNVucyGTYu |
| m/1 | 14A5GKXrbQkJSDjGE3SvjhPjsq2g1m4Q3B |
| m/2 | 1JKUDmuus32bGnXp3DxfJBDBzecMv8mQfd |
+------+------------------------------------+
note that 'cash' is the default for --bch-format.
This release adds support for deriving addresses of hundreds of altcoins with the new --coin and --helpcoins flags. Data for the altcoins comes from coinparams.
Unfortunately ethereum support is temporarily dropped in this release until it can be refactored to fit the new multi-coin model.
Thanks go to @tboydston for the initial multicoin implementation.
This release adds support for deriving Ethereum addresses.
Thanks go to @dukei for the Eth implementation.