Is it possible to generate a main net address already?

That’s not entirely true. The addresses can exist without the network as they are just a cryptographic keypair.

Just checking the chain params. zcash/chainparams.cpp at master · zcash/zcash · GitHub

It looks like t-type addresses start with t1, and multisig with t3.

// guarantees the first 2 characters, when base58 encoded, are "t1"
base58Prefixes[PUBKEY_ADDRESS]     = {0x1C,0xB8};
// guarantees the first 2 characters, when base58 encoded, are "t3"
base58Prefixes[SCRIPT_ADDRESS]     = {0x1C,0xBD};

But how to generate them? Never seen dual prefixes berfore.

By that logic, everyone’s t-addresses should disappear every time the testnet is reset.

Just succeeded to generate t1 address with vanitygen, but I can not yet verify this is correct.

$ ./vanitygen -X 126 t1
Difficulty: 23
Pattern: t1                                                                    
Address: t1KptYDZcZfCsiZJMVoyv6FDUKmMQYqCmU
Privkey: 9Xb...

I’m almost certain you’ve taken a fatal shortcut there…

Check out p24 of this pdf - zips/protocol.pdf at main · zcash/zips · GitHub

Thanks for your message, I’m reading it right now.

I’m just sharing my thoughts, so people can correct me.

From the protocol:

In Bitcoin a single byte is used for the version field identifying the address type. In Zcash two bytes are used. For addresses on the production network, this and the encoded length cause the first two characters of the Base58Check encoding to be fixed as “ t3 ” for P2SH addresses, and as “ t1 ” for P2PKH addresses. (This does not imply that a transparent Zcash address can be parsed identically to a Bitcoin address just by removing the “ t ”.)

But that’s pretty much what I can read in the source code too. Let me try to fire up the wallet.

I also crossposted it to the Bitcoin SE weekly challenge here: How to generate a zcash vanity address? - Bitcoin Stack Exchange

I’ve released a BIP 32 HD Zcash wallet generator

1 Like

Thanks. This is exactly what I was looking for.

$ zgenerate 
2016/10/28 10:42:09 Wallet generated!
2016/10/28 10:42:09 Passphrase: afraid master w...
2016/10/28 10:42:09 Address                                Private key
2016/10/28 10:42:09 t1eTNgQHp7ei42ZtVRJ8jmUrsfu3rQqpXKt    cQM...

Ok the safest way might be simply using the zcash-cli from the official repository:

$ zcash-cli getnewaddress
t1fMAAnYrpwt1HQ8ZqxeFqVSSi6PQjwTLUm

Or:

$ zcash-cli z_getnewaddress
zcHTYUQRA54WGdcNtLRx1yRyvEJjLD8NAK4S7FbEGoqB1s5En4syEStMnJPRMAD8XmF9xgeKnCEuZ7g35LcNpMhRDZX4PDw

Facepalm, that was too easy.

@5chdn: wait, what? The same thing gives me testnet addresses on my zcashd + zcash_cli. How did you get that? Started zcashd without testnet=1 in zcash.conf?

1 Like

The type of addresses generated should be different depending on the ‘mode’ of your zcash install. ie: Whether it’s configured for testnet or mainnet.

yes, just launch with testnet=0

that’s basicly why I didnt think of it in first place, because I expected issues running it in main network mode. But it works.

Could you upload an .exe file?

You really do not want me to upload an exe :slight_smile:

1 Like

Doesnt work. Say not connected to server

To get a mainnet valid address in Linux,

Upgrade to RC4 and

Change zcash.conf file to:

testnet=0
addnode=mainnet.z.cash
rpcuser=username
rpcpassword=password
gen=1

then zashd

then zcash-cli getnewaddress

Doesn’t work

root@R9290-PC:~# cd /root/.zcash
root@R9290-PC:~/.zcash# ls
blocks chainstate database db.log debug.log fee_estimates.dat peers.dat wallet.dat zcash.conf zcashd.pid
root@R9290-PC:~/.zcash# vi zcash.conf
root@R9290-PC:~/.zcash# ~/zcash/./src/zcashd -daemon
Zcash server starting
root@R9290-PC:~/.zcash# ~/zcash/./src/zcash-cli getnewaddress
error: couldn’t connect to server
root@R9290-PC:~/.zcash# ~/zcash/./src/zcash-cli getnewaddress
error: couldn’t connect to server
root@R9290-PC:~/.zcash#

Rm testnet3 since your upgrading

I didn’t upgrade. RC4 was the first one I installed

It keeps saying validated 0 transactions

You swtich so reftech key