Commit Graph

119 Commits

Author SHA1 Message Date
Jack Grigg 90f13641b9 Use batch validation for Sapling proofs and signatures 2022-07-05 18:21:51 +00:00
Daira Hopwood e584b1b43f Upgrade to metrics 0.19.x and metrics-exporter-prometheus 0.10.x.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2022-07-01 09:12:34 +01:00
Jack Grigg 0430fdf20d Upgrade to `orchard 0.2.0` 2022-07-01 01:24:15 +00:00
Jack Grigg b31b1211cd depends: Add cxx crate to dependencies 2022-05-26 03:14:21 +00:00
Jack Grigg 1f1810c37d Name currently-unnamed threads that we can rename
After this, the only threads that aren't named are the LevelDB
background threads.
2022-05-14 00:07:34 +00:00
Jack Grigg 5fc38dd091 Migrate to `zcash_primitives 0.6` et al 2022-05-11 00:04:34 +00:00
Kris Nuttycombe 63e4addd9a Select Orchard anchors at `-orchardanchorconfirmations` depth.
This changes anchor selection and Orchard authentication path generation
to default to select anchors at a the depth specified by the
`-orchardanchorconfirmations` CLI argument, with a default anchor
selection depth of 10 blocks.

If the value of `minconf` used for a particular call to `z_sendmany` is
less than the the set number of Orchard anchor confirmations, `minconf`
will be used instead for the Orchard anchor confirmations depth,
so that the selected anchor will be certain to contain any notes
selected to be spent.

Fixes #5644
2022-05-04 14:16:43 -06:00
Alex Wied 61cd19a52d Cargo.toml: Rename hdwallet source
This change fixes the following build error on Nix:

error: source `https://github.com/nuttycom/hdwallet` defines source https://github.com/nuttycom/hdwallet?rev=9b4c1bdbe0517e3a7a8f285d6048a37d472ba3bc, but that source is already defined by `https://github.com/nuttycom/hdwallet.git`
note: Sources are not allowed to be defined multiple times.
make[2]: *** [Makefile:9325: cargo-build-bins] Error 101
2022-04-15 09:39:10 -04:00
Kris Nuttycombe 825d8e8781 Push back NU5 testnet release height to 1842420 2022-04-13 17:01:17 -06:00
Kris Nuttycombe 40487c079d Set NU5 testnet reactivation height. 2022-04-12 21:42:47 -06:00
Jack Grigg 8e805f5d75 depends: Remove direct `tokio` dependency
We still depend on it indirectly, but we don't use it directly anymore
since we upstreamed our patch to `metrics-exporter-prometheus`.

`thiserror` is also only used by the wallet tool, so has been reordered
accordingly.
2022-04-09 15:06:29 +00:00
Jack Grigg c784d7f480 depends: Remove `hyper 0.14.2` pin
`hyper 0.14.18` stops building the C libraries by default (after opt-in
support was added via a new flag in nightly Cargo), which means we no
longer have the problem of the `cdylib` build requiring a linker to be
hooked up to the Rust build when all we want is a `staticlib`.
2022-04-09 14:57:49 +00:00
Jack Grigg 18d3b79202 cargo update 2022-04-09 14:44:38 +00:00
Kris Nuttycombe f86a65d7cb Make Orchard `finalState` serialization format match Sapling.
For consistency, we serialize the `finalState` field in the
same (sparse) encoding as Sapling and Sprout use. In the future
we may want to update this to the dense encoding that
incrementalmerkletree::bridgetree::Frontier uses, but that's not
necessary for the moment.
2022-04-08 19:48:40 -06:00
Kris Nuttycombe 63d13a437f Update to orchard-0.1.0-beta.3, incrementalmerkletree 0.3.0-beta.2, secp256k1-0.21 2022-04-06 17:48:49 -06:00
Kris Nuttycombe 6fbcba641d Fix a bug in initialization of the Orchard wallet after NU5 activation.
When initializing a new Orchard wallet after NU5 activation, it is
not valid to start from the empty note commitment tree; instead,
the note commitment tree needs to be initialized from the state of
the global Orchard Merkle frontier.

In addition, this change necessitates a change to how rewinds work,
such that in a rollback scenario with a newly initialized wallet
that does not have sufficient checkpoints to fully satisfy a requested
rewind, the rewind is allowed to proceed so long as it does not
invalidate any persisted witness data.
2022-04-04 13:05:42 -06:00
Kris Nuttycombe a852eb223b Update incrementalmerkletree version to fix GC bug & use updated API.
This also modifies the serialized form of the wallet's incremental
merkle tree. This will require a complete reindex for testnet wallets.
2022-03-31 10:52:48 -06:00
therealyingtong bc33ba5a9f Update FFI to use scoped APIs for viewing keys and addresses 2022-03-30 08:30:27 -06:00
Jack Grigg 9e9f58b26f Merge branch 'master' into unify-nu5-consensus-changes 2022-03-23 02:57:16 +00:00
Jack Grigg 77a971fbc1 Migrate to latest `zcash/librustzcash` revision
This includes:
- `orchard =0.1.0-beta.3` which includes the final circuit changes.
- The new NU5 consensus branch ID.
- Updated ZIP 244 test vectors (which use the NU5 consensus branch ID).
2022-03-23 02:05:06 +00:00
Jack Grigg e646905f1b cargo update 2022-03-22 19:34:29 +00:00
Kris Nuttycombe 315392ce3b Add OrchardWallet::GetTxActions
This method detects and returns metadata for any notes belonging to the
wallet that are spent in the transaction. It also trial-decrypts the
Orchard outputs of a transaction using the wallet's incoming viewing
keys along a set of OVKs provided by the caller, and returns metadata
about the notes that were successfully decrypted.
2022-03-18 08:03:16 -06:00
Kris Nuttycombe 80324bc653 Merge remote-tracking branch 'upstream/master' into feature/wallet_orchard-merge_master 2022-03-17 16:52:49 -06:00
Kris Nuttycombe 4eda33f184 Serialize the Orchard note commitment tree to the wallet.
This adds serialization of Orchard note commitment trees
to `SetBestChain` and deserialization and loading of those
trees to wallet load.
2022-03-11 22:47:37 -07:00
Daira Hopwood 999b395360 Improve memory hygiene, and use -stdin to pass the recovery phrase to the child zcash-cli process.
Co-authored-by: Jack Grigg <str4d@electriccoin.co>
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2022-03-10 17:17:06 +00:00
Kris Nuttycombe 8bf99eaacc Merge remote-tracking branch 'upstream/master' into feature/wallet_orchard-merge_master 2022-03-09 22:17:49 -07:00
Kris Nuttycombe 237384cf2b Update incrementalmerkletree version 2022-03-07 18:32:58 -07:00
Daira Hopwood 6f5efcbb0f Improved error handling.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2022-03-07 18:39:23 +00:00
Daira Hopwood a36fceca70 Make a zcashd-wallet-tool executable.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2022-03-07 18:39:23 +00:00
Jack Grigg 7b7dddba0c cargo update 2022-03-01 00:34:02 +00:00
Jack Grigg 9f5f36e94c Migrate to `orchard` crate revision with circuit changes
Part of zcash/zcash#5385.
2022-02-28 23:52:49 +00:00
Kris Nuttycombe 258f0fc72f Add Orchard components to unified full viewing keys
Co-authored-by: Jack Grigg <jack@z.cash>
2022-02-22 21:08:10 +00:00
Kris Nuttycombe 6587b2ed86 Add Rust backend for Orchard components of the wallet.
Co-authored-by: str4d <thestr4d@gmail.com>
2022-02-17 17:50:17 -07:00
Jack Grigg 96d6ee0b8f Update ZIP 244 implementation
This brings in the changes that align the transparent parts of ZIP 244
with BIP 341.
2022-02-16 03:29:42 +00:00
Jack Grigg 2da0856e6f Add Orchard recipient support to the transaction builder
Co-authored-by: Kris Nuttycombe <kris@nutty.land>
2022-02-15 23:28:55 +00:00
Kris Nuttycombe 6c9b9a53b5 Update librustzcash dependency. 2022-02-02 17:40:36 -07:00
Kris Nuttycombe bdcb12e445 Add a first-class type for transparent full viewing keys. 2022-01-27 21:27:43 -07:00
Kris Nuttycombe c21ffff790 Add correct selection of change addresses to z_sendmany
This also alters `TransactionBuilder::SendChangeTo` to take a
`libzcash::ChangeAddress` value and thus avoids the invalid
t-addr case of CTxDestination.
2022-01-27 21:27:43 -07:00
Jack Grigg 714f14168c rust: Add missing checks for transparent UFVK items 2022-01-18 21:32:33 +00:00
Kris Nuttycombe fe777c5624 Fix encoding order of unified addresses. 2022-01-05 18:30:06 -07:00
Kris Nuttycombe 98967e2ec7 Merge remote-tracking branch 'upstream/master' into feature/wallet_unified_addresses 2022-01-05 18:20:31 -07:00
Jack Grigg d85bfb4744 Migrate to latest revisions of Zcash Rust crates 2021-12-18 01:44:27 +00:00
Jack Grigg e257844261 cargo update
In the three days since the last update, `futures 0.3.18` was yanked due
to panics: https://github.com/rust-lang/futures-rs/issues/2529
2021-12-16 16:55:11 +00:00
Kris Nuttycombe 640f31463f Update to ufvk zcash_address build. 2021-12-13 18:51:15 -07:00
Jack Grigg df0534e35a cargo update
Thanks to metrics-rs/metrics#231 being merged, our dependency tree is
now almost entirely de-duplicated!
2021-12-13 21:27:02 +00:00
Kris Nuttycombe e7c507cfb3 Update orchard & librustzcash dependency versions. 2021-11-29 13:05:54 -07:00
Jack Grigg 6c0bd90ee6 ed25519-zebra 3 2021-11-29 20:01:57 +00:00
Jack Grigg 5ae516f7b0 cargo update 2021-11-29 19:56:48 +00:00
Kris Nuttycombe 59a4c84112 Adds Orchard Address, IncomingViewingKey, FullViewingKey, and SpendingKey types. 2021-11-24 19:08:17 -07:00
Kris Nuttycombe 13b9a69230
Merge pull request #5306 from nuttycom/feature/mnemonic_seeds
Adds HD seed derivation from ZIP-339 mnemonic phrases.

This replaces random generation of transparent spending keys with BIP-44-compatible derivation from a mnemonic seed phrase, and replaces the random HD seed previously used for Sapling HD key derivation
with the same mnemonic seed. After this change, all new transparent and Sapling addresses
will be derived from a new randomly generated mnemonic seed, which is produced in such a way that 
it is guaranteed to produce valid unified spending keys at account 0 for all address types.

Closes #5176.
Closes #2673.
2021-11-18 17:52:36 -07:00