zcash-fpga/README.md

68 lines
3.3 KiB
Markdown
Raw Normal View History

2019-07-01 00:15:04 -07:00
The work in this repo is the result of a Zcash foundation grant to develop open-source FPGA code that can be used to accelerate various aspects of the network.
2019-07-10 04:46:26 -07:00
**An Architecture document is [here](zcash_fpga_design_doc_v1.1.x.pdf)**.
2019-06-06 20:00:06 -07:00
While mainly developed for Equihash and the secp256k1 and bls12-381 curves, the code used in this repo can also be applied with minimum modification to other curves.
2019-07-02 17:34:42 -07:00
** Currently still a work in progress
2019-07-01 00:15:04 -07:00
# Repo folder structure
Each top level folder is explained below. Inside each folder is source code written in systemverilog, and most blocks have a standalone self-checking testbench.
2019-06-06 20:00:06 -07:00
2019-06-07 09:44:00 -07:00
## aws
2019-06-06 20:00:06 -07:00
2019-07-01 00:15:04 -07:00
This contains the top / project files for building on a AWS (Amazon FPGA VU9P w/ 64GB DDR4).
2019-07-01 00:18:10 -07:00
* This contains the zcash_fpga library (aws/cl_zcash/software/runtime/zcash_fpga.hpp) that can be used to interface with the FPGA over PCIe.
* Instructions on how to build are in the architecture document.
2019-06-06 20:00:06 -07:00
2019-06-07 09:44:00 -07:00
## bittware_xupvvh
2019-06-06 20:00:06 -07:00
2019-07-01 00:15:04 -07:00
This contains the top / project files for building on the Bittware VVH board (VU37P FPGA w/ 8GB HBM, 16GB DDR4).
2019-06-06 20:00:06 -07:00
## ip_cores
2019-07-01 00:15:04 -07:00
These contain shared IP cores used by the projects in this repo. These include many functions, such as:
2019-06-06 20:00:06 -07:00
2019-06-07 09:44:00 -07:00
* Hashing
2019-07-01 00:15:04 -07:00
- Blake2b - single pipe implementation of blake2b and a pipline-unrolled version for high performance (single clock hash @ 200MHz after initial 52 clock delay).
2019-06-07 09:44:00 -07:00
- SHA256 and SHA256d
2019-07-01 00:15:04 -07:00
* Packages and interfaces for common use, along with many tasks to simplify simulation
- AXI4
- AXI4-lite
- Block RAM
2019-06-07 09:44:00 -07:00
* Fifo implementations
2019-07-01 00:20:43 -07:00
* Hash map implementation
- Fully parameterized for bit widths and uses CRC as the hashing function
2019-07-01 00:15:04 -07:00
* Blocks for parsing/processing streams
2019-06-06 20:00:06 -07:00
* Karabutsa multiplier
2019-07-01 00:15:04 -07:00
- Fully parameterized for number of levels
2019-06-07 09:44:00 -07:00
* Barret reduction for modulo reduction when the modulus does not allow fast reduction
2019-07-01 00:15:04 -07:00
- Both a fully pipelined high performance version and a slower but smaller resource utilization version
* Addition and subtraction modules
- Fully parameterized so that they can be used for large bit-width arithmetic
* Extended Euclidean algorithm for calculating multiplicative inverses
2019-06-06 20:00:06 -07:00
* Resource arbitrators
* General purpose elliptical curve point and element modules
- Point multiplication, doubling, adding up to Fp^12 (towered over Fp^6 and Fp^2)
- Element inversion
- Multiplication by non-residue for use in towering
- Exponentiation of Fp^12 elements
2019-06-07 09:44:00 -07:00
## zcash_fpga
2019-07-01 00:15:04 -07:00
This is the top level for the Zcash FPGA. It contains source code and testbenches for the blocks used in the Zcash acceleration engine.
2019-06-07 09:44:00 -07:00
2019-07-01 00:15:04 -07:00
It optionally contains the following top-level engines (you can include in a build via parameters in the top level package):
2019-06-07 09:44:00 -07:00
* Equihash verification engine
- Verifies the equihash solution and difficulty filters
2019-07-10 04:46:26 -07:00
* Transparent Signature Verification Engine (secp256k1 ECDSA core)
2019-06-07 09:44:00 -07:00
- Uses efficient endomorphism to reduce key bit size
- Signature verification calculates multiple EC point operations in parallel, using a resource-shared single fully pipelined karabutsa multiplier and quick modulo reduction technique
2019-07-10 04:46:26 -07:00
* BLS12-381 Coprocessor (zk-SNARK accelerator)
2019-07-01 00:15:04 -07:00
- General arithmetic over bls12-381 curve
- Dual Point multiplication in Fp and Fp^2 (G1 and G2)
- Frobenius map operations
- The ate pairing
- Miller loop and final exponentiation stage