# BIP32 HD Wallet and Vanity Address Generator

**URL:** <https://forum.zcashcommunity.com/t/bip32-hd-wallet-and-vanity-address-generator/3384>\
**Category:** Zcash Apps\
**Created:** [October 26, 2016, 9:42am UTC](https://forum.zcashcommunity.com/t/bip32-hd-wallet-and-vanity-address-generator/3384 "2016-10-26T09:42:01Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![funkyzebraz](https://avatars.discourse-cdn.com/v4/letter/f/ba9def/32.png) [@funkyzebraz](https://forum.zcashcommunity.com/u/funkyzebraz)\
**Post date:** [October 26, 2016, 9:42am UTC](https://forum.zcashcommunity.com/t/bip32-hd-wallet-and-vanity-address-generator/3384/1 "2016-10-26T09:42:01Z")

</div>

I’ve just committed the first version of a HD wallet generator.

It can generate mainnet and testnet addresses offline.

I suggest that you download and compile the code yourself before running it on a machine that is not connected to a network.

**Write down the passphrase carefully because if you lose it, you’ll lose all access to the addresses contained within. Similarly, anyone with your passphrase can access all of your addresses.**

> **[GitHub - blackkeyboard/zgenerate: Offline BIP32 wallet generator for Zcash](https://github.com/blackkeyboard/zgenerate)**
>
> Offline BIP32 wallet generator for Zcash. Contribute to blackkeyboard/zgenerate development by creating an account on GitHub.

Some testing has been done but please use caution!

If you find it useful, I’ll continue to add features. There is no support for Z addresses - I haven’t checked what’s involved in Z address generation yet.

Edit: I’ve added vanity address generation. After generating a passphrase, use zretrieve to search for an address that matches a regex. eg to search for an address starting with “t1jl”:

`zretrieve -passphrase="board start difference answer blossom roll powerful million rough butterfly bedroom beam" -match "^t1jl" -i`

---

<div class="post-metadata">

**Author:** ![funkyzebraz](https://avatars.discourse-cdn.com/v4/letter/f/ba9def/32.png) [@funkyzebraz](https://forum.zcashcommunity.com/u/funkyzebraz)\
**Post date:** [October 27, 2016, 1:49am UTC](https://forum.zcashcommunity.com/t/bip32-hd-wallet-and-vanity-address-generator/3384/2 "2016-10-27T01:49:07Z")

</div>

I’ve pushed a new version where you can specify the number of addresses to generate. Enjoy!

---

<div class="post-metadata">

**Author:** ![Solarius](https://avatars.discourse-cdn.com/v4/letter/s/7993a0/32.png) [@Solarius](https://forum.zcashcommunity.com/u/Solarius)\
**Post date:** [October 27, 2016, 11:35am UTC](https://forum.zcashcommunity.com/t/bip32-hd-wallet-and-vanity-address-generator/3384/3 "2016-10-27T11:35:22Z")

</div>

Thank you very very much funkyzebraz ! This solved my problem at: [Would pools like zcash.flypool.org continue automatically mining mainnet? - #2 by peter\_zcash](https://forum.zcashcommunity.com/t/would-pools-like-zcash-flypool-org-continue-automatically-mining-mainnet/3588/2)

---

<div class="post-metadata">

**Author:** ![recursive](https://avatars.discourse-cdn.com/v4/letter/r/f05b48/32.png) [@recursive](https://forum.zcashcommunity.com/u/recursive)\
**Post date:** [October 27, 2016, 2:37pm UTC](https://forum.zcashcommunity.com/t/bip32-hd-wallet-and-vanity-address-generator/3384/4 "2016-10-27T14:37:38Z")

</div>

I’m really confused about this addresses thing. If Zcash addresses don’t depend of trust setup parameters and can already be generated, why is it that current testnet addresses won’t be valid addresses in mainnet? Is the address scheme different between testnet and mainnet?

---

<div class="post-metadata">

**Author:** ![5thdimension](https://sea2.discourse-cdn.com/zcash/user_avatar/forum.zcashcommunity.com/5thdimension/32/778_2.png) [@5thdimension](https://forum.zcashcommunity.com/u/5thdimension)\
**Post date:** [October 27, 2016, 4:32pm UTC](https://forum.zcashcommunity.com/t/bip32-hd-wallet-and-vanity-address-generator/3384/5 "2016-10-27T16:32:36Z")

</div>

@recursive it does need but you see it wrong side base on your trust setup youll move your coin (publicly) but when you Z them ( shiled it) it mean its sorta decentralize ( im using slang for picturize it )

so the T adress is sorta your public and Z your master

---

<div class="post-metadata">

**Author:** ![str4d](https://sea2.discourse-cdn.com/zcash/user_avatar/forum.zcashcommunity.com/str4d/32/64_2.png) [@str4d](https://forum.zcashcommunity.com/u/str4d)\
**Post date:** [October 27, 2016, 6:14pm UTC](https://forum.zcashcommunity.com/t/bip32-hd-wallet-and-vanity-address-generator/3384/6 "2016-10-27T18:14:03Z")

</div>

A reminder that you should _not_ rely on the current BIP 32 prefixes, as they have not been specified and may change:

> <https://github.com/zcash/zcash/blob/master/src/chainparams.cpp#L108>

---

<div class="post-metadata">

**Author:** ![funkyzebraz](https://avatars.discourse-cdn.com/v4/letter/f/ba9def/32.png) [@funkyzebraz](https://forum.zcashcommunity.com/u/funkyzebraz)\
**Post date:** [October 27, 2016, 6:26pm UTC](https://forum.zcashcommunity.com/t/bip32-hd-wallet-and-vanity-address-generator/3384/7 "2016-10-27T18:26:54Z")

</div>

ACK - I don’t serialize to xpriv/xpub prefixes because of that. The generator derives m from the mnemonic each time.

Private keys to addresses derived from m/0’/0/0 are serialised in WIF using the PUBKEY\_ADDRESS network id to maintain compatibility with the importprivkey cli command.

---

<div class="post-metadata">

**Author:** ![chefbauer](https://avatars.discourse-cdn.com/v4/letter/c/ed8c4c/32.png) [@chefbauer](https://forum.zcashcommunity.com/u/chefbauer)\
**Post date:** [October 28, 2016, 8:03pm UTC](https://forum.zcashcommunity.com/t/bip32-hd-wallet-and-vanity-address-generator/3384/8 "2016-10-28T20:03:24Z")

</div>

hi funkyzebraz, i generated a address with your tool.

zgenerate  
2016/10/28 19:31:32 Wallet generated!  
got passphrase, address and privkey.

now i used this address to mine, now i wanted to import it with zcash-cli but:  
zcash-cli importprivkey PRIVKEY  
error: {“code”:-5,“message”:“Invalid private key encoding”}

zcashd is on mainnet.  
are my ZEC coins lost or do you have an idea?

EDIT: zcash-cli --version  
Zcash RPC client version v1.0.0

zcash-cli getinfo  
{  
“version” : 1000050,  
“protocolversion” : 170002,  
“walletversion” : 60000,  
“balance” : 0.00000000,  
“blocks” : 497,  
“timeoffset” : 0,  
“connections” : 1,  
“proxy” : “”,  
“difficulty” : 6737.07450381,  
“testnet” : false,  
“keypoololdest” : 1477681763,  
“keypoolsize” : 101,  
“paytxfee” : 0.00000000,  
“relayfee” : 0.00005000,  
“errors” : “”  
}

---

<div class="post-metadata">

**Author:** ![funkyzebraz](https://avatars.discourse-cdn.com/v4/letter/f/ba9def/32.png) [@funkyzebraz](https://forum.zcashcommunity.com/u/funkyzebraz)\
**Post date:** [October 28, 2016, 8:25pm UTC](https://forum.zcashcommunity.com/t/bip32-hd-wallet-and-vanity-address-generator/3384/9 "2016-10-28T20:25:46Z")

</div>

No coins have been lost.

I’ve just pushed a commit which fixes the output for the private key.

Update your code to the newest version

> go clean [GitHub - blackkeyboard/zgenerate: Offline BIP32 wallet generator for Zcash](http://github.com/blackkeyboard/zgenerate)  
> go install [GitHub - blackkeyboard/zgenerate: Offline BIP32 wallet generator for Zcash](http://github.com/blackkeyboard/zgenerate)  
> go install [github.com/blackkeyboard/zgenerate/zretrieve](http://github.com/blackkeyboard/zgenerate/zretrieve)

Run zretrieve with your passphrase:

> zretrieve -passphrase=xxxxx

Sorry about the scare!

---

<div class="post-metadata">

**Author:** ![5chdn](https://sea2.discourse-cdn.com/zcash/user_avatar/forum.zcashcommunity.com/5chdn/32/508_2.png) [@5chdn](https://forum.zcashcommunity.com/u/5chdn)\
**Post date:** [October 28, 2016, 8:32pm UTC](https://forum.zcashcommunity.com/t/bip32-hd-wallet-and-vanity-address-generator/3384/10 "2016-10-28T20:32:21Z")

</div>

There is no zretrieve repository.

---

<div class="post-metadata">

**Author:** ![funkyzebraz](https://avatars.discourse-cdn.com/v4/letter/f/ba9def/32.png) [@funkyzebraz](https://forum.zcashcommunity.com/u/funkyzebraz)\
**Post date:** [October 28, 2016, 8:33pm UTC](https://forum.zcashcommunity.com/t/bip32-hd-wallet-and-vanity-address-generator/3384/11 "2016-10-28T20:33:30Z")

</div>

> [@5chdn](#):
>
> There is no zretrieve repository.

Just edited my post

`go install github.com/blackkeyboard/zgenerate/zretrieve`

---

<div class="post-metadata">

**Author:** ![5chdn](https://sea2.discourse-cdn.com/zcash/user_avatar/forum.zcashcommunity.com/5chdn/32/508_2.png) [@5chdn](https://forum.zcashcommunity.com/u/5chdn)\
**Post date:** [October 28, 2016, 8:39pm UTC](https://forum.zcashcommunity.com/t/bip32-hd-wallet-and-vanity-address-generator/3384/12 "2016-10-28T20:39:14Z")

</div>

gotcha, thanks \<3

great tool. mis-used it to create a vanity address 😉

> <https://bitcoin.stackexchange.com/questions/49288/how-to-generate-a-zcash-vanity-address/49289#49289>

---

<div class="post-metadata">

**Author:** ![chefbauer](https://avatars.discourse-cdn.com/v4/letter/c/ed8c4c/32.png) [@chefbauer](https://forum.zcashcommunity.com/u/chefbauer)\
**Post date:** [October 28, 2016, 8:39pm UTC](https://forum.zcashcommunity.com/t/bip32-hd-wallet-and-vanity-address-generator/3384/13 "2016-10-28T20:39:16Z")

</div>

thank you for help, but this command gets me exactly the same private key with same error.  
but now i have some hope 🙂

maybe because i get the same with -test and without test?  
i hope i have not generated a test address  
EDIT: forget, with -test the Address is different, only privkey is the same

---

<div class="post-metadata">

**Author:** ![5chdn](https://sea2.discourse-cdn.com/zcash/user_avatar/forum.zcashcommunity.com/5chdn/32/508_2.png) [@5chdn](https://forum.zcashcommunity.com/u/5chdn)\
**Post date:** [October 28, 2016, 8:42pm UTC](https://forum.zcashcommunity.com/t/bip32-hd-wallet-and-vanity-address-generator/3384/14 "2016-10-28T20:42:43Z")

</div>

you have to clean first.

> [@funkyzebraz](#):
>
> go clean [GitHub - blackkeyboard/zgenerate: Offline BIP32 wallet generator for Zcash](http://github.com/blackkeyboard/zgenerate)

works for me now. (priv keys start with L/K)

---

<div class="post-metadata">

**Author:** ![funkyzebraz](https://avatars.discourse-cdn.com/v4/letter/f/ba9def/32.png) [@funkyzebraz](https://forum.zcashcommunity.com/u/funkyzebraz)\
**Post date:** [October 28, 2016, 8:44pm UTC](https://forum.zcashcommunity.com/t/bip32-hd-wallet-and-vanity-address-generator/3384/15 "2016-10-28T20:44:00Z")

</div>

> [@5chdn](#):
>
> great tool. mis-used it to create a vanity address 😉

Nice one 🙂

I’ll clean up the parameterization and I might look at adding a vanity generator option. What do you reckon?

---

<div class="post-metadata">

**Author:** ![chefbauer](https://avatars.discourse-cdn.com/v4/letter/c/ed8c4c/32.png) [@chefbauer](https://forum.zcashcommunity.com/u/chefbauer)\
**Post date:** [October 28, 2016, 8:46pm UTC](https://forum.zcashcommunity.com/t/bip32-hd-wallet-and-vanity-address-generator/3384/16 "2016-10-28T20:46:25Z")

</div>

id did but there was another problem with go.  
WORKS NOW, thank you 🙂

please send me a zcash address, i will send you a little!

---

<div class="post-metadata">

**Author:** ![funkyzebraz](https://avatars.discourse-cdn.com/v4/letter/f/ba9def/32.png) [@funkyzebraz](https://forum.zcashcommunity.com/u/funkyzebraz)\
**Post date:** [October 28, 2016, 9:06pm UTC](https://forum.zcashcommunity.com/t/bip32-hd-wallet-and-vanity-address-generator/3384/17 "2016-10-28T21:06:48Z")

</div>

Not sure if you meant 5chdn or myself but anyway

t1Vq8SUDmrJAeiVphnkEzk7RykRqdKQSMPL

🙂

---

<div class="post-metadata">

**Author:** ![5chdn](https://sea2.discourse-cdn.com/zcash/user_avatar/forum.zcashcommunity.com/5chdn/32/508_2.png) [@5chdn](https://forum.zcashcommunity.com/u/5chdn)\
**Post date:** [October 28, 2016, 9:15pm UTC](https://forum.zcashcommunity.com/t/bip32-hd-wallet-and-vanity-address-generator/3384/18 "2016-10-28T21:15:02Z")

</div>

no, he clearly does mean you, funkyzebras.

re: vanity. I was looking for a tool which generates an address which includes my nick. I was generating 5GB of keypairs until I found t1-QogAodMtoAheVkqtTg3nNCRHxSB- **5chdn** -t 🙂

But if you do not have to write the results to disk, it should be way faster.

---

<div class="post-metadata">

**Author:** ![funkyzebraz](https://avatars.discourse-cdn.com/v4/letter/f/ba9def/32.png) [@funkyzebraz](https://forum.zcashcommunity.com/u/funkyzebraz)\
**Post date:** [October 28, 2016, 11:01pm UTC](https://forum.zcashcommunity.com/t/bip32-hd-wallet-and-vanity-address-generator/3384/19 "2016-10-28T23:01:19Z")

</div>

I’ve pushed a new version which properly parameterizes the network

---

<div class="post-metadata">

**Author:** ![funkyzebraz](https://avatars.discourse-cdn.com/v4/letter/f/ba9def/32.png) [@funkyzebraz](https://forum.zcashcommunity.com/u/funkyzebraz)\
**Post date:** [October 28, 2016, 11:19pm UTC](https://forum.zcashcommunity.com/t/bip32-hd-wallet-and-vanity-address-generator/3384/20 "2016-10-28T23:19:27Z")

</div>

> [@chefbauer](#):
>
> please send me a zcash address, i will send you a little!

Thank you chefbauer!

[Next page](https://forum.zcashcommunity.com/t/bip32-hd-wallet-and-vanity-address-generator/3384.md?page=2)
