BIP32 HD Wallet and Vanity Address Generator

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.

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


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

Thank you very very much funkyzebraz ! This solved my problem at: Would pools like continue automatically mining mainnet? - #2 by peter_zcash

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?

@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

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

1 Like

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.

hi funkyzebraz, i generated a address with your tool.

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” : “”

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
go install GitHub - blackkeyboard/zgenerate: Offline BIP32 wallet generator for Zcash
go install

Run zretrieve with your passphrase:

zretrieve -passphrase=xxxxx

Sorry about the scare!

There is no zretrieve repository.

Just edited my post

go install

gotcha, thanks <3

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

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

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

you have to clean first.

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

Nice one :slight_smile:

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

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

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

Not sure if you meant 5chdn or myself but anyway



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 :slight_smile:

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

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

Thank you chefbauer!