Kris Nuttycombe
6cf0749ac9
Merge remote-tracking branch 'upstream/master' into autoshield-poc-reorder
2021-10-01 11:03:41 -06:00
Kris Nuttycombe
db89569b90
Address documentation & naming requests from code review.
2021-10-01 11:03:09 -06:00
Kris Nuttycombe
2053d7f57b
Always take number of confirmations as a parameter.
2021-10-01 11:00:50 -06:00
Jack Grigg
65e1d32774
ff 0.11, group 0.11, etc.
2021-09-09 18:20:37 +01:00
Kris Nuttycombe
edd7471d90
Merge remote-tracking branch 'upstream/master' into autoshield-poc-daa
2021-08-27 11:08:50 -06:00
Jack Grigg
ecb82ed813
nom 7
2021-08-23 20:15:51 +01:00
Kris Nuttycombe
b783c4d0e7
Merge remote-tracking branch 'upstream/master' into autoshield-poc-daa
2021-08-12 11:21:30 -06:00
Jack Grigg
0facec094f
Update changelogs with `EphemeralKeyBytes` changes
2021-08-09 21:45:16 +01:00
Jack Grigg
279a8b6bb6
Use `EphemeralKeyBytes` type in place of `[u8; 32]`
2021-08-09 21:28:42 +01:00
Jack Grigg
83c6a2d1ca
Store OutputDescription `ephemeral_key` as bytes
...
This removes an unnecessary `to_bytes` during trial decryption of notes,
and more closely matches the protocol spec. We retain the consensus rule
canonicity check on epk due to `SaplingVerificationContext::check_output`
taking a `jubjub::ExtendedPoint`, forcing `zcashd` to parse the bytes.
2021-08-06 16:54:48 +01:00
Jack Grigg
0f15743200
Disable default benchmark harness for all workspace crates
...
This is necessary in order to provide criterion-specific arguments to
`cargo bench`, such as `--profile-time`.
2021-08-05 22:39:36 +01:00
Kris Nuttycombe
1a5aad723b
Use generalized signature_hash for transaction builder.
2021-06-04 15:45:39 -06:00
Kris Nuttycombe
55d1090f70
Add v5 txid & signature hashing.
2021-06-04 15:45:39 -06:00
Jack Grigg
1222391dd7
Migrate to bitvec 0.22, ff 0.10, etc.
...
Requires patching three dependencies:
- bellman is pending a new release.
- nom is part of the funty breakage; we are blocking on a new release.
- orchard is in development.
2021-06-04 22:02:48 +01:00
Kris Nuttycombe
523424e50b
Move Transparent components to a bundle within TransactionData
2021-06-03 18:46:38 -06:00
Kris Nuttycombe
84e8952ec3
Move Sapling components to a bundle within TransactionData
2021-06-03 18:46:38 -06:00
Kris Nuttycombe
72ac97a35f
Derive transaction version & branch id from target height.
2021-06-02 13:45:29 -06:00
Kris Nuttycombe
8267d06846
Refactor transaction builder to create separate builders for each section.
2021-06-02 11:48:46 -06:00
Kris Nuttycombe
76999eb5c7
Make txid contents private & use txid for TzeOutPoint
2021-06-01 07:03:31 -06:00
Kris Nuttycombe
4efb21d1c7
Make amount addition and subtraction traits use checked operations.
2021-06-01 07:03:31 -06:00
Jack Grigg
5623e02a7c
Migrate to ff 0.9 et al.
2021-05-19 18:29:37 +01:00
Kris Nuttycombe
fd47ee3652
Fix missing method in in-memory wallet prototype.
2021-05-14 15:09:36 -06:00
Kris Nuttycombe
8e3e7de50c
Minor code cleanup.
2021-05-14 14:17:42 -06:00
Kevin Gorham
c1bc06964f
Add get_all_nullifiers.
2021-04-16 14:27:18 -06:00
Kevin Gorham
bb68744df1
Ensure that rewinds go far enough to properly restore incremental witness state.
2021-04-16 14:27:18 -06:00
Kris Nuttycombe
9b3025de4d
Add ZIP-321 request based sends to zcash_client_backend.
2021-04-16 14:26:53 -06:00
Kevin Gorham
8e16d93f94
Update accounts table create statement.
...
This PR makes the opinionated change that T-addrs are required
to be supported when using the zcash_client_sqlite backend.
2021-04-16 14:26:53 -06:00
Kevin Gorham
5595ca225c
Add public key derivations and related tests.
2021-04-16 14:26:53 -06:00
Kris Nuttycombe
665c4c7aff
Figure out the account ID for z->t spends.
2021-04-16 14:26:53 -06:00
Kris Nuttycombe
13cd7498b7
Store vout as part of store_decrypted_tx
2021-04-16 14:26:53 -06:00
Kris Nuttycombe
8828276361
Query for unspent utxos checks to ensure that spending tx is mined.
...
Also make it an error to try to send a memo to a transparent address.
2021-04-16 14:26:51 -06:00
Kris Nuttycombe
b88ee47e36
Add confirmation depth to shield_funds
2021-04-16 14:23:28 -06:00
Kris Nuttycombe
a3bc1e3e63
Rename get_spendable -> get_unspent
2021-04-16 14:23:28 -06:00
Kris Nuttycombe
ca3e3a4595
Add WIF derivation for transparent keys.
...
With @gmale
2021-04-16 14:23:28 -06:00
Kris Nuttycombe
862e221a9b
Put transparent dependencies behind a feature flag.
2021-04-16 14:23:26 -06:00
Francisco Gindre
cff457ff15
PoC Auto-Shielding
...
Add retrieval of transparent UTXOs to WalletRead
Co-authored-by: Kris Nuttycombe <kris@electriccoin.co>
Co-authored-by: Kevin Gorham <anothergmale@gmail.com>
2021-04-16 14:22:16 -06:00
Kris Nuttycombe
12cb8265d8
Fix formatting.
2021-04-12 18:47:45 -06:00
Kris Nuttycombe
fae1a1517a
Simplify try_sapling_output_recovery.
2021-04-12 18:40:17 -06:00
Kris Nuttycombe
324fc36521
Use ShieldedOutput trait for note encryption/decryption.
...
This change modifies note encryption and decryption functions
to treat a shielded output as a single value instead of handling
the parts of an output as independent arguments.
2021-04-12 12:59:06 -06:00
Kris Nuttycombe
cfdbafe2e3
Add myself to crate contributors.
2021-04-08 10:13:04 -06:00
Kris Nuttycombe
e77839232d
Generalize note encryption and decryption.
...
This commit introduces a `Domain` trait which defines the types
and operations that are shared between Sapling and Orchard note
encryption and decryption processes.
2021-04-08 08:19:10 -06:00
Kris Nuttycombe
5baccdf052
Move note_encryption into the sapling module.
2021-04-08 08:19:10 -06:00
Jack Grigg
63db2729e9
Temporarily allow clippy::result_unit_err lint
...
Fixing these lints is deferred to zcash/librustzcash#367 .
2021-03-27 19:01:03 +13:00
Jack Grigg
56b577b31e
clippy: Fix small lints
2021-03-27 19:01:03 +13:00
Jack Grigg
636845d0f9
Renames to use lower-case abbreviations (matching Rust convention)
...
As of our MSRV bump to 1.51.0, we get lints for this.
2021-03-27 19:01:03 +13:00
Jack Grigg
8ac663f116
Fix some doctests and intra-doc links after moving Sapling primitives
2021-03-27 17:10:18 +13:00
Kris Nuttycombe
33effb7d67
Move sapling keys into sapling module.
2021-03-27 16:18:21 +13:00
Kris Nuttycombe
4086df772c
Move sapling-specific primitives into the sapling module.
2021-03-27 16:18:21 +13:00
Kris Nuttycombe
88d58aac0a
Move relevant utils into sapling module.
2021-03-27 16:18:21 +13:00
Kris Nuttycombe
16948d9d78
Move zcash_primitives::prover to sapling module
2021-03-27 16:18:21 +13:00
Jack Grigg
38f7a0330c
Fix various clippy lints
...
The remainder will be fixed after the refactor PRs are merged.
2021-03-27 08:50:40 +13:00
Jack Grigg
9d9c0579f8
Use new name for broken_intra_doc_links lint
...
We also add the lint to crates in the workspace that didn't have it.
Closes zcash/librustzcash#279 .
2021-03-27 08:27:17 +13:00
Jack Grigg
afa0b29e62
Bump MSRV to 1.51.0
...
This is the MSRV for the orchard crate, which we will be depending on
soon.
2021-03-27 08:21:45 +13:00
Jack Grigg
4ff0a81a7f
zcash_client_sqlite 0.3.0
2021-03-26 19:01:04 +13:00
Jack Grigg
acc650cc17
zcash_client_backend 0.5.0
2021-03-26 18:54:42 +13:00
Jack Grigg
813525f0b5
zcash_proofs 0.5.0
2021-03-26 18:53:42 +13:00
Jack Grigg
725699c76b
zcash_primitives 0.5.0
2021-03-26 18:51:35 +13:00
Kris Nuttycombe
f30502c5a2
Apply suggestions from code review
...
Co-authored-by: str4d <jack@electriccoin.co>
2021-03-25 21:24:24 -06:00
str4d
dd15e5f431
Add missing doc link
2021-03-26 15:10:39 +13:00
Kris Nuttycombe
fc3aa233e8
Update ZIP 321 parsing to use the MemoBytes type.
2021-03-26 14:47:15 +13:00
str4d
d73483f5da
Minor fixes to documentation
2021-03-26 14:18:01 +13:00
Jack Grigg
c3c7bd1d9c
bech32 0.8
2021-03-26 13:31:20 +13:00
Kris Nuttycombe
a0c441817a
Documentation fixes in zcash_client_backend.
2021-03-25 18:26:57 -06:00
Jack Grigg
675048e52b
Fix broken intra-doc links and lints
2021-03-26 10:07:20 +13:00
str4d
5e0e44a388
Merge pull request #354 from nuttycom/changelog/346_sapling_ivk
...
Add SaplingIvk newtype to changelogs.
2021-03-26 10:07:01 +13:00
str4d
1bea40de88
zcash_client_backend: Add ScanningKey trait to changelog
2021-03-26 10:06:30 +13:00
Kris Nuttycombe
c41c71c514
Apply suggestions from code review
...
Co-authored-by: str4d <thestr4d@gmail.com>
2021-03-25 15:00:54 -06:00
Kris Nuttycombe
42f15a575e
Merge pull request #359 from str4d/356-create_spend_to_address-assumption
...
zcash_client_backend: Use correct output index for t-addr recipients
2021-03-25 07:58:53 -06:00
Kris Nuttycombe
9b1156bf49
Fix rustfmt complaint.
2021-03-25 07:40:02 -06:00
Jack Grigg
678f1b6734
zcash_client_backend: Make transparent output indexing resilient
...
It's cheap to scan all transparent outputs to find the output matching
a transparent recipient.
2021-03-25 21:53:47 +13:00
Jack Grigg
6f93530554
zcash_client_backend: Remove unnecessary type conversion
2021-03-25 21:45:40 +13:00
Kris Nuttycombe
ebdd6cf976
Add SaplingIvk newtype to changelogs.
2021-03-24 18:39:21 -06:00
Jack Grigg
cb6a993840
zcash_client_backend: Use correct output index for t-addr recipients
...
`create_spend_to_address` was originally written only for sending to
Sapling addresses. It was later amended to support sending to
transparent addresses, but the assumption about there being a Sapling
output was not removed. This was not an issue for most transactions
because there would be change, but in the case of a z->t transaction
with no change, `create_spend_to_address` would reliably panic.
This commit fixes the bug by setting the output index for transparent
recipients to 0. The `output_index` field of `SentTransaction` is also
documented to correctly reflect its dependency on the type of
`recipient_address`.
2021-03-24 19:01:35 +13:00
Jack Grigg
46872e2590
Update changelogs with Memo changes
2021-03-18 10:00:27 +13:00
Jack Grigg
8a84203685
Remove Default impl from MemoBytes
...
Memo fields have two ways to encode an empty memo:
- 0xF6 followed by all-zeroes, encoding "there is no memo".
- All-zeroes, encoding the empty UTF-8 string.
In almost all cases you want the former, but users thinking about byte
slices may expect MemoBytes::default() to result in the latter. To
ensure clarity, we now require calling either MemoBytes::default() or
MemoBytes::from_bytes(&[]) to be explicit.
No such confusion exists for the Memo enum, because the two types are
visibly separated as different enum cases, and Memo::Empty makes sense
as the default.
2021-03-17 21:16:01 +13:00
Jack Grigg
c7a3ef0e88
Split memo-handling into MemoBytes struct and Memo enum
...
The MemoBytes struct is a minimal wrapper around the memo bytes, and only
imposes the existence of null-padding for shorter memos. The only error
case is attempting to construct a memo that is too long. MemoBytes is
guaranteed to be round-trip encodable (modulo null padding).
The Memo enum implements the additional memo rules defined in ZIP 302,
interpreting the contents of a memo (for example, parsing it as text).
2021-03-17 21:05:50 +13:00
Jack Grigg
48f7ef84a4
Move Memo into zcash_primitives::memo
2021-03-17 19:58:40 +13:00
Kris Nuttycombe
2b4951759c
Fix welding rig intra-doc links.
2021-03-15 17:59:23 -06:00
Kris Nuttycombe
5a9b29a75a
Address comments from code review.
2021-03-11 13:01:22 -07:00
Kris Nuttycombe
0e022f2283
Allow block scanning using either IVKs or FVKs.
2021-03-09 21:00:40 -07:00
Kris Nuttycombe
16289750e8
Remove WalletWrite::transactionally
2021-03-09 20:59:57 -07:00
Kris Nuttycombe
a74cc8b231
Remove sqlite-specific data organization from data access api.
2021-03-09 20:59:57 -07:00
Kris Nuttycombe
b5bbbb6f5a
Factor out nullifier update from database actions in scan_cached_blocks
2021-03-09 20:59:57 -07:00
Jack Grigg
463e252af4
Fix more intra-doc links
2021-03-04 23:01:42 +00:00
Jack Grigg
464b533937
Bump MSRV to 1.47.0
...
We'll be needing it shortly for ff et al.
2021-03-04 17:32:57 +00:00
Jack Grigg
5431e1ef6b
nom 6.1
2021-03-04 17:03:41 +00:00
Jack Grigg
5242718b8f
bs58 0.4
2021-03-04 17:03:14 +00:00
Jack Grigg
d510eb50fd
base64 0.13
2021-03-04 17:02:34 +00:00
str4d
36e4b0d51a
Merge pull request #329 from nuttycom/ivk_payment_addresses
...
Introduce SaplingIvk newtype & use IVKs where possible.
2021-03-04 07:04:05 +13:00
Jack Grigg
1f6f45bbe7
Add details of unreleased changes to changelogs
2021-02-22 16:59:07 +00:00
str4d
9f14c757e6
Merge pull request #340 from str4d/changelogs
...
Add changelogs to the crates
2021-02-14 02:34:20 +13:00
Kris Nuttycombe
f0f4f58b2b
Fix generation of zip321 URIs for proptest to avoid generating invalid ones.
2021-02-04 08:32:00 -07:00
Jack Grigg
bd3e18984c
Changelogs: s/project/library
2021-02-04 15:16:32 +00:00
Jack Grigg
b5c7d7f1e7
Add changelogs to the crates
...
The changelogs are accurate for the 0.4.0 release tag, but don't yet
include changes before or after that tag.
2021-02-04 15:13:22 +00:00
Kris Nuttycombe
1cc7949518
Rename CommitmentTree::new -> CommitmentTree::empty
2021-02-04 07:49:48 -07:00
Kris Nuttycombe
98530184c0
Fix clippy complaints.
2021-02-03 14:27:31 -07:00
Kris Nuttycombe
7a57aee530
Introduce SaplingIvk newtype & use IVKs where possible.
...
This includes making it possible to obtain a payment address from just the IVK + diversifier.
2021-02-02 15:27:13 -07:00
Kris Nuttycombe
5cb48fa962
Fix documentation of get_received_note
2021-02-02 13:16:16 -07:00
Kris Nuttycombe
df09877b11
Use an enum to distinguish between sent and received notes in sqlite backend.
2021-01-20 10:51:27 -07:00
Kris Nuttycombe
7f43b05e21
Update protobuf dependency version.
2021-01-19 13:01:51 -07:00