Commit Graph

1911 Commits

Author SHA1 Message Date
Kris Nuttycombe d2402f4861
Apply changelog suggestions.
Co-authored-by: str4d <jack@electriccoin.co>
2021-06-02 16:58:08 -06:00
Kris Nuttycombe b487a7f820 Sapling builder can store network params. 2021-06-02 16:57:27 -06:00
Kris Nuttycombe 4878b5b19b Address comments from review. 2021-06-02 16:48:55 -06:00
str4d c13a5d3f3d
Merge pull request #390 from str4d/note-decryption-fixes
zcash_note_encryption: Note decryption fixes
2021-06-02 22:22:35 +01:00
Kris Nuttycombe 72ac97a35f Derive transaction version & branch id from target height. 2021-06-02 13:45:29 -06:00
Kris Nuttycombe 7466ef42d8 Move change_address back to the main builder
Also, store the target height in the sapling builder.
2021-06-02 12:35:18 -06:00
Kris Nuttycombe bd3b2afa59 Update changelog. 2021-06-02 11:48:46 -06:00
Kris Nuttycombe c872f39547 Restore progresscounter. 2021-06-02 11:48:46 -06:00
Kris Nuttycombe 3770e5de8b Move TZE transaction builder to an independent module. 2021-06-02 11:48:46 -06:00
Kris Nuttycombe c1a8de27f3 Move Sapling transaction builder to an independent module. 2021-06-02 11:48:46 -06:00
Kris Nuttycombe ba6fc053b5 Move transparent transaction builder to an independent module. 2021-06-02 11:48:46 -06:00
Kris Nuttycombe 8267d06846 Refactor transaction builder to create separate builders for each section. 2021-06-02 11:48:46 -06:00
str4d f7f5cd472b
Merge branch 'master' into note-decryption-fixes 2021-06-02 18:45:01 +01:00
Kris Nuttycombe 010a5377a9
Merge pull request #385 from nuttycom/feature/zip-225-prep
ZIP-225/244 #1: Minor refactoring and preparatory updates.
2021-06-02 09:39:02 -06:00
Kris Nuttycombe 168314cec6 Update changelog. 2021-06-01 07:05:01 -06:00
Kris Nuttycombe 62bd06f14e Apply suggestions from code review
Co-authored-by: str4d <jack@electriccoin.co>
2021-06-01 07:03:31 -06:00
Kris Nuttycombe 76999eb5c7 Make txid contents private & use txid for TzeOutPoint 2021-06-01 07:03:31 -06:00
Kris Nuttycombe 936b552de2 Add NoteValue newtype, Nullifier::as_ref and proptest generation. 2021-06-01 07:03:31 -06:00
Kris Nuttycombe 3dc05a69eb Add Nu5 NetworkUpgrade variant. 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
str4d 35023ed8ca
Merge pull request #388 from str4d/builder-progress-api-tweak
Builder: Move progress notifier configuration to a builder method
2021-05-31 19:53:43 +01:00
Jack Grigg eba6f417fe zcash_note_encryption: Doc fixes 2021-05-29 00:15:25 +01:00
Jack Grigg 362838c3fa zcash_note_encryption: Fix array size in Domain::extract_{esk, pk_d}
Decrypted output size is `OUT_PLAINTEXT_BYTES`, which the decryptor
can always provide (either by decrypting into the correct size array
as now, or truncating the buffer before passing it to the domain).
2021-05-28 23:48:03 +01:00
Jack Grigg f6705f23c3 zcash_note_encryption: Add ovk recovery API 2021-05-28 23:45:23 +01:00
Jack Grigg ae43e6c074 zcash_note_encryption: Pass cmstar_bytes to Domain::derive_ock
PRF^ock in the spec takes cm* as a byte array.
2021-05-28 23:41:13 +01:00
Jack Grigg ee2b96c82d zcash_note_encryption: s/TryFrom/From on ExtractedCommitmentBytes bound
This was left over from an earlier refactor where we could call a domain
API to extract cmstar from a note commitment (which could fail for
Orchard). This part of extraction was subsequently refactored into the
domain logic (and is rejected earlier for Orchard). The resulting bound
is wrong because it's always possible to serialize a scalar.
2021-05-28 22:57:48 +01:00
Jack Grigg 16627b4569 zcash_note_encryption: Enforce ZIP 212 check on esk from outPlaintext
It needs to equal the esk derived from the note (for v2 note plaintexts).
2021-05-28 22:33:00 +01:00
Jack Grigg 6f0e7c86a3 zcash_primitives: Add Builder::with_progress_notifier to changelog 2021-05-26 22:02:01 +01:00
Jack Grigg d031dabcfc Builder: Move progress notifier configuration to a builder method
This is what builder methods are for :) and it helps to limit the growth
of alternate `build` methods.
2021-05-26 21:58:08 +01:00
str4d d9a3b98120
Merge pull request #377 from adityapk00/builder_progress
Report Sapling Tx Builder Progress
2021-05-26 21:52:38 +01:00
Jack Grigg ff94f66d8e zcash_address: Fix padding and F4Jumble positions in Address::to_bytes
These need to be applied to the entire UA encoding, not to the encoding
of each individual receiver.
2021-05-25 21:24:47 +01:00
Jack Grigg ff8695de03 zcash_address: Add failing test showing unified::Address encoding bug 2021-05-25 21:24:47 +01:00
str4d c2b57048bf
Update components/zcash_address/README.md
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2021-05-25 16:37:25 +01:00
Jack Grigg e982d7211f zcash_address: Implement Unified Address encoding / decoding 2021-05-20 22:50:59 +01:00
Jack Grigg 6717cd821c Move F4Jumble implementation into zcash_address 2021-05-20 22:50:59 +01:00
Jack Grigg ae2b8bfd6d zcash_address: Replace Orchard address encodings with Unified Addresses
This commit removes the now-undefined Orchard encoding logic, and adds
the general Bech32m encoding/decoding logic for Unified Addresses. The
internal data format of Unified Addresses is not correct in this commit.
2021-05-20 22:50:59 +01:00
str4d d50bb12a97
Merge pull request #334 from str4d/dependency-updates
Dependency updates
2021-05-20 17:48:52 +01:00
Jack Grigg 9f7398cd05 zcash_address: Add convert::ToAddress helper trait 2021-05-20 14:54:27 +01:00
Jack Grigg ce8797e4b1 zcash_address: impl {Clone, Copy, Eq, Hash} for ZcashAddress 2021-05-20 14:54:27 +01:00
Jack Grigg ff07eeaabb zcash_address: Document ZcashAddress::convert 2021-05-20 14:54:27 +01:00
Jack Grigg b9f704955a zcash_address: Move ZcashAddress::convert into root
Using two separate `impl ZcashAddress` blocks resulted in separate
blocks in the documentation, which is unnecessary.
2021-05-20 14:54:27 +01:00
Jack Grigg c7fcee27a2 zcash_address: Add ZcashAddress::try_from_encoded method
This places parsing documentation front and centre, while also making
it clear that `str::parse` is the anticipated main entry point.
2021-05-20 14:54:27 +01:00
Jack Grigg f7b1058171 zcash_address: Extend MaybeZcash heuristics to 64-byte addresses 2021-05-20 14:54:27 +01:00
Jack Grigg a366460157 zcash_address: ZcashAddress::convert() -> T: FromAddress
This enables easy conversion of an encoded Zcash address to a target
type, with automatic handling of Zcash address types that are not
supported by the target.
2021-05-20 14:54:27 +01:00
Jack Grigg ec77175d2b zcash_address: Add address-encoding support
This provides round-trip encoding for Zcash addresses.
2021-05-20 14:54:27 +01:00
Jack Grigg c754363c07 zcash_address: Initial empty library crate 2021-05-20 14:54:25 +01:00
str4d 6fab0c82a7
Merge pull request #383 from nuttycom/feature/f4jumble
Implement F4Jumble
2021-05-20 14:53:13 +01:00
str4d 35dadc7f6c
f4jumble: Test both directions against test vectors 2021-05-20 14:16:39 +01:00
Jack Grigg 49d946fb5a Remove wasm32-unknown-unknown from build checks
By default `getrandom` 0.2 does not compile on unsupported targets; it
is necessary to enable its `js` feature flag specifically when targeting
`wasm32-unknown-unknown`. Since we don't expose that flag ourselves
(instead relying on the downstream user to do this) we can't directly
test this ourselves. `wasm32-wasi` is fully-supported, so we continue to
test builds against that target to ensure we retain WASM compatibility.
2021-05-19 18:29:37 +01:00
Jack Grigg 9a80ae5cd1 bitvec 0.20 2021-05-19 18:29:37 +01:00