<p>To simply generate a new main network address, you can use the official zcash-cli like that:</p>

<pre><code>$ zcash-cli getnewaddress
t1fMAAnYrpwt1HQ8ZqxeFqVSSi6PQjwTLUm
</code></pre>

<p>Or: </p>

<pre><code>$ zcash-cli z_getnewaddress
zcHTYUQRA54WGdcNtLRx1yRyvEJjLD8NAK4S7FbEGoqB1s5En4syEStMnJPRMAD8XmF9xgeKnCEuZ7g35LcNpMhRDZX4PDw
</code></pre>

<p>Vanity is a bit tricky, but there is an offline wallet generator available here (<a href="https://forum.z.cash/t/offline-bip32-hd-zcash-wallet-generator/3384" rel="noreferrer">forum</a>, <a href="https://github.com/blackkeyboard/zgenerate" rel="noreferrer">gitub</a>).</p>

<p>It can be installed via <code>go</code>:</p>

<pre><code>$ export GOPATH="$GOPATH;/home/user/.go"
$ go get -u github.com/btcsuite/btcutil
$ go get -u github.com/blackkeyboard/mneumonic
$ go get -u github.com/blackkeyboard/zgenerate
$ go install github.com/blackkeyboard/zgenerate
</code></pre>

<p>After that it can generate valid (?) zcash addresses.</p>

<pre><code>$ ~/.go/bin/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...
</code></pre>

<p>Now, generating vanity needs some bash tricks for now. And a lot of disk space, as long as nobody codes a proper vanity generator.</p>

<p>First, generate a lot of addresses and pipe the output to a file:</p>

<pre><code>$ while true; do ~/.go/bin/zgenerate -n 99 &gt;&gt; keypairs.txt 2&gt;&amp;1; done
</code></pre>

<p>And in another shell, look for the results</p>

<pre><code>$ grep -i t1 keypairs.txt | awk '{print $3}' | grep -i 5chd
t1MniMQux3755CHdMdVEtk71GzDkrLjmMbL
t1QMERYYnhCTdpreFwp5chdhqejr7NxRJvK
t1euq6Yg5chDcdEd9LCmwDPizqAU6uBF5Lt
t1PqrCEUW5ChDcaxe9qsQjPiCVt5qd727qH
t1h5ouE263Ccuo5ChDwWRn9HJCMrT3DR7gN
t1Qo5cHDbNBaoaFTKJLrWHBFPoqBZjRRLAS
t1W5cHDhrAnHERt9Tv3r6cgRh9hKybRbn7q
t1dViyc3SQatNZXnoMwcFLB1ELTHNwT5chD
t1e7D5qgdpbxNLoi5ChdTpLFauz8VrQJ2He
t1Va5cHdqLWmnHeAycS9y3qoP3rDAyPJubD
t1UszZECKVPgFpjkYKubyC5chduhSTQscPz
t1LjhytxXj9YLzeBikShm2kj78N5chdkJkm
t1MyW2vggvzHKjPCZDcd5cHdDPsvYMXCp8F
t1UMn4PpwnvPBH6hiunhoXbXRqBoJz5CHDo
t1aohPrSU7bFsC5CHDEPi5Ed7mVxvnNjeuq
t1cMAXhkVSaPcGmzVwN15cHduRKpbLtFJ1H
t1NZRXnKdACxU9xYH9P5chdTcNZfFQ6mT5L
t1QXXyYidirdW4KQz5ChDtYGestzDJ9FyiS
t1cHMeeWtGqnduj5chDFXka8krJMLtDoiJb
t1Pv4zxf5ChDXsCiKkajeJ1qpkQyv1MbSTd
t1KftUZAas3mAyKL5chd97nbDz8S2iF8PQF
t1WQYSvAWPLFHh9gyg6m635CHD3A49C9AvH
t1cuG5ChdTvE864hCKbM9tpToYNU4u8QWA6
t1bTuRMnbJMG1z2tRySoz5cHD1VB6mNFKAX
t1MX7GuYdMcKH9nWgc5chDj99qgd9H1186i
t1VvKMh2LRiTeUY3B5p5oa5CHDWhzK5ZMxB
t1Z34PDzF5CHDfnvJdRFUsQQCWTys2Wv4FE
</code></pre>

<p>Stop if you are satisfied.</p>

CC BY-SA 3.0
2016-10-28T09:05:08.170Z
2016-10-28T09:05:08.170Z
q9f
<p>Is the main network address version for zcash already known? Is it possible to generate a mainnet address already?</p>

<p>This could allow miners to start from minute 0 to mine on a anonymous pool. The addresses can exist without the network as they are just a cryptographic keypair.</p>

<p>I checked the <a href="https://github.com/zcash/zcash/blob/master/src/chainparams.cpp#L102-L114" rel="nofollow noreferrer">chain params at the source repository</a>.</p>

<p>It looks like <a href="https://bitcoin.stackexchange.com/q/49115/6441">t-type addresses</a> start with <code>t1</code>, and multisig with <code>t3</code>.</p>

<pre><code>// 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};
</code></pre>

<p>And from the <a href="https://github.com/zcash/zips/blob/master/protocol/protocol.pdf" rel="nofollow noreferrer">protocol</a>:</p>

<blockquote>
  <p>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 ”.)</p>
</blockquote>

<p>But how to generate them? Never seen dual prefixes berfore. Also, what's the address version? My vanitygen is unable to cope.</p>

<address><address-generation><vanity-address><vanitygen><zcash>
How to generate a zcash vanity address?
q9f
# How to generate a zcash vanity address?

(Asked by: username_0 on 2016-10-28)

Is the main network address version for zcash already known? Is it possible to generate a mainnet address already?

This could allow miners to start from minute 0 to mine on a anonymous pool. The addresses can exist without the network as they are just a cryptographic keypair.

I checked the [chain params at the source repository](https://github.com/zcash/zcash/blob/master/src/chainparams.cpp#L102-L114).

It looks like [t-type addresses](https://bitcoin.stackexchange.com/q/49115/6441) 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};

```

And from the [protocol](https://github.com/zcash/zips/blob/master/protocol/protocol.pdf):

> 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 how to generate them? Never seen dual prefixes berfore. Also, what's the address version? My vanitygen is unable to cope.

**Tags:** address, address-generation, vanity-address, vanitygen, zcash


---

## 1 answers

### Answer by username_0 on 2016-10-28. Score: 4

To simply generate a new main network address, you can use the official zcash-cli like that:

```
$ zcash-cli getnewaddress
t1fMAAnYrpwt1HQ8ZqxeFqVSSi6PQjwTLUm

```

Or:

```
$ zcash-cli z_getnewaddress
zcHTYUQRA54WGdcNtLRx1yRyvEJjLD8NAK4S7FbEGoqB1s5En4syEStMnJPRMAD8XmF9xgeKnCEuZ7g35LcNpMhRDZX4PDw

```

Vanity is a bit tricky, but there is an offline wallet generator available here ([forum](https://forum.z.cash/t/offline-bip32-hd-zcash-wallet-generator/3384), [gitub](https://github.com/blackkeyboard/zgenerate)).

It can be installed via `go`:

```
$ export GOPATH="$GOPATH;/home/user/.go"
$ go get -u github.com/btcsuite/btcutil
$ go get -u github.com/blackkeyboard/mneumonic
$ go get -u github.com/blackkeyboard/zgenerate
$ go install github.com/blackkeyboard/zgenerate

```

After that it can generate valid (?) zcash addresses.

```
$ ~/.go/bin/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...

```

Now, generating vanity needs some bash tricks for now. And a lot of disk space, as long as nobody codes a proper vanity generator.

First, generate a lot of addresses and pipe the output to a file:

```
$ while true; do ~/.go/bin/zgenerate -n 99 >> keypairs.txt 2>&1; done

```

And in another shell, look for the results

```
$ grep -i t1 keypairs.txt | awk '{print $3}' | grep -i 5chd
t1MniMQux3755CHdMdVEtk71GzDkrLjmMbL
t1QMERYYnhCTdpreFwp5chdhqejr7NxRJvK
t1euq6Yg5chDcdEd9LCmwDPizqAU6uBF5Lt
t1PqrCEUW5ChDcaxe9qsQjPiCVt5qd727qH
t1h5ouE263Ccuo5ChDwWRn9HJCMrT3DR7gN
t1Qo5cHDbNBaoaFTKJLrWHBFPoqBZjRRLAS
t1W5cHDhrAnHERt9Tv3r6cgRh9hKybRbn7q
t1dViyc3SQatNZXnoMwcFLB1ELTHNwT5chD
t1e7D5qgdpbxNLoi5ChdTpLFauz8VrQJ2He
t1Va5cHdqLWmnHeAycS9y3qoP3rDAyPJubD
t1UszZECKVPgFpjkYKubyC5chduhSTQscPz
t1LjhytxXj9YLzeBikShm2kj78N5chdkJkm
t1MyW2vggvzHKjPCZDcd5cHdDPsvYMXCp8F
t1UMn4PpwnvPBH6hiunhoXbXRqBoJz5CHDo
t1aohPrSU7bFsC5CHDEPi5Ed7mVxvnNjeuq
t1cMAXhkVSaPcGmzVwN15cHduRKpbLtFJ1H
t1NZRXnKdACxU9xYH9P5chdTcNZfFQ6mT5L
t1QXXyYidirdW4KQz5ChDtYGestzDJ9FyiS
t1cHMeeWtGqnduj5chDFXka8krJMLtDoiJb
t1Pv4zxf5ChDXsCiKkajeJ1qpkQyv1MbSTd
t1KftUZAas3mAyKL5chd97nbDz8S2iF8PQF
t1WQYSvAWPLFHh9gyg6m635CHD3A49C9AvH
t1cuG5ChdTvE864hCKbM9tpToYNU4u8QWA6
t1bTuRMnbJMG1z2tRySoz5cHD1VB6mNFKAX
t1MX7GuYdMcKH9nWgc5chDj99qgd9H1186i
t1VvKMh2LRiTeUY3B5p5oa5CHDWhzK5ZMxB
t1Z34PDzF5CHDfnvJdRFUsQQCWTys2Wv4FE

```

Stop if you are satisfied.


---

