-
Notifications
You must be signed in to change notification settings - Fork 1
Public Alpha Guide
Zcash currently only works on Linux. It is also recommended that your hardware has around 4GB of memory and a few GB of free storage space. (We plan to improve the space-efficiency of our construction in the following months.)
In addition, the RPC interface is very "low-level" and a user interface has not been developed yet.
If you run into snags, please let us know. There's plenty of work needed to make this usable and your input will help us prioritize the worst sharpest edges earlier. For user help, we recommend using our forum:
Fetch our repository with git and run fetch-params.sh
like so:
git clone https://github.com/zcash/zcash.git
git checkout zc.v0.11.2.z2
cd zcash/
./zcutil/fetch-params.sh
This will fetch our public alpha proving and verifying keys and place them into ~/.zcash-params/
. These keys are, together, nearly 2GB in size, so it may take some time to download them.
First install the dependencies:
sudo apt-get install \
build-essential pkg-config libgtest-dev libc6-dev m4 \
g++-multilib autoconf libtool ncurses-dev unzip git python \
zlib1g-dev wget bsdmainutils
Now run the build:
./zcutil/build.sh
This should compile our dependencies and build zcashd.
The tests take a while to run. If you would rather get started right away, you can skip to the next section. If you want to run the tests to make sure Zcash is working, run:
./qa/zcash/full-test-suite.sh
You can also run the RPC tests, which take much longer:
./qa/pull-tester/rpc-tests.sh
Place a configuration file at ~/.zcash/bitcoin.conf
(you may need to mkdir ~/.zcash) with the following contents (you don't need to modify anything):
testnet=1
addnode=alphatestnet.z.cash
rpcuser=username
rpcpassword=password
Now, run the daemon!
./src/zcashd -daemon
It takes a little while to load the proving/verifying keys from the disk. It usually takes around 30-60 seconds.
You should be able to use the RPC after it finishes loading. Here's a quick way to test:
./src/zcash-cli getinfo
You need test zcash! You can mine it, but you'd probably be better off just asking us for some, since we've mined a lot ourselves. Zcash on the testnet doesn't have any value. Be prepared for the testnet to be reset which will cause you to lose your zcash.
Generate a new "transparent" (Bitcoin-style) address like so:
./src/zcash-cli getnewaddress
mojH91FkurYJzQyYEVFRBYxTNbsUpPkJEQ
Then come visit us on irc.oftc.net
in channel #zcash
and we'll gladly give you some! Then come back here for the remaining instructions.
(If you want to help us set up a faucet, let us know!)
Your coins are currently "transparent," so let's protect them by sending them to a Zcash address.
First, generate an address.
./src/zcash-cli zcrawkeygen
{
"zcaddress" : "20afab04ce26f8db2431529847996d549950c16bb0075831a9b0de20470ca756b5fd3401308201303081e906072a8648ce3d02013081dd020101302c06072a8648ce3d0101022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff30440420ffffffff00000001000000000000000000000000fffffffffffffffffffffffc04205ac635d8aa3a93e7b3ebbd55769886bc651d06b0cc53b0f63bce3c3e27d2604b0441046b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c2964fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551034200047c22352cf2b3703369baa533231d9495ad443046aff7afa5340d2a024b8f2daa92039b40c2762f02882da590653a997ae2de449a05db9b54af883b87d33a0a16",
"zcsecretkey" : "205685c6d763eb40a2935ecd659ef645cd5653e6d7a0f120cc002e9aa0dc6d47eafd1f013082011b0201003081ec06072a8648ce3d02013081e0020101302c06072a8648ce3d0101022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff30440420ffffffff00000001000000000000000000000000fffffffffffffffffffffffc04205ac635d8aa3a93e7b3ebbd55769886bc651d06b0cc53b0f63bce3c3e27d2604b0441046b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c2964fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc6325510201010427302502010104201293c8b732d99bbed439ee96e5769141caf20bb84308e282616cfa6ba48a33a6"
}
zcaddress
is the public address you can give to others to receive protected Zcash. zcsecretkey
is the private address used to spend value which is sent to the zcaddress
. These addresses are pretty large right now, and are not encoded or compressed, so it's easy to make mistakes with them. Let's put them in environment variables to avoid mistakes:
ZCADDRESS=20afab04ce26f8db2431529847996d549950c16bb0075831a9b0de20470ca756b5fd3401308201303081e906072a8648ce3d02013081dd020101302c06072a8648ce3d0101022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff30440420ffffffff00000001000000000000000000000000fffffffffffffffffffffffc04205ac635d8aa3a93e7b3ebbd55769886bc651d06b0cc53b0f63bce3c3e27d2604b0441046b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c2964fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551034200047c22352cf2b3703369baa533231d9495ad443046aff7afa5340d2a024b8f2daa92039b40c2762f02882da590653a997ae2de449a05db9b54af883b87d33a0a16
ZCSECRETKEY=205685c6d763eb40a2935ecd659ef645cd5653e6d7a0f120cc002e9aa0dc6d47eafd1f013082011b0201003081ec06072a8648ce3d02013081e0020101302c06072a8648ce3d0101022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff30440420ffffffff00000001000000000000000000000000fffffffffffffffffffffffc04205ac635d8aa3a93e7b3ebbd55769886bc651d06b0cc53b0f63bce3c3e27d2604b0441046b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c2964fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc6325510201010427302502010104201293c8b732d99bbed439ee96e5769141caf20bb84308e282616cfa6ba48a33a6
In order to send your "transparent" coins to your Zcash address, a process we sometimes call "protecting", let's begin by making a raw transaction.
Run this command to see your unspent coins:
./src/zcash-cli listunspent
You should see something like:
[
{
"txid" : "e3eb7d61e9f98162ac5301c94573d9ce9d50131fe4d108a56fdd7d73418478fb",
"vout" : 0,
"address" : "mx46njzjTWhZnFXMkCLnMkBWf6yRW2VGxV",
"scriptPubKey" : "210301bd1b356f310430c4054dae2ad542b5f3954784d9dfec48a79ab4f42e87a127ac",
"amount" : 50.00000000,
"confirmations" : 1520,
"spendable" : true
}
]
Notice that this particular "UTXO" has a value of 50 ZEC -- yours may be different. Using one of your unspent outputs, create the raw transaction by copying and pasting the txid
and vout
fields you got from listunspent
like so:
RAWTX=$(./src/zcash-cli createrawtransaction '[{"txid":"e3eb7d61e9f98162ac5301c94573d9ce9d50131fe4d108a56fdd7d73418478fb","vout":0}]' '{}')
This will place the raw transaction in the environment variable RAWTX
. It sends the entire value (in my case, 50 ZEC) as a fee, but we're going to use another operation to send it to our private zcash address:
./src/zcash-cli zcrawpour "$RAWTX" '{}' "{\"$ZCADDRESS\":49.9}" 50.0 0.1
In this case, I'm taking 50 coins from my UTXO, sending 49.9 of them to my zcaddress, and producing 0.1 as a fee for the transaction. The balance of your transaction must work out or you will get errors!
This operation (called a pour) might take a minute or two depending on your hardware. It is producing a zero-knowledge proof. (This operation's performance will be improved in the coming months.)
When it's done, it'll produce an output like this:
{
"encryptedbucket1" : "0446d914b261f3a28d2e874372c3e55cee119a80fa83ae6e5221bdc6d273770e879732a2ced274afe3ea312b32e9ff457a3809bc02bf851a11524a992b66780d03ab4127244079b7d0c4cc979f0c29397c0ddc849a1178d934343eed455503cfe72d77047c2de4f1d4577be2d37508fca630f3cd1e422aa8ce7bc3911c7d36fa535a7a4f946d56a37f3b920284798c9fd861e43bfa1f6178b2c2c5a11d975f3b0ec16b34b2478aa602b1415797",
"encryptedbucket2" : "04cf439171f2661c686993c9697a1692d039c5acd17d945b6c3c33df81ce17c8308b6289a3a470cb36f941442bcde51bcae94199a3a385a886c2d1eef3f12839ff04b4f17e4f58d9610c0db0c8c9f3ed8ea3560529daea5b1ea235f0b99b1825f7412fccfa3a23b88e7c2066bd4eb21aecd73a63f1304d89b2ca06056c61f91b7c972135e46f9edc17a9fa59978d287d01d1dea7ee5184c06c088947b2d4c97ce87e9f5819fe7c5eb9c7776b4c",
"rawtxn" : "0200000001fb788441737ddd6fa508d1e41f13509dced97345c90153ac6281f9e9617debe30000000000ffffffff00000000000100f2052a01000000809698000000000000000000000000000000000000000000000000000000000000000000000000000000791015a57ada1cab0c379b7de4d9febf371f73cd798d2cc4d9fba1199bc49e10f126bd617f7e46a5f8ec9173f07296107863c4fe9110cd3cde0bcdfc8d13b4868cf0dfabf06b54d139c18e75d6d61dc76a14886155373f7dbe376805969f254ed9c4e31ed018c661cccd7d268a9da4f64fd1dee33366995d72eaf4133909449cad0446d914b261f3a28d2e874372c3e55cee119a80fa83ae6e5221bdc6d273770e879732a2ced274afe3ea312b32e9ff457a3809bc02bf851a11524a992b66780d03ab4127244079b7d0c4cc979f0c29397c0ddc849a1178d934343eed455503cfe72d77047c2de4f1d4577be2d37508fca630f3cd1e422aa8ce7bc3911c7d36fa535a7a4f946d56a37f3b920284798c9fd861e43bfa1f6178b2c2c5a11d975f3b0ec16b34b2478aa602b1415797ad04cf439171f2661c686993c9697a1692d039c5acd17d945b6c3c33df81ce17c8308b6289a3a470cb36f941442bcde51bcae94199a3a385a886c2d1eef3f12839ff04b4f17e4f58d9610c0db0c8c9f3ed8ea3560529daea5b1ea235f0b99b1825f7412fccfa3a23b88e7c2066bd4eb21aecd73a63f1304d89b2ca06056c61f91b7c972135e46f9edc17a9fa59978d287d01d1dea7ee5184c06c088947b2d4c97ce87e9f5819fe7c5eb9c7776b4c065681922dc869dacb3f7100e5e18e435311c55bfd96b95cfec4557cadc10f60d755fbae6d16532ac28338832f7939c45e7efce33eceeb9bbd8903331c78dc77fd860530203637353338313934373530373834383430383734313530373231393432323037313235303633323435363732373837303536363534353438343735303338333534383934333631343331393220323032333132313230323330303332323139363032363130323534353138363731323339323337353238343436353032313538353631323330363039343731353830313137373132393637353920302031303236393139343832303636343533363937383937363131333830353432323432353732393837313439313235363939353736363239383238393530373330303038373635363131353033372031323936333532333939343732393530373438373034333831303236363035373533313539363134333436393133343136363437353036383533343439383439333134393337373235393530380a30203130303135373338343036363634333538313036363930353336313037303333333235383037343737343333333630353338393432373036363332353534373531363730353735363236393931203631363431303837313032333337353934393832383037393236303837383933343037303934363835303731323338313435363939393635363031343034393630343030303232373539333020313630333630393838363233393930303139393237333433383036323437353335353831313639343238313132303737303937353337313333363332393239323436323431313036313834333120313237363030333839323431333337353837343032363539313430363735363839393834373932313230353137373836333338313938323631323130313932313730363337353137323130363320302031363633343031363237373539363932333734383036303933303135373432393938353836303233303838373435363135363231313039323534303437373632363633333731363938313338392032313634363831303230353337323038383030313136333237303939363434303133323138353038303739303130343933303036353730383539373838383637383531343131353632333031390a30203231363136333532363730323337353138383932333538323838383035343534373032363631393831303531343136303339303736323834323639323531393738333735303836343036313633203134313838353033343937393833323535373033313639393639333730393037313135303339333531393138303737333036303935373633373035313031353736353830333138363631393537203020373035383033373133313637343134383831343837373333333233393736373937313237323031353738313331323334393638353838373934303839323037303035393337363331363038362031353637383535373635383235353132363335303630343431393933363533373736373931323334343739373036393030393039363533353632323531363938303931383831383537343032330a3020313231363638333837373038363231383336363439353237333236343633383733303033393334333936363630313639393839353835343638333237303131353438373630323839393837313420393033363736373230303334323232373035363530353035353836323236353036373638363732383330333534393734393338353137313237303833333032393431313633323835333139330a30203433373239393937393634373435363830323031343137303431393939323534333638383332373830343334333334303939303731353535373635303735363633393035313536363733353120363034353835393230383331343636373639303931363336333331383737313237353935393636393637383530343335303531323830373336383734373437313631363133363130343330390a"
}
encryptedbucket1
is an encrypted "bucket" which you must send to your recipient. In this case, that's you! encryptedbucket2
is another encrypted bucket, but in our transaction we only have one output, so this bucket is of zero value; don't worry about it. rawtxn
is the raw transaction with the pour added.
Now, sign the raw transaction, by copying and pasting the rawtxn
field from the output you got from zcrawpour
:
./src/zcash-cli signrawtransaction "$RAWTXN_FROM_ZCRAWPOUR"
You should be able to now send the result of that operation (the hex
field) over the network as a complete transaction.
./src/zcash-cli sendrawtransaction "$RAWTXN_FROM_SIGNRAWTRANSACTION"
If it returns a transaction ID, congrats! It needs to enter a block before it can be spent -- this helps make it indistinguishable and simplifies consensus rules. Let's use the zcrawreceive
RPC now.
./src/zcash-cli zcrawreceive $ZCSECRETKEY $ENCRYPTEDBUCKET1
This will decrypt your bucket -- it should show the correct value, and return a bucket
which you need for spending later. This is a sample output:
{
"amount" : 49.90000000,
"bucket" : "805b6d290100000020876b2852235d7415e4e9b8b00ed28e953cf715849c0655fad8d04cb60f0a99313030e65eba908d007b92d3fb4e8ccb9d8279698c23cc89a0cc1c4628f0266f6f6d9eab499eff588e44d8db583b23da676a",
"exists" : true
}
The bucket
is like a UTXO that only you and the sender know about, and only you can spend. The exists
field specifies whether this is a valid bucket (ie. it is in the blockchain).
Once you've "protected" your Zcash -- you have a bucket
from zcrawreceive
, and you have zcsecretkey
/zcaddress
-- you can send value to others pretty painlessly.
Let's create a standard transaction with no inputs and outputs to serve as the base.
./src/zcash-cli createrawtransaction '[]' '{}'
This should produce:
01000000000000000000
Let's say our friend's zcaddress is 20bbdbb41de37aa0899ddd39eef696ad00bed0f790f5df2689758d4badd21ccb7cfd3401308201303081e906072a8648ce3d02013081dd020101302c06072a8648ce3d0101022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff30440420ffffffff00000001000000000000000000000000fffffffffffffffffffffffc04205ac635d8aa3a93e7b3ebbd55769886bc651d06b0cc53b0f63bce3c3e27d2604b0441046b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c2964fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551034200048626ec40274272dc8213283e92770137a7f5074ce9111d26e019207adeb215139e8e1762504bc7e28d498fda5beebb1a2bc80a540f01b56ca72329ed7b494201
.
Let's send 10ZEC to this person for a pizza.
./src/zcash-cli zcrawpour 01000000000000000000 "{\"805b6d290100000020876b2852235d7415e4e9b8b00ed28e953cf715849c0655fad8d04cb60f0a99313030e65eba908d007b92d3fb4e8ccb9d8279698c23cc89a0cc1c4628f0266f6f6d9eab499eff588e44d8db583b23da676a\":\"$ZCSECRETKEY\"}" '{"20bbdbb41de37aa0899ddd39eef696ad00bed0f790f5df2689758d4badd21ccb7cfd3401308201303081e906072a8648ce3d02013081dd020101302c06072a8648ce3d0101022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff30440420ffffffff00000001000000000000000000000000fffffffffffffffffffffffc04205ac635d8aa3a93e7b3ebbd55769886bc651d06b0cc53b0f63bce3c3e27d2604b0441046b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c2964fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551034200048626ec40274272dc8213283e92770137a7f5074ce9111d26e019207adeb215139e8e1762504bc7e28d498fda5beebb1a2bc80a540f01b56ca72329ed7b494201":10,"20afab04ce26f8db2431529847996d549950c16bb0075831a9b0de20470ca756b5fd3401308201303081e906072a8648ce3d02013081dd020101302c06072a8648ce3d0101022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff30440420ffffffff00000001000000000000000000000000fffffffffffffffffffffffc04205ac635d8aa3a93e7b3ebbd55769886bc651d06b0cc53b0f63bce3c3e27d2604b0441046b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c2964fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551034200047c22352cf2b3703369baa533231d9495ad443046aff7afa5340d2a024b8f2daa92039b40c2762f02882da590653a997ae2de449a05db9b54af883b87d33a0a16":39.8}' 0 0.1
As you can see, we sent 39.8 back to our zcaddress as change, and sent 0.1 as a fee.
To make the outputs spendable, we need to sign and send the transaction (like we did earlier when protecting the coins):
./src/zcash-cli signrawtransaction "$RAWTXN_FROM_ZCRAWPOUR"
./src/zcash-cli sendrawtransaction "$RAWTXN_FROM_SIGNRAWTRANSACTION"
Send the first encrypted bucket to your friend. They should be able to zcrawreceive
it with their zcsecretkey
like you did earlier. The second encrypted bucket is the "change output" which you should keep so that you can spend it!