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
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
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
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
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