Skip to content

hd-wallet-derive-v0.3.1

Compare
Choose a tag to compare
@dan-da dan-da released this 04 Jul 14:32
· 100 commits to master since this release

Changes in this release:

  • Add --gen-key flag to generate a new master key, mnemonic, seed, and extended keys for any supported cryptocurrency.
  • default --path to use bip44 path for --coin when --mnemonic is specified.
  • fixed display of BitcoinCash addresses and added --bch-format flag. Supported formats are "cash" or "legacy".
  • fix issue 1. avoid null param exception in Bip39SeedGenerator::getSeed() when password is omitted

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.