Is it possible to generate a main net address already?


#1

Is the main network address version already known? Is it possible to generate a main net address already?

This could allow miners to start from minute 0 to mine on a anonymous pool.


#2

There can be no main network addresses until the main network blockchain launches. It's like asking for a street address without a street or road.


#3

Why not? Is the source code not published yet?

Let me check.-


#4

Because the main net doesn't exist until it launches. See above. Its like asking for a street address in the middle of a desert with no roads or streets. Can't have an address on a blockchain which doesn't exist yet.


#5

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

Just checking the chain params. https://github.com/zcash/zcash/blob/master/src/chainparams.cpp#L102-L114

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.


#6

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


#7

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...

#8

I'm almost certain you've taken a fatal shortcut there...

Check out p24 of this pdf - https://github.com/zcash/zips/blob/master/protocol/protocol.pdf


#9

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: http://bitcoin.stackexchange.com/q/49288/6441


Would pools like zcash.flypool.org continue automatically mining mainnet?
#10

I've released a BIP 32 HD Zcash wallet generator


#11

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...

#12

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.


#13

@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?


#14

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.


#15

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.


#16

Could you upload an .exe file?


#17

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


#18

Doesnt work. Say not connected to server


#19

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


#20

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#