tezos-sapling
This OCaml library implements the Sapling protocol for privacy-preserving
transactions as described in its
specification,
version 2020.1.2.
A large part of the functionalities are implemented by the
librustzcash library from the ZCash
project.
This library provides bindings to librustzcash
and implements the
needed data structures to use the library.
Additionally it provides some facilities to forge transactions.
Rustzcash
The Rust library exports a C compatible interface inlibrustzcash/src/rustzcash.rs
andlibrustzcash/include/librustzcash.h
that is used by the ZCash C++
node and client.
The files rustzcash.ml{,i}
simply bind this C interface.
The binding can't be used alone to test the library as a number of
data structures are left to be implemented to the user of library.
Additionally the ZCash parameters are necessary to create and verify
proofs.
We assume that the library and the parameters are installed as part of
the usual make build-deps
.
Core
The file core.ml
contains a more high level presentation of the
Sapling protocol with respect to the low level binding.
Core is organized in several modules that are exposed through a
limited signature for validators and a more complete signature for
clients.
Storage
All the data structures are implemented in storage.ml
, including the
incremental Merkle tree, the nullifier set, the root bounded list and
the ciphertexts list.
Example
The file test/example.ml
contains a simplified implementation of a
client and validator using the library.
sha256=e9f47a476c7c8fd359f6fb2bd0f2807de1774c96220e51f83e0a9939faf1b5ab
sha512=9d67a2cb737956741b53a5155b743ef611785eb393789cfe8d4d7680e87d097d67b93f489efbdce63ad4c783d0e397ebb1400c46636906ed0debe76de47c5562
with-test & = version
with-test & >= "1.5.0"
with-test & = version
with-test & = version
with-test & = version
= version
= "1.1"
= version
= version
= version
>= "0.5.3" & < "0.6"
>= "0.18.0"
>= "2.9"
>= "13.0"
>= "13.0"