Go to file
Jack Grigg 4a94975268 Use `RandomInvalidOutputDescription()` everywhere it makes sense
As a pre-check inside `z_sendmany` we estimate the size of the
transaction that would be created, to confirm it won't exceed any
limits. We do this by creating a fake transaction with fake outputs and
measuring its size. In the case of Sapling recipients, we'd push an
empty `OutputDescription`.

In zcash/zcash#6459 we pulled in changes that improved type safety in
the Rust types. One of these changes was that the `cv` field in a
Sapling Output Description is now enforced at parsing time to be not
small order (where previously we enforced this at proof verification
time).

The two above paragraphs collide because when measuring the size of the
fake transaction, we convert a `CMutableTransaction` into a
`CTransaction`; this calls `UpdateHash` to pin its txid, and that causes
the transaction to be serialized and then parsed across the FFI. This
causes the null `OutputDescription` to reach the Rust parser which
treats it as invalid.

There are two solutions to this, which are used in various contexts:

- Avoid pushing a null `OutputDescription` into a `CMutableTransaction`.
  This is the fix implemented in this PR for `z_sendmany`: we now call
  `RandomInvalidOutputDescription()` which gives us a consensus-invalid
  but parser-valid `OutputDescription`, suitable for estimating tx size.

- Use `UNSAFE_CTransaction` to avoid having `UpdateHash` be called on
  construction. This type is used in tests where we explicitly want to
  construct an invalid type in C++, for consensus checking purposes. One
  of the `OutputDescription()` uses was in a test, but didn't trigger
  the issue because the test was checking a different part of the
  transaction being invalid. Technically no change is needed here;
  however we now also call `RandomInvalidOutputDescription()` here for
  uniformity.

Part of zcash/zcash#6509.
2023-03-27 22:33:45 +00:00
.cargo Update to released versions of librustzcash crates. 2022-10-20 08:35:29 -06:00
.github CI: Check out both the base and PR branches for "recent base" check 2023-03-16 16:22:28 +00:00
build-aux/m4 build-aux: Update Boost macros to latest serials 2023-01-12 02:10:22 +00:00
contrib zcashd release 5.4.2 2023-03-13 06:19:46 -06:00
depends depends: CMake 3.26.0 2023-03-17 20:40:13 +00:00
doc Merge pull request #6377 from sellout/wallet_tx_builder/z_sendmany 2023-03-22 11:24:33 -06:00
qa Merge pull request #6377 from sellout/wallet_tx_builder/z_sendmany 2023-03-22 11:24:33 -06:00
share Remove `git_check_in_repo` from genbuild.sh to fix gitian version string 2022-10-21 14:39:21 -07:00
src Use `RandomInvalidOutputDescription()` everywhere it makes sense 2023-03-27 22:33:45 +00:00
test/lint Appease ShellCheck 2022-12-06 10:46:43 -07:00
zcutil Update release support book page in release process 2023-03-09 03:17:56 +00:00
.editorconfig Define some basic cross-editor configuration 2022-08-17 09:44:03 -06:00
.gitattributes Separate protocol versioning from clientversion 2014-10-29 00:24:40 -04:00
.gitignore Add script for verifying block rewards and fees not claimed by miners. 2023-01-22 09:10:03 -07:00
CONTRIBUTING.md
COPYING scripted-diff: Update Zcash copyrights to 2023 2023-01-23 11:31:54 -07:00
Cargo.lock cargo update 2023-03-17 23:22:53 +00:00
Cargo.toml depends: `cxx 1.0.92` 2023-03-17 20:32:01 +00:00
INSTALL Update documentation link 2023-02-21 07:07:17 +01:00
Makefile.am Fix automake warnings when running autogen.sh 2023-03-13 10:11:26 -06:00
README.md make-release.py: Versioning changes for 5.4.2. 2023-02-20 19:55:37 -07:00
SECURITY.md Fix Horizen Security contact email 2023-02-17 22:16:38 +00:00
autogen.sh Enable ShellCheck rules 2022-08-20 03:13:52 +00:00
code_of_conduct.md
configure.ac make-release.py: Versioning changes for 5.4.2. 2023-02-20 19:55:37 -07:00
libzcash_script.pc.in
rust-toolchain.toml CI: Remove most usages of `actions-rs` actions 2023-03-16 15:38:15 +00:00

README.md

Zcash 5.4.2

What is Zcash?

Zcash is an implementation of the "Zerocash" protocol. Initially based on Bitcoin's design, Zcash intends to offer a far higher standard of privacy through a sophisticated zero-knowledge proving scheme that preserves confidentiality of transaction metadata. More technical details are available in our Protocol Specification.

The zcashd Full Node

This repository hosts the zcashd software, a Zcash consensus node implementation. It downloads and stores the entire history of Zcash transactions. Depending on the speed of your computer and network connection, the synchronization process could take several days.

The zcashd code is derived from a source fork of Bitcoin Core. The code was forked initially from Bitcoin Core v0.11.2, and the two codebases have diverged substantially.

🔒 Security Warnings

See important security warnings on the Security Information page.

Zcash is experimental and a work in progress. Use it at your own risk.

📒 Deprecation Policy

This release is considered deprecated 16 weeks after the release day. There is an automatic deprecation shutdown feature which will halt the node some time after this 16-week period. The automatic feature is based on block height.

Other Zcash Implementations

The Zebra project offers a different Zcash consensus node implementation, written largely from the ground up.

Getting Started

Please see our user guide for instructions on joining the main Zcash network.

Need Help?

  • 📘 See the documentation at the ReadTheDocs for help and more information.
  • 📨 Ask for help on the Zcash forum.
  • 💬 Join our community on Discord

Participation in the Zcash project is subject to a Code of Conduct.

Building

Build Zcash along with most dependencies from source by running the following command:

./zcutil/build.sh -j$(nproc)

Currently, Zcash is only officially supported on Debian and Ubuntu. See the Debian / Ubuntu build for detailed instructions.

License

For license information see the file COPYING.