The Zcash Transaction Tool is designed to create and send Zcash transactions to a node (e.g., Zebra). It currently supports transaction versions V5 and V6, including the Orchard ZSA (Zcash Shielded Assets) functionality.
This repository includes a simple Zebra Docker image that incorporates the OrchardZSA version of Zebra and runs in regtest mode.
WARNING: This tool is not a wallet and should not be used as a wallet. This tool is in the early stages of development and should not be used in production environments.
- Features
- Core Components
- Prerequisites
- Getting Started
- Configuration
- Build Instructions
- ZSA Orchard Test Scenario
- License
- Acknowledgements
- Transaction Creation: Craft custom Zcash transactions.
- Transaction Submission: Send transactions to a Zcash node.
- ZSA Support: Work with Zcash Shielded Assets (Orchard ZSA).
- Version Compatibility: Supports transaction versions V5 and V6.
- Tested on Ubuntu 22.04 LTS but should work on any Linux distribution that support the Prerequisites.
- Alpha - Everything, including APIs and data structures, is subject to breaking changes. Feature set is incomplete.
- librustzcash: Used for transaction creation and serialization. This version includes slight modifications for additional functionality.
- Diesel ORM Framework: A safe and extensible ORM and query builder for Rust.
- Abscissa Framework: A microframework for building Rust applications.
- Docker: Install Docker
- Rust & Cargo: Install Rust and Cargo
- Diesel CLI: Installed via Cargo.
- Linux Dev tools:
sudo apt update
sudo apt install pkg-config libssl-dev libsqlite3-dev
Open a terminal and execute the following commands:
# Build the Zebra Docker image
docker build -t qedit/zebra-regtest-txv6 .
# Run the Zebra Docker container
docker run -p 18232:18232 qedit/zebra-regtest-txv6
For more details on how the Docker image is created and synchronized, refer to the Dockerfile.
In a separate terminal window, perform the following steps:
Install Diesel CLI and set up the database and get Zcash Params for Sapling:
# Install Diesel CLI with SQLite support
cargo install diesel_cli --no-default-features --features sqlite
# Set up the database
diesel setup
# Get Zcash Params for Sapling (if needed)
./zcutil/fetch-params.sh
Build and run the test case using the Zcash Transaction Tool:
# Build and run with ZSA feature enabled
cargo run --release --package zcash_tx_tool --bin zcash_tx_tool test-orchard-zsa
Note: To re-run the test scenario, reset the Zebra node by stopping and restarting the Zebra Docker container.
The detailed script for the ZSA flow can be found in test_orchard_zsa.rs.
You can specify the path to the configuration file using the --config
flag when running the application. The default configuration file name is config.toml
.
An example configuration file with default values is provided in regtest_config.toml
.
To set up the Diesel database:
-
Install Diesel CLI:
cargo install diesel_cli --no-default-features --features sqlite
-
Set Up the Database:
diesel setup
To build the application:
# Debug build
cargo build
# Release build (recommended for performance)
cargo build --release
To test ZSA functionality with the tool, enable the corresponding feature flag:
cargo build --release
The main test scenario (src/commands/test_orchard_zsa.rs) consists of the following steps:
- Issue an Asset: Create and issue a new ZSA.
- Transfer the Asset: Send the issued asset to another account.
- Burn the Asset (Twice): Burn the asset in two separate transactions.
To run the test scenario:
cargo run --release --package zcash_tx_tool --bin zcash_tx_tool test-orchard-zsa
This project is licensed under the MIT License. See the LICENSE file for details.
- Zcash: The privacy-protecting digital currency.
- Zebra: An independent Zcash node implementation.
- librustzcash: The Rust library underpinning Zcash.
- Diesel ORM Framework: For database interactions.
- Abscissa Framework: For application structure.
Feel free to contribute to this project by opening issues or submitting pull requests.