Zapa is Zero-Knowledge Anonymous Payments on Avalanche -- a privacy coin built and deployed as an Avalanche Subnet. Zapa integrates the shielded payments technology of Zcash with the Avalanche consensus mechanism in order to offer a lightning fast privacy coin fully operated on Proof of Stake.
- Locally working end to end with ava-sim
- Testnet deployed
- Mainnet deployed
Subnet ID: 2ma1j6rSYPykvTDk6JeHKGgXQzqtWbwrsEzUethnTf8k7DMSEb
VM ID: tGas3T58KzdjLHhBDMnH2TvrddhqTji5iZAMZ3RXs2NLpSnhH
Active Blockchain ID: 6Jdeqk1VMB3qXhse3C3YnuoZPnaNAqGJJucyRSkXmpiekrEto
Disabled Blockchain IDs: ydwMTPrYBWHrGVmWfG8k4Po2eTPEqe7y7Z4jZaUr2Me6rin7
, 2LedqoeDb3zZQSqPBczemzrofepr6SzSHXxHXANrfzeFKGGNVd
After cloning, fetch submodules:
git submodule update --init --recursive
Throughout this project there are optional directives for debugging in VS Code. Contained in this repo is a pre-configured VS Code workspace. To open this project in VS Code, open VS Code and select "Open Workspace from file", then select zapa.code-workspace
from this repo's main directory.
This image depicts the three main components of Zapa and how they work together to facilitate an anonymous transaction on the blockchain. Each of those three components are also submodules of this repository:
- avalanchego -- Node implementation of the Avalanche network.
- zapavm -- Go plugin which acts as a thin bridge between avalanchego and zcashd.
- zcash -- A daemon for generating and validating anonymous transactions.
The fourth submodule (not depicted above) is ava-sim which is a utility for spinning up a local network for testing.
See Tokenomics for details on how the ZAPA token works, incentives, fees, and reward structure.
The best way to develop, test, and debug is to setup a local five-node network using ava-sim. The steps required are:
- Run five versions of zcashd, each exposing a different port to talk to a unique zapavm node in the local network.
- Run ava-sim with the zapavm plugin as an argument.
- Interact with the local nodes to send transactions, query balances, and mine blocks.
Checking out the zcash submodule and follow the steps outlined in Running zcashd: A 5 Node Local Setup.
Follow the steps linked here to run ava-sim with the zapavm plugin.
See Interacting with the Chain for instructions on how to interact with the local nodes.
To validate the Zapa chain and start earning ZAPA on the fuji network:
- Run a zcash node
- Launch the zapavm plugin ontop of an existing avalanchego fuji deployment.
All of these steps require checking out the zcash submodule and taking action to build or run resources in that project.
- Fetch Zcash Parameters
- Optionally, Build zcashd. If you don't do this step, a pre-built binary will be used.
- Follow the steps defined in Running Zcashd as Part of your Avalanche Validator
- Ensure you have an
avalanchego
node pointed at the Fuji network. See Avalanche Docs - Either follow instructions to build zapavm from source or use a pre-existing build. If using a pre-existing build, no action is required on this step.
- Move the plugin binary to your plugins directory, usually found at
build/plugins/
relative to youravalanchego
program. For example, if you're running your node on ubuntu, the command is likely (for OSX just replacezapavm-ubuntu
withzapavm-osx
:
cp zapavm/builds/zapavm-ubuntu ~/avalanche-node/plugins/zapavm
- Update your node configuration to whitelist the subnet specified above.
- Alias the vm. Create a vm/aliases.json configuration to alias this VM so that Avalanche knows which vm-id this binary belongs to. Assuming your existing aliases file is empty, you can use this command:
echo {\"tGas3T58KzdjLHhBDMnH2TvrddhqTji5iZAMZ3RXs2NLpSnhH\":[\"zapavm\"]} > ~/.avalanchego/configs/vms/aliases.json
- Restart
avalanchego
- When the node has finished bootstrapping, you should see logs indicating this in the chain log.
- See Interacting with the Chain for instructions on how to interact with the blockchain.
- Copy the blockchain ID specified above.
In case you're looking for inspiraton, here's a sequence of calls you can make to earn and transact ZAPA:
- Call MineBlock to ask your node to produce a block.
- Call NodeBlockCounts to verify that your node has indeed produced a block. If your node has successfully produced a block, you should also have some coinbase rewards. If not, return to step 1. Sometimes this takes a few tries.
- Call ListSpent to see your balances.
- Then, try sending some funds around...privately, of course. Call z_getnewaddress to get a shielded address.
- Then call SubmitTx in order to send some ZAPA from one of your unspent addresses to this new shielded address.
- You can then verify the coinas got there by calling z_getbalance.
- Once you've verified that you can shield funds, try then sending ZAPA to someone else's z-address. Any transactions between z-addresses are 100% private.