Commit Graph

10616 Commits

Author SHA1 Message Date
Sean Bowe 3665f69a48
wallet: restore orchard address to IVK mappings during wallet loading 2022-03-02 08:11:47 -07:00
Sean Bowe f7824e8cec
wallet: restore Orchard secret keys from mnemonic seed 2022-03-02 08:11:47 -07:00
Sean Bowe 49ce03ed79
wallet: consolidate unified key/address/account map reconstruction 2022-03-02 08:11:47 -07:00
Kris Nuttycombe 68d6c3ddc3
Merge pull request #5615 from nuttycom/feature/wallet_orchard-merge_master
Merge master back to feature/wallet_orchard
2022-03-01 19:57:39 -07:00
Larry Ruane e170c3abd6 document global variables 2022-03-01 17:43:43 -07:00
Pieter Wuille c079a518c0 Modernize best block mutex/cv/hash variable naming
(cherry picked from commit bitcoin/bitcoin@4a6c0e3dcf)
2022-03-01 17:09:19 -07:00
Pieter Wuille 4693f8165f Fix csBestBlock/cvBlockChange waiting in rpc/mining
(cherry picked from commit bitcoin/bitcoin@45dd135039)
2022-03-01 17:09:19 -07:00
Kris Nuttycombe 783e269a7b Merge remote-tracking branch 'upstream/master' into feature/wallet_orchard-merge_master 2022-03-01 16:54:05 -07:00
Kris Nuttycombe bd50fbbb94 Filter returned Orchard notes by minimum confirmations. 2022-03-01 16:30:29 -07:00
sasha 0f06774e94 gtests ordering: CheckBlock.VersionTooLow calls SelectParams(MAIN) 2022-02-28 17:59:50 -08:00
sasha 3a7b4eca87 gtests ordering: ContextualCheckBlockTest's TearDown deactivates Blossom 2022-02-28 17:58:00 -08:00
sasha 489c025f81 gtests ordering: change wallet filename in WriteZkeyDirectToDb 2022-02-28 17:57:10 -08:00
Jack Grigg b5ce94d16c rust: Fix clippy lint 2022-03-01 01:35:46 +00:00
Conrado Gouvea 3be05964d7 Add zcash_script V5 functions
Co-authored-by: Jack Grigg <jack@z.cash>
2022-02-28 19:12:18 +00:00
Kris Nuttycombe 399ffa7f5c GenerateNewKey must be guarded by a cs_wallet lock 2022-02-26 20:13:38 -07:00
Kris Nuttycombe f9380572c1
Merge pull request #5597 from nuttycom/feature/wallet_orchard-find_spendable_inputs
Select Orchard notes in FindSpendableInputs
2022-02-25 08:36:19 -07:00
Kris Nuttycombe d9cddac773 Select Orchard notes in FindSpendableInputs 2022-02-24 18:16:53 -07:00
Jack Grigg 701a7875a7 Regenerate `TxDigests` after rebuilding tx with Orchard bundle
In zcash/zcash/pull/5544 we added an FFI method specific to the Orchard
part of the transaction builder, to enable passing the Orchard bundle on
the Rust side directly instead of using a partial serialization. We
passed the remainder of the transaction to the Rust side by serializing,
as we similarly do in `SignatureHash`. We then decomposed the parsed
transaction on the Rust side to insert the Orchard bundle. However, we
then used the `TxDigests` that was derived from the parsed transaction,
not the reconstructed one, which meant we produced an invalid sighash
when building Orchard-containing transactions.
2022-02-25 00:52:52 +00:00
Jack Grigg d4078c8d25 Select Orchard receivers preferentially from UAs
The addition of `OrchardRawAddress` to `RecipientAddress` drives most of
the changes in this commit, which enable `z_sendmany` to send funds to
addresses in the Orchard pool once NU5 activates.
2022-02-25 00:52:52 +00:00
Jack Grigg 85a8784b38 Fix semantic merge conflicts
- We added `OrchardRawAddress` to the `Receiver` variant, which prevents
  it from having a default constructor.
- We added `ReceiverType::Orchard`, which Clang warns is unused when we
  use `ReceiverType` in a `switch` statement.
2022-02-25 00:48:17 +00:00
Jack Grigg bb4e792c84 Merge branch 'master' into feature/wallet_orchard-orchard_sendmany 2022-02-25 00:33:28 +00:00
Steven 82c33596b9
Merge pull request #5580 from steven-ecc/update-transaction-size-estimation
Update transaction size estimation to include V5 transactions
2022-02-23 20:16:58 -08:00
Jack Grigg b0769e3f1d Add Orchard to default UA receiver types
We also add Orchard-specific information to several RPCs in order for
tests to pass:

- `z_listunifiedreceivers`
- `z_getbalanceforaccount`
- `z_getbalanceforviewingkey`
2022-02-24 02:17:52 +00:00
Jack Grigg 235fde5193 Add mappings from Orchard receivers to IVKs to the wallet
We add the Orchard change address mapping on account creation, as we
only ever generate a single change address internally. External Orchard
receivers are added to the map when `z_getaddressforaccount` is called.

This commit also fixes two bugs in the handling of Orchard internal IVKs.
When adding a full viewing key to the Orchard (Rust) wallet, we need to
derive both the internal and external IVKs (and map them to the external
FVK so we effectively never expose the internal FVK). We were only
deriving the external IVK, meaning that trying to add the Orchard change
address to the wallet should have failed. However, in a separate bug the
C++ internal IVK derivation method was calling the Rust external IVK
derivation function, meaning that we were effectively using the external
Orchard address at index 0 _as_ the change Orchard address.
2022-02-24 02:17:19 +00:00
Steven Smith a0740650c3 Update transaction size estimation to include V5 transactions 2022-02-23 16:49:01 -08:00
John Newbery 4942020624 Log calls to getblocktemplate
(cherry picked from commit bitcoin/bitcoin@1352092dbd)
2022-02-22 22:14:36 -07:00
Jack Grigg 3179e45467 Trial-decrypt candidate Sapling receivers with all wallet UFVKs
This ensures we have the same semantics for detecting Orchard and
Sapling receivers in UAs, even if the UA they are part of was derived
outside of the zcashd wallet.
2022-02-23 02:23:45 +00:00
Jack Grigg d099e469e1 Rename to `ZcashdUnifiedSpendingKey::GetSaplingKey` for consistency 2022-02-22 21:08:10 +00:00
Jack Grigg c2a47b8d97 Return UFVK from `CWallet::GenerateNewUnifiedSpendingKey`
The only place we were using the returned Unified Spending Key was in a
test, where we immediately converted it to a UFVK.

Co-authored-by: Kris Nuttycombe <kris@nutty.land>
2022-02-22 21:08:10 +00:00
Kris Nuttycombe 3c84ed604e Remove OrchardSpendingKey serialization code
Orchard spending keys now live exclusively on the Rust side, and will be
serialized there as part of the Orchard wallet serialization.
2022-02-22 21:08:10 +00:00
Kris Nuttycombe 225c78f3ab Add Orchard components to unified spending keys
Co-authored-by: Jack Grigg <jack@z.cash>
2022-02-22 21:08:10 +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
sasha eab7efcae5 explain the 0x0f0f[..]0f0f powLimit constant for regtest 2022-02-22 11:21:37 -08:00
Kris Nuttycombe bb91c9fbc3
Merge pull request #5549 from therealyingtong/cache-ua
Cache UA recipients passed to `z_sendmany`
2022-02-22 09:05:13 -07:00
therealyingtong 1dae16a41c WriteRecipientMapping: Check that receiver exists in UA.
Co-authored-by: Kris Nuttycombe <kris@nutty.land>
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2022-02-22 11:53:23 +08:00
ying tong 2943e13c8b
Apply docfixes from code review
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2022-02-22 08:44:09 +08:00
Kris Nuttycombe 1a1522a4f1 Add Orchard components to unified address
Co-authored-by: Jack Grigg <jack@z.cash>
2022-02-21 17:04:27 +00:00
Kris Nuttycombe 3e3ee1bf3b Add various bits of documentation 2022-02-19 15:29:19 +00:00
Kris Nuttycombe 1969add228 Apply suggestions from code review
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2022-02-18 17:45:50 -07:00
Kris Nuttycombe 66890866d6 Remove txid field from TxNotes 2022-02-18 17:07:47 -07:00
therealyingtong 108e9d4658 CSerializeRecipientAddress: add Read method and make constructor private.
Co-authored-by: Kris Nuttycombe <kris@nutty.land>
2022-02-18 16:39:43 +08:00
therealyingtong 99a69182cd Docfixes. 2022-02-18 13:55:58 +08:00
therealyingtong 4c4ee558d6 ShieldToAddress: Factor out static shieldToAddress() helper. 2022-02-18 13:55:23 +08:00
str4d 6cd5b8792b
Merge pull request #5560 from steven-ecc/z_gettreestate_update_for_orchard
Add Orchard support to the z_gettreestate RPC
2022-02-18 03:17:05 +00:00
Kris Nuttycombe d08c992b5e Move parsing of unified addresses to UnifiedAddress.
In cases where we want to be able to decode a string that
is known to be a unified address, it doesn't make sense to have
to route through KeyIO::DecodePaymentAddress and then return
an error depending upon the result type, when it's possible to
provide unified address parsing more directly.

KeyIO::DecodePaymentAddress has been modified to delegate
to UnifiedAddress::Parse
2022-02-17 18:27:15 -07:00
Kris Nuttycombe dcf7f46260 Add test for Orchard wallet note detection.
This tests the following operations:
* add a spending key to the wallet
* add notes from the Orchard bundle component of a transaction to the
  wallet
* detect notes in the wallet that correspond to the spending key
* verify that notes that are not ours are not mistakenly labeled
  as ours
2022-02-17 17:50:17 -07:00
Kris Nuttycombe 4c53499f11 Add GetFilteredNotes to Orchard wallet. 2022-02-17 17:50:17 -07: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 4eee55d4de ZIP 244: Address review comments 2022-02-17 22:41:41 +00:00
Jack Grigg e9625d2483 Enforce length constraints on allPrevOutputs 2022-02-17 22:41:41 +00:00
Kris Nuttycombe 73a75a37fe Make SaveRecipientMappings polymorphic in RecipientMapping type. 2022-02-17 08:55:59 -07:00
Steven Smith 59c6b028f7 Add Orchard support to the z_gettreestate RPC 2022-02-17 06:14:21 -08:00
therealyingtong 79c0514919 z_sendmany: Only get ua if decoded is ua variant. 2022-02-17 19:38:02 +08:00
Steven ffdc11c378
Merge pull request #5555 from steven-ecc/deprecate_rpcs
Mark z_gettotalbalance and dumpwallet as deprecated
2022-02-16 15:58:46 -08:00
Daira Hopwood 816649db2a
Cosmetic whitespace change 2022-02-16 22:19:59 +00:00
Steven Smith 512c862a5f Mark z_gettotalbalance and dumpwallet as deprecated 2022-02-16 08:47:34 -08:00
Jack Grigg da755c2ae8 Make `TransactionBuilder::AddOrchardOutput` memo optional
This replaces the previous use of the `NO_MEMO` constant, instead
passing the optionality through to Rust for handling.
2022-02-16 13:39:40 +00:00
therealyingtong 94ab8e4c77 Implement read and write for (txid, recipient) -> ua mapping.
Co-authored-by: Kris Nuttycombe <kris@nutty.land>
Co-authored-by: Jack Grigg <jack@z.cash>
2022-02-16 20:15:07 +08:00
Jack Grigg c0736d3ef6 Enforce ZIP 244 consensus rules on sighash type
We implement this by throwing an exception in SignatureHash on violation
of the rules. For CHECKMULTISIG and CHECKSIG this results in `false`
being pushed onto the stack, while for CHECKMULTISIGVERIFY and
CHECKSIGVERIFY this results in an error.
2022-02-16 03:30:10 +00: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
Larry Ruane 698f7ba770 z_listreceivedbyaddress: reject UA component addr (#5537) 2022-02-15 09:19:09 -07:00
Jack Grigg 067b3b3032 Update ZIP 244 test vectors
Source: c7f9463713/test-vectors/zcash/zip_0244.json
2022-02-15 02:42:14 +00:00
Jack Grigg 80f478e67e Make `PrecomputedTransactionData` a required argument of `SignatureHash`
The ZIP 244 changes mean that we're going to need to alter every
callsite to pass through all of the transparent `CTxOut`s being spent.
Given that we need to pass it over to Rust, it makes more sense to just
have `PrecomputedTransactionData` be the vehicle for conveying this data
across.
2022-02-15 02:42:14 +00:00
Jack Grigg 3acf7941d6 Move shielded signature checks out of `ContextualCheckTransaction`
The ZIP 244 changes mean that shielded signatures will now require
access to any transparent inputs of the transaction, so we need to
validate the shielded signatures around the same point during block
connection or `AcceptToMemoryPool` as when we validate transparent
signatures.
2022-02-15 02:40:15 +00:00
therealyingtong c7346e802e SendTransaction: Introduce recipients argument. 2022-02-15 09:50:00 +08:00
therealyingtong 6436230562 Move SendManyRecipient to wallet.h and introduce optional ua field. 2022-02-15 09:50:00 +08:00
sasha e568a190f3
Merge pull request #5419 from zcash/feature/wallet_unified_addresses 2022-02-14 08:17:36 -08:00
Kris Nuttycombe 9ca64fc8ba
Merge pull request #5541 from nuttycom/ua_test_vectors
Add test vectors for UFVK derivation
2022-02-13 07:36:14 -07:00
Kris Nuttycombe b1ab30c8d9 Rename sapling-specific zip32 FFI methods.
Also addresses a couple of other minor comments from code review.
2022-02-12 15:24:48 -07:00
Kris Nuttycombe 67e871a40c Add test vectors for UFVK derivation
Also update test vectors for unified addresses.
2022-02-12 15:07:05 -07:00
Kris Nuttycombe e6d3dca2a3
Merge pull request #5542 from LarryRuane/2022-02-z_listreceivedbyaddress-ua-1
fix wallet_listreceived.py, add blockdata to taddr output
2022-02-12 14:59:08 -07:00
Larry Ruane 326dafeebe fix wallet_listreceived.py, add blockdata to taddr output 2022-02-12 13:01:58 -07:00
Kris Nuttycombe 85caa659af Fix missing std::variant header that was breaking Darwin builds. 2022-02-11 13:10:47 -07:00
Kris Nuttycombe 007f05493a Add change field to z_listreceivedbyaddress for transparent addrs.
This updates the `IsChange` method to check the HD keypath associated
with the key for whether the address was generated as internal
or external.
2022-02-11 12:48:35 +00:00
Larry Ruane c48e35bb66 Update z_listreceivedbyaddress to support unified addresses (5467) 2022-02-11 12:48:23 +00:00
Jack Grigg 89b9bbaf33 wallet: Separate counters for external and internal transparent keys
This fixes a potential bug with importing the mnemonic into a third
party transparent wallet. Previously, if a user called `getnewaddress`,
made a bunch of transactions that generated at least 20 change
addresses, and then called `getnewaddress` again, the two external
addresses would be separated by a gap of more than 20. If this mnemonic
were imported into a third party transparent wallet, the wallet would
not detect any funds in the second (or subsequent) transparent addresses
because it would detect 20 unused addresses in a row (via the BIP 44
default gap limit).

Now, we track external and internal keys separately; repeated calls to
`getnewaddress` will return addresses for sequential keys. This has the
added benefit that the sequence of `getnewaddress` outputs will be the
same after restoring from a backup.
2022-02-10 21:26:29 +00:00
Jack Grigg 2555aadf31 wallet: Store internal transparent keys in the keypool
Now that the keypool is not used by any consumers of external
transparent keys, we switch it to only contain internal keys. To handle
the impedance mismatch, we clear out the keypool when a mnemonic seed is
generated for the wallet.
2022-02-10 21:26:29 +00:00
Jack Grigg 11e62fa997 wallet: Remove `CWallet::GetKeyFromPool`
Legacy transparent addresses for external use are now obtained directly
via `GenerateNewKey(true)`.
2022-02-10 21:26:29 +00:00
Kris Nuttycombe d1227b086e
Merge pull request #5525 from nuttycom/feature/wallet_unified_addresses-ua_belongs_to_wallet
Add unified address support to PaymentAddressBelongsToWallet and GetSourceForPaymentAddress
2022-02-09 22:26:54 -07:00
Kris Nuttycombe 2aad87e147
Merge pull request #5526 from str4d/wallet-unified-addrs-in-rpcs
Handle wallet Unified Addresses in RPCs
2022-02-09 21:11:41 -07:00
Kris Nuttycombe 50ad6675a5 Address comments from review. 2022-02-09 20:56:00 -07:00
Jack Grigg 88dde127f4 wallet: Show UAs instead of Sapling receivers in `z_listunspent`
We also add a `type` field to the output objects (matching the field in
`z_viewtransaction`), now that the output type can't be distinguished
solely from the address encoding.
2022-02-10 02:32:56 +00:00
Kris Nuttycombe f320a6cc24 Add unified address support to GetSourceForPaymentAddress 2022-02-09 18:59:13 -07:00
Kris Nuttycombe d2e8b98364 Implement PaymentAddressBelongsToWallet for unified addresses. 2022-02-09 18:22:14 -07:00
Jack Grigg 0a9c27e8f2 wallet: Don't show Sapling receivers from UAs in `z_listaddresses`
This API is deprecated in favour of `listaddresses`, so we aren't going
to extend it with UA support.
2022-02-10 01:09:46 +00:00
Kris Nuttycombe d24a41496a Clarify documentation of z_getbalanceforviewingkey for Sprout viewing keys. 2022-02-09 17:03:24 -07:00
Kris Nuttycombe bf79be2b57 Replace z_getbalanceforaddress with z_getbalanceforviewingkey 2022-02-09 16:58:55 -07:00
Kris Nuttycombe 08dd842087
Merge pull request #5521 from nuttycom/fix_z_getbalance_locking
Fix locking in z_getbalanceforaddress and z_getbalanceforaccount
2022-02-09 12:30:25 -07:00
Kris Nuttycombe ae1b843b5a Fix locking in z_getbalanceforaddress and z_getbalanceforaccount 2022-02-09 10:48:12 -07:00
Larry Ruane 403c5846c1 fix minconf parsing for z_getbalanceforaccount and z_getbalanceforaddress 2022-02-08 22:58:45 -07:00
str4d 9439c79bab
Merge pull request #5469 from nuttycom/feature/wallet_unified_addresses-z_sendmany
Add support for unified addresses to z_sendmany
2022-02-08 23:42:59 +00:00
Kris Nuttycombe 1890758b27 Apply suggestions from code review.
Co-authored-by: str4d <thestr4d@gmail.com>
2022-02-08 10:59:15 -07:00
Kris Nuttycombe cf271473eb Apply suggestions from code review
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
Co-authored-by: str4d <thestr4d@gmail.com>
2022-02-07 16:52:31 -07:00
Kris Nuttycombe 13ee447a42 Merge branch 'test_wallet_listreceived' into feature/wallet_unified_addresses-z_sendmany 2022-02-07 15:08:35 -07:00
Larry Ruane 1e165b8396 allow UA as z_shieldcoinbase destination 2022-02-03 08:31:26 -07:00
Kris Nuttycombe 741ed52436 Fix nondeterministic test error (checking for the wrong error case). 2022-02-02 17:48:35 -07:00
Kris Nuttycombe a46720aab1 Add accessor method for Sapling IVKs to SaplingDiversifiableFullViewingKey 2022-02-01 08:24:31 -07:00
Kris Nuttycombe 2209a74f38 Fix a bug in the generation of addresses from UFVKs
The use of `std::optional` for the return type of the
`ZcashdUnifiedFullViewingKey::Address` operation obscured
a potential bug where the requested receiver types for a
unified address could not be satisfied because the UFVK
from which the address was being derived did not contain
all of the requested key types.
2022-02-01 08:24:31 -07:00
Kris Nuttycombe 90e59c3be0 Do not add Sapling addresses to the wallet by default when adding extfvks.
Adding the default address to the wallet automatically made sense
prior to support of diversified addresses, but this is no longer
desirable behavior as we have separated key generation from address
derivation.
2022-01-31 11:31:16 -07:00
Conrado Gouvea 269c5c2e7f Add comment to zcash_script_new_precomputed_tx about references to input buffers 2022-01-31 15:16:35 -03:00
Kris Nuttycombe 66530d97e1 Rename AddSaplingIncomingViewingKey -> AddSaplingPaymentAddress
This operation was poorly named; the wallet already contained
the IVK, and this operation was simply adding the ability to
look up the IVK by a specific diversified address derived
from that IVK.
2022-01-30 17:24:52 -07:00
Kris Nuttycombe b80349d246 GenerateLegacySaplingZKey only needs to return an address, not an extfvk. 2022-01-30 11:26:49 -07:00
Kris Nuttycombe ae2213dcdc Fix variable shadowing in change address derivation & add change IVK to the keystore. 2022-01-30 11:15:50 -07:00
Kris Nuttycombe acacc044fc Add gtest for change address derivation.
Check that derivation of the UFVK change address is consistent
irrespective of the path by which it is derived.
2022-01-30 11:09:06 -07:00
Kris Nuttycombe 91be2f1875 Simplify determination of valid change types. 2022-01-29 13:53:24 -07:00
Kris Nuttycombe b880ef8a1c Fix z_sendmany handling of transparent OVK derivation in the ANY_TADDR case. 2022-01-27 21:29:40 -07:00
Kris Nuttycombe 1733c6bc0c Use a BIP 44 change address for change when sending from legacy t-addrs. 2022-01-27 21:29:37 -07:00
Kris Nuttycombe b46d85976d Implement derivation of the internal Sapling spending key. 2022-01-27 21:27:43 -07:00
Kris Nuttycombe 3ddbe1fa06 Implement OVK selection for z_sendmany. 2022-01-27 21:27:43 -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
str4d 992a47103d
Merge pull request #5500 from str4d/ua-wallet-balance-rpcs
Implement balance RPC methods that support Unified Addresses
2022-01-27 20:11:38 +00:00
Kris Nuttycombe d17a0bb9de Merge remote-tracking branch 'upstream/master' into feature/wallet_unified_addresses 2022-01-25 20:27:33 -07:00
Jack Grigg 756f4fc840 wallet: Implement `z_getbalanceforaddress`
Closes zcash/zcash#5182.
2022-01-26 00:34:45 +00:00
Jack Grigg 77c46933aa wallet: Fix account generation bug
When generating a new account, we were setting up the map from account
ID to UFVK ID, but were not setting up the reverse map from UFVK ID to
account ID. The latter map is needed in order to verify that a note in
the wallet belongs to the account. We were correctly loading it from the
account metadata on node start, but between account generation and first
restart, z_getbalanceforaccount would always return zero.

We now initialize the UFVK address metadata map with the account ID when
the account is generated.
2022-01-26 00:02:58 +00:00
Jack Grigg ca0dad0a8c wallet: Implement `z_getbalanceforaccount`
Closes zcash/zcash#5183.
2022-01-25 23:54:30 +00:00
Kris Nuttycombe d8c818bfa5
Merge pull request #5464 from LarryRuane/2022-01-submitblock-log-soln-error
mining: submitblock: log detailed equihash solution error
2022-01-25 12:49:00 -07:00
Kris Nuttycombe 28eddb7c21
Merge pull request #5474 from LarryRuane/2022-01-disable-sprout-addr-gen
rpc: Disable Sprout address generation at Canopy #5368
2022-01-25 10:05:44 -07:00
Charlie O'Keefe 19bfc2f3b8
Merge pull request #5463 from zingolabs/drop_pyblake2_dep
Drop pyblake2 dependency
2022-01-25 09:32:08 -07:00
Kris Nuttycombe b93155c460 Add documentation for `UnifiedAddress::GetPreferredRecipientAddress` 2022-01-25 09:15:51 -07:00
Kris Nuttycombe db104a6329 Use `ZTXOSelector::IncludesSapling` rather than selector internals. 2022-01-25 09:13:08 -07:00
Kris Nuttycombe b8a5131af9 Clarify documentation of CWallet::FindAccountForSelector 2022-01-25 09:08:52 -07:00
Kris Nuttycombe beb0f2bc1f Make `FindSpendableInputs` respect `ZTXOSelector::RequireSpendingKeys()` 2022-01-25 09:00:28 -07:00
Kris Nuttycombe c15f6a9cad Rename ZTXOSelector::SpendingKeysAvailable -> RequireSpendingKeys 2022-01-25 07:39:22 -07:00
Kris Nuttycombe ddb34f612d Apply suggestions from code review
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
Co-authored-by: str4d <jack@electriccoin.co>
2022-01-24 20:01:41 -07:00
Kris Nuttycombe babc11eb52 Use libzcash::RecipientAddress for z_sendmany recipients. 2022-01-24 13:10:31 -07:00
Kris Nuttycombe 0abe07c73b Add RecipientAddress type. 2022-01-24 13:10:31 -07:00
Kris Nuttycombe 18282040f5 Add CWallet::FindAccountForSelector 2022-01-24 13:10:31 -07:00
Kris Nuttycombe c4a74087b7 Modify CWallet::FindSpendableInputs to use ZTXOSelector 2022-01-24 13:10:31 -07:00
str4d a6f9c9c0bc Merge pull request #5458 from nuttycom/cleanup/sendmany_txbuilder
Use the transaction builder to implement z_sendmany.
2022-01-21 20:14:58 -07:00
Kris Nuttycombe a43dbb4925 Replace `HaveSpendingKeyForAddress` with checks at ZTXOSelector construction. 2022-01-19 14:37:54 -07:00
Kris Nuttycombe e419899a29 Add support for unified addresses to CWallet::ToZTXOSelector 2022-01-19 13:53:33 -07:00
Kris Nuttycombe f850e89449 Replace the badly-named `PaymentSource` with `ZTXOSelector`
The ZTXOSelector type allows selection of previous Zcash
transaction outputs (both transparent outputs and shielded notes)
on the basis of either a (legacy) bare address, or for a
BIP-44 account.
2022-01-19 13:35:38 -07:00
Kris Nuttycombe c4a7f5c95c Move FindSpendableInputs to CWallet 2022-01-19 13:11:24 -07:00
str4d 6b335ecb4c
Merge pull request #5484 from str4d/5466-ua-validation
Fully-validate contents of UAs and UFVKs on parsing
2022-01-19 02:35:46 +00:00
Jack Grigg 714f14168c rust: Add missing checks for transparent UFVK items 2022-01-18 21:32:33 +00:00
Jack Grigg 9b61806cc6 rust: Add missing checks for shielded UFVK items 2022-01-18 21:32:32 +00:00
Jack Grigg f2e0a8d1f3 rust: Add missing Orchard receiver check in UA parsing
We didn't add it at the time because the necessary API did not exist in
the `orchard` crate. The API has since been added.
2022-01-18 21:31:52 +00:00
Jack Grigg 96c9333b74 wallet: Reverse order of arguments to z_getaddressforaccount
We now use the empty array of pools to indicate that the default pools
should be used when providing a diversifier index parameter, instead of
needing a default sentinel value for the diversifier index parameter
(which was previously suggested as '*' which would have caused issues
for defining a consistent type for that parameter).
2022-01-18 20:02:13 +00:00
Jack Grigg ff0e9f6b95 wallet: Show UAs owned by the wallet in `z_viewtransaction`
Part of zcash/zcash#5186.
2022-01-18 19:44:33 +00:00
Jack Grigg baaa3c4ac0 wallet: Implement `z_listunifiedreceivers`
Closes zcash/zcash#5181.
2022-01-18 19:44:33 +00:00
Jack Grigg 8617622e0d wallet: Implement `z_getaddressforaccount`
Closes zcash/zcash#5180.
2022-01-18 19:43:27 +00:00
Jack Grigg fe384eeb1f wallet: Implement `z_getnewaccount`
Closes zcash/zcash#5178.
2022-01-13 22:35:08 +00:00
Kris Nuttycombe cc392c70a6 Merge branch 'master' into feature/wallet_unified_addresses 2022-01-12 16:54:12 -07:00
Kris Nuttycombe 528ae6d180 Return z_sendmany errors synchronously when possible. 2022-01-12 10:45:58 -07:00
Kris Nuttycombe 0ca7d49626 Apply suggestions from code review
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
Co-authored-by: str4d <jack@electriccoin.co>
2022-01-12 10:45:46 -07:00
Kris Nuttycombe 9554ed2dc4 Require an explicit flag to allow cross-pool transfers in z_sendmany.
This adds an `allowRevealedAmounts` argument to z_sendmany. This
flag must be present to allow an amount-revealing cross-pool transfer
to be constructed.
2022-01-11 19:40:02 -07:00
Kris Nuttycombe 322aee238a Fix conditions around dust thresholds. 2022-01-11 19:40:02 -07:00
Kris Nuttycombe b54a63bf18 Transaction builder must not set consensus branch ID for V4 transactions. 2022-01-11 13:28:34 -07:00
Kris Nuttycombe f9477a4499 Use transaction builder for asyncrpcoperation_sendmany.
This replaces the old implementation of asyncrpcoperation_sendmany
with one where all transaction construction is delegated to the
transaction builder. The capabilities of z_sendmany are somewhat
modified in the process:

* z_sendmany now permits sending funds from a Sprout address to
  both transparent and Sapling addresses. PRIVACY NOTE: When
  user sends a Sprout->Sapling transaction, the amount of the
  transaction is publicly revealed.
* z_sendmany no longer supports transactions sending funds into
  the Sprout pool, with the exception of change amounts when
  sending from a Sprout address.
* When sending transparent coinbase funds to a set of shielded
  addresses, the amount sent to recipients must fully consume
  the input value and no change is permitted. This is a slightly
  weaker constraint than was previously implemented; in the past,
  only a single shielded recipient was allowed.
2022-01-11 13:28:34 -07:00
Larry Ruane bc1af5fc2d mining: submitblock: log detailed equihash solution error 2022-01-11 12:52:30 -07:00
zancas 30abf25148
update doctest in gtest suite to prefer hashlib 2022-01-11 10:32:18 -07:00
zancas fbbdb23214
blake2b/s is integrated into hashlib, drop external python package dependency 2022-01-11 10:16:22 -07:00
Kris Nuttycombe 951a44de93 Merge remote-tracking branch 'upstream/master' into cleanup/sendmany_txbuilder-prereq 2022-01-10 19:49:23 -07:00
Kris Nuttycombe 41eebce355 Apply suggestions from code review
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
Co-authored-by: str4d <jack@electriccoin.co>
2022-01-10 19:46:06 -07:00
Daira Hopwood 0e073a53ee Replace call to drop with zeroization.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2022-01-10 02:39:25 +00:00
Daira Hopwood 4f7d15508f Avoid a warning by explicitly calling drop.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2022-01-09 23:54:35 +00:00
Kris Nuttycombe d3b599eac1 Apply suggestions from code review
Co-authored-by: str4d <jack@electriccoin.co>
2022-01-07 11:49:09 -07:00
Kris Nuttycombe 864cd8622f Improve error messages in the case of taddr decoding failure. 2022-01-07 11:49:09 -07:00
Kris Nuttycombe 9702b47e2a Use libzcash::PaymentAddress instead of std::string in mergetoaddress 2022-01-07 11:49:09 -07:00
Kris Nuttycombe eb91c7869a Remove a use of KeyIO::DecodeDestination in z_shieldcoinbase 2022-01-07 11:49:09 -07:00
Kris Nuttycombe 20266ac911 Remove uses of KeyIO::DecodeDestination 2022-01-07 11:49:07 -07:00
Kris Nuttycombe d376e28382 Replace `DecodeDestination` in `GetMinerAddress` with `DecodePaymentAddress` 2022-01-06 22:29:44 -07:00
Kris Nuttycombe f5d4f6fef1 Remove `RawAddress`
This adds a new `AddrSet` type for use in note retrieval
as a filter, in place of a heterogeneous list of `RawAddress`
values. `RawAddress` will complicate the handling of addresses
within the wallet after the addition of unified addresses,
because it does not contain transparent receiver types, and
if we retain this polymorphism it means a lot of invalid states
are represented in places we don't want them to be. It's better
to figure out what types of addresses we're working with as soon
as possible after parsing, and use monomorphic calls from there
on in.
2022-01-06 22:29:41 -07:00
Kris Nuttycombe 4f2ff2a9f8 Remove spurious variant from asyncrpcoperation_sendmany
The `spendingkey_` field previously used by asyncrpcoperation_sendmany
caused a situation where call sites would assume the type of the
spending key based upon boolean flags that were derived elsewhere.
In attempting to support unified addresses, it is desirable to remove
these boolean deductions and instead work primarily based on the
direct evidence of the data at hand. This commit therefore removes
the `spendingkey_` field that could potentially produce results
that would disagree with these boolean values, in favor of such
direct evidence, making these call sites a bit less error prone.
2022-01-06 15:32:04 -07:00
Kris Nuttycombe 890e1d841d Add raw transparent address types to PaymentAddress
The addition of `UnifiedAddress` to the `PaymentAddress` type
introduced the need for methods that interact with payment addresses
to support transparent receivers as shielded ones, which is somewhat
inconsistent with previous uses of the `PaymentAddress` type.

This commit adds both `CKeyID` and `CScriptID` as new variants
of the `PaymentAddress` type. Following commits will shift encoding
and decoding to use the `PaymentAddress` type exclusively wherever
possible, rather than the current mix of `CDestination` and
`PaymentAddress` that complicates the wallet codebase.
2022-01-06 13:44:45 -07:00
Kris Nuttycombe c35e2b4438 Remove spurious uses of HaveSpendingKeyForPaymentAddress
There's no need to dispatch through this visitor in cases where
the payment address type is already statically known.
2022-01-06 13:44:45 -07:00
Kris Nuttycombe 62b86d6afc Use CKeyID and CScriptID instead of new P2PKH/P2SHAddress classes. 2022-01-06 13:44:45 -07:00
Kris Nuttycombe b305ad2892 Remove the `InvalidEncoding` type from key & address variants.
The presence of this variant results in a situation where more
of the code than necessary needs to be aware of and handle
decoding failures. This change moves all handling of decoding
failures to the point of decoding.
2022-01-06 13:44:45 -07: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
Kris Nuttycombe 0403799be2
Merge pull request #5454 from zcash/hotfix-v4.6.0-1
Hotfix v4.6.0-1
2022-01-05 18:15:33 -07:00
Jack Grigg 5bf937b422 make-release.py: Versioning changes for 4.6.0-1. 2022-01-05 20:16:10 +00:00
Jack Grigg 4559186596 rpc: Fix regression in getblocktemplate output
We added support for the NU5 consensus rules in v4.5.0, which alters the
block header to contain a `hashBlockCommitments` value instead of the
chain history root. However, the output of `getblocktemplate` wasn't
returning this value; once NU5 activated, the `blockcommitmentshash`
field was being set to "null" (all-zeroes).

In v4.6.0 we added full NU5 support to `getblocktemplate`, by adding a
`defaultroots` field that gave default values for `hashBlockCommitments`
and the components required to derive it. However, in doing so we
introduced a regression in the (now-deprecated) legacy fields, where
prior to NU5 activation they contained nonsense.

This commit fixes the output of `getblocktemplate` to have the intended
semantics for all fields:

- The `blockcommitmentshash` and `authdataroot` fields in `defaultroots`
  are now omitted from block templates for heights before NU5 activation.

- The legacy fields now always contain the default value to be placed
  into the block header (regaining their previous semantics).

Co-authored-by: Larry Ruane <larry@z.cash>
2022-01-05 12:07:46 +00:00
Larry Ruane dfefab2f55 test: check getblocktemplate output before and after NU5
This test currently fails with submitblock returning the error
"bad-heartwood-root-in-block".

Added authdigest to GBT coinbasetxn field because we can't obtain this
via getrawtransaction.

Co-authored-by: Jack Grigg <jack@z.cash>
2022-01-05 12:07:46 +00:00
str4d 1d7a29ea56
Merge pull request #5395 from nuttycom/feature/wallet_orchard-unified_addrs
Add unified addresses to the zcashd wallet.
2022-01-05 02:30:30 +00:00
Kris Nuttycombe eb53abbbaf Apply suggestions from code review
Co-authored-by: str4d <jack@electriccoin.co>
2022-01-04 16:29:53 -07:00
Kris Nuttycombe ad54591061 Improve documentation of UFVK/UA metadata storage semantics. 2022-01-04 16:29:28 -07:00
Kris Nuttycombe 8d6d178a47 Use Bip44TransparentAccountKeyPath() for Bip44AccountChains keypath construction. 2022-01-04 16:29:28 -07:00
Kris Nuttycombe 16ba83ab1e Make `FindAddress` correctly check for maximum transparent child index.
ZcashdUnifiedFullViewingKey::FindAddress was previously not checking
that the transparent child index did not overflow in unified address
generation. GenerateUnifiedAddress has been modified to search from
the last known diversifier index if no diversifier is specified, and
boundary conditions for transparent addresses are now correctly handled.
2022-01-04 16:29:28 -07:00
Kris Nuttycombe 5d07a8ae79 Apply suggestions from code review
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2021-12-30 10:53:51 -07:00
Steven Smith 56b706d5c7 Lock cs_main prior to calling blockToJSON 2021-12-29 21:22:19 -08:00
Marius Kjærstad bf1cc206c0
Update copyright year to 2022 2021-12-27 00:30:51 +01:00
Kris Nuttycombe 74e4bef6f2 Ensure that unified address metadata is always correctly populated.
This reworks the way that address metadata is added to the wallet
to make adding address metadata to the wallet's in-memory cache
the responsibility of a single method rather than distributed
across multiple places in the code.
2021-12-23 09:33:17 -07:00
Sasha baa3de9250 make-release.py: Versioning changes for 4.6.0. 2021-12-23 00:13:51 +00:00
Kris Nuttycombe ad5c4dcf09 Remove unused ufvkid argument from AddTransparentSecretKey
All of the necessary relationships between transparent receivers
and UFVKs are set up by `AddUnifiedAddress`, so there's no
need to do so as part of transparent key management otherwise.
2021-12-22 16:09:17 -07:00
Kris Nuttycombe 900cd50741 Rename `ZcashdUnifiedSpendingKeyMetadata` -> `ZcashdUnifiedAccount`
Also, fix a couple of minor documentation issues and
make UA generation tests a little more robust.
2021-12-22 16:09:17 -07:00
Kris Nuttycombe 24e46a16f1 Only derive ZcashdUnifiedFullViewingKey from UnifiedFullViewingKey
This changes ZcashdUnifiedSpendingKey::ToUnifiedFullViewingKey
to return a `UnifiedFullViewingKey` object. This makes the
derivation of ZcashdUnifiedFullViewingKey values more regular,
removing the need to be able to construct these values directly
from the spending key.

This change also modifies ZcashdUnifiedSpendingKey to remove
the `std::optional` wrapper from its member keys. This
optionality is spurious, because it is always possible to
derive a "complete" spending key, and we do not support
import of unified spending keys.
2021-12-22 16:09:17 -07:00
Kris Nuttycombe 735ecd0906 Apply suggestions from code review
Co-authored-by: str4d <jack@electriccoin.co>
2021-12-22 15:57:47 -07:00
Kris Nuttycombe 9b72fff365 Fix handling of unified full viewing key metadata.
This fixes two issues with the management of unified full viewing
key metadata:
* Adds a reverse mapping from ufvkid to account id.
* Ensures that UFVK metadata is correctly initialized when USK
  metadata is loaded from disk.
2021-12-22 15:57:47 -07:00
Kris Nuttycombe b34fd6a816 Add test for CKeyStore::AddUnifiedAddress 2021-12-22 15:57:47 -07:00
Kris Nuttycombe 009ba76b0e Add test for wallet UA generation & detection. 2021-12-22 15:57:47 -07:00
Kris Nuttycombe 700b98f0b0 Add tests for keystore storage and retrieval of UFVKs. 2021-12-22 15:57:47 -07:00
Kris Nuttycombe 0dcdc28a38 Add CWallet::GetUnifiedForReceiver 2021-12-22 15:57:47 -07:00
Kris Nuttycombe 8337442553 Add newly generated transparent UA receivers to the wallet. 2021-12-22 15:57:47 -07:00
Kris Nuttycombe 290985ba48 AddTransparentSecretKey does not need to take a CExtKey 2021-12-22 15:57:47 -07:00
Kris Nuttycombe b29ca10b8d Add unified address generation.
Generate unified addresses from UFVKs, and add the associated
metadata to the wallet database.
2021-12-22 15:57:47 -07:00
Kris Nuttycombe ca20cf512c Add key metadata to walletdb. 2021-12-22 15:57:47 -07:00
Kris Nuttycombe d869d7f4a3 Load unified full viewing keys from the walletdb. 2021-12-22 15:57:47 -07:00
Kris Nuttycombe e56f252a86 Add unified address tracking to KeyStore 2021-12-22 15:55:36 -07:00
Kris Nuttycombe ef068c51a9 Store ufvks to the wallet database. 2021-12-22 15:55:36 -07:00
Larry Ruane b538577359 test: Use result of getblocktemplate to submitblock
This will ensure that miners can use the values returned by
getblocktemplate (in particular, the block commitment hash)
to submit a valid block using the submitblock RPC.
2021-12-22 15:35:46 -07:00
str4d 3acc68548e
Merge pull request #5300 from LarryRuane/feature/wallet_orchard
Feature/wallet orchard UA RPCs
2021-12-20 20:31:10 +00:00
Jack Grigg d4b850d3f7 make-release.py: Versioning changes for 4.6.0-rc1. 2021-12-18 04:23:05 +00:00
Jack Grigg d85bfb4744 Migrate to latest revisions of Zcash Rust crates 2021-12-18 01:44:27 +00:00
Kris Nuttycombe 8b093a79da
Merge pull request #5402 from LarryRuane/2021-12-getblocktemplate
Add defaultroots field to getblocktemplate
2021-12-17 12:28:06 -07:00
MarcoFalke 6d60f1a9c9 [rpc] mining: Omit uninitialized currentblockweight, currentblocktx
zcash/zcash:
The `getmininginfo` RPC now omits `currentblockize` and `currentblocktx`
when a block was never assembled via RPC on this node during its current
process instantiation. The relevant RPCs are `generate` (regtest only) and
`getblocktemplate`. Blocks are also assembled when running the internal
miner (`zcashd -gen=1`), after the node mines its first block.

(cherry picked from commit bitcoin/bitcoin@fa178a6385)
2021-12-17 09:35:30 -07:00
Larry Ruane c937ba5ae5 getblocktemplate: add NU5 commitments to new `defaultroots` section
- merkleroot
- authdataroot
- chainhistoryroot
- blockcommitmentshash
2021-12-16 18:52:04 -07:00
Kris Nuttycombe 5c2d91589f
Merge pull request #5427 from str4d/5321-remove-misleading-log-message
rust: Remove misleading log message
2021-12-16 17:44:49 -07:00
str4d 34a8677c43
Merge pull request #5403 from LarryRuane/2021-12-nuparams
test: automatically add missing nuparams (network upgrade heights)
2021-12-17 00:42:04 +00:00
Jack Grigg 1b7a031e7b rust: Remove misleading log message
We use the `zcash_address` crate to parse Unified Addresses (which we
currently do nothing with). That crate returns an `UnsupportedAddress`
error for unhandled address kinds, which we were previously logging.
However, we _do_ support the other address kinds; we just parse them in
the C++ code.

Closes zcash/zcash#5321.
2021-12-16 22:22:05 +00:00
Kris Nuttycombe ceeede3dc6
Merge pull request #5422 from LarryRuane/2021-12-getspentindex-logging
Dont log ERROR: spent index not enabled
2021-12-16 12:58:10 -07:00
Kris Nuttycombe 99b2098f89 Batch-verify Orchard transactions at the block level.
Fixes #5316
2021-12-16 08:58:14 -07:00
Larry Ruane f139cdc4fe Add new and modify existing Orchard RPCs, non-functional
The new RPCs aren't functional, only have argument parsing and sample
outputs, guarded by experimental -orchardwallet flag.

These changes used the tickets linked from
https://github.com/zcash/zcash/issues/5056 as a guide.
2021-12-15 16:40:23 -07:00
Kris Nuttycombe 6d36921b94 Add unified key components to the transparent & Sapling wallet parts. 2021-12-15 13:53:10 -07:00
Kris Nuttycombe 24ff7b36ec Add ZcashdUnifiedKeyMetadata and libzcash::ReceiverType 2021-12-15 13:53:10 -07:00
Kris Nuttycombe 4966bf315a Compute key id for UFVKs. 2021-12-15 13:53:10 -07:00
Kris Nuttycombe 6f702c72a7
Merge pull request #5421 from nuttycom/feature/wallet_unified_addresses-mnemonic_seed_init_validation
Check the output of zip339_phrase_to_seed in MnemonicSeed initialization.
2021-12-15 12:21:15 -07:00
Kris Nuttycombe 00bda351f8 Check the output of zip339_phrase_to_seed in MnemonicSeed initialization.
zip339_phrase_to_seed will return `false` if the string it is being
used to convert to a seed is not valid UTF-8, but this result was
previously unchecked.

Fixes #5399
2021-12-15 08:21:44 -07:00
Larry Ruane d0e836a15e Don't log 'ERROR: spent index not enabled' 2021-12-15 07:53:26 -07:00
Kris Nuttycombe 48446b5e39 Add functions for generating BIP-44 and ZIP-32 keypaths 2021-12-14 15:10:27 -07:00
Larry Ruane cc70cd2c46 add -orchardwallet experimental feature flag
Also, temporarily don't allow -orchardwallet if running mainnet.
2021-12-14 14:42:08 -07:00
Larry Ruane d0b85b69f3 add ParseArbitraryInt() for diversifier index 2021-12-14 14:42:08 -07:00
Kris Nuttycombe 1e18410b55 Apply suggestions from code review
Co-authored-by: str4d <jack@electriccoin.co>
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2021-12-14 13:02:41 -07:00
Kris Nuttycombe d1890ebd24 Apply suggestions from code review
Co-authored-by: str4d <jack@electriccoin.co>
2021-12-13 21:03:36 -07:00
Kris Nuttycombe 6cccc4ad3c Apply suggestions from code review
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2021-12-13 18:53:27 -07:00
Kris Nuttycombe 8ae8ddd7d1 Add tests for ufvk roundtrip serialization. 2021-12-13 18:53:27 -07:00
Kris Nuttycombe 22cd218e83 Apply suggestions from code review
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2021-12-13 18:53:27 -07:00
Kris Nuttycombe 217c56811d Add UnifiedFullViewingKey type.
This type is backed by the `zcash_address` implementaion of
unified full viewing keys. It is intended for serialization
and parsing of UFVKs, and provides conversion functions that
allow for construction to and from ZcashdUnifiedFullViewingKey
values.
2021-12-13 18:53:27 -07:00
Kris Nuttycombe c78887a148 Add Rust FFI components for unified full viewing keys. 2021-12-13 18:53:27 -07:00
Kris Nuttycombe 4257abd328 Adds SaplingDiversifiableFullViewingKey
Adds SaplingDiversifiableFullViewingKey as a superclass of
SaplingExtendedFullViewingKey, and reduces the Sapling component
of UnifiedFullViewingKey to the new intermediate type. This
permits deserialization from the data that will be present
in the serialized form of the Sapling component of a UFVK.
2021-12-13 18:53:25 -07:00
Kris Nuttycombe 640f31463f Update to ufvk zcash_address build. 2021-12-13 18:51:15 -07:00
Larry Ruane 7fa0e1a6a9 test: automatically add missing nuparams
This test-only change allows python (rpc) tests to specify, for example,
that NU5 should be activated at height X, without having to specify all
the previous network upgrades. Previous upgrades can (and must) still be
specified if they activate at different block heights (than, in this
example, NU5). This makes tests easier to write (and read), especially
as the number of network upgrades increases over time.

Note that this change only affects zcashd behavior in regtest mode. For
the other network modes (testnet and mainnet), the activation heights
are hard-coded in chainparams.cpp.
2021-12-06 17:32:18 -07:00
Kris Nuttycombe 3bfb9d0c84 Remove ZcashdUnifiedAddress in favor of UnifiedAddress 2021-11-30 12:58:29 -07:00
Kris Nuttycombe a2f8e3b56c Use CKeyID and CScriptID instead of new P2PKH/P2SHAddress classes. 2021-11-30 11:24:37 -07:00
Kris Nuttycombe d65200c860 Refine structure of Zcash address generation.
This commit does not include functional changes; it merely
breaks up content previously included in `zcash/address/zip32.h`
into smaller and more focused components.
2021-11-30 11:22:37 -07:00
Kris Nuttycombe 782c705cb1 Remove Orchard spending key equality implementation. 2021-11-29 14:26:25 -07:00
Kris Nuttycombe bde245d8bc
Remove incorrect FFI method documentation.
Co-authored-by: str4d <jack@electriccoin.co>
2021-11-29 13:08:30 -07:00
Kris Nuttycombe 6ee0dea218 Apply suggestions from code review
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2021-11-26 08:41:52 -07:00
Kris Nuttycombe 59a4c84112 Adds Orchard Address, IncomingViewingKey, FullViewingKey, and SpendingKey types. 2021-11-24 19:08:17 -07:00
Kris Nuttycombe 8f5591a9c1 Add libzcash::AccountId type. 2021-11-24 18:59:25 -07:00
Kris Nuttycombe 9202b127d0 Merge remote-tracking branch 'upstream/master' into feature/wallet_orchard 2021-11-23 18:38:07 -07:00
Kris Nuttycombe f49f4c73d8 Rename OrchardMerkleTree -> OrchardMerkleFrontier
Remove IncrementalSinsemillaTree; this will be replaced by
a more full-featured OrchardWallet type which embeds the
incremental merkle tree used in wallet operations.
2021-11-23 07:27:34 -07:00
str4d f8e99e7ba5
Merge pull request #5373 from ZcashFoundation/lib-zcash-script-sigops
Add legacy sigops counts to the zcash_script library API
2021-11-22 16:03:48 +00:00
Kris Nuttycombe 14f95572fa
Improve documentation of the `-walletrequirebackup` zcashd wallet configuration option. 2021-11-18 15:05:46 -07:00
Kris Nuttycombe 92445ba0a5 Apply suggestions from code review
Co-authored-by: str4d <jack@electriccoin.co>
2021-11-18 10:54:12 -07:00
Jack Grigg 675e489aff rust: Move `incremental_sinsemilla_tree_ffi` into crate root
Having this be a submodule of `orchard_ffi` while following Rust 2018
module structure made it impossible to use the `include!` macro on
`orchard_ffi.rs`, which is exactly what the `zcash_script` crate does.
See this comment for details:
    https://github.com/rust-lang/rust/issues/50132#issuecomment-969450868

To resolve this, we restructure the FFI library crate to only have FFI
methods in "leaf" module files.
2021-11-18 11:40:16 +00:00
Kris Nuttycombe 2ec7073459 Fix error message text to refer to zcashd-wallet-tool rather than the RPC method. 2021-11-17 18:03:11 -07:00
Kris Nuttycombe b1d6a514e2 Parameterize HD keypath parsing by coin type. 2021-11-17 18:01:28 -07:00