Deirdre Connolly
a241cb536a
Add a TODO comment
2020-03-28 02:42:13 -04:00
Deirdre Connolly
f84a8c682a
Derive PayingKey's from SpendingKey's
...
And test that we can still derive TransmissionKey's from PayingKey's,
as they are aliases for x25519_dalek PublicKey/StaticSecret types that already
impl From<_> for each other.
2020-03-28 02:42:13 -04:00
Deirdre Connolly
ee32de2b86
Derive Sprout ReceivingKey's from SpendingKey's via SHA256Compress
...
Test is incomplete, also the type aliases block us from impl'ing Debug or Display.
2020-03-28 02:42:13 -04:00
Deirdre Connolly
bba58807bb
Pull in fork of sha2 that exposes compress256 round function
2020-03-28 02:42:13 -04:00
Deirdre Connolly
ecbd1bf825
Make ReceivingKey a type alias for x25519_dalek::StaticSecret
...
Plus some doc comments
2020-03-28 02:42:13 -04:00
Deirdre Connolly
c836dcf3b6
Docs
2020-03-28 02:42:13 -04:00
Deirdre Connolly
c3700c1a37
Update SproutShieldedAddress types
...
Use magics module.
Stub out key types, including a TransmissionKey alias for x25519_dalek::PublicKey
2020-03-28 02:42:13 -04:00
Deirdre Connolly
01afa09575
Move magic bytes to nested private modules for t-addrs
2020-03-28 02:42:13 -04:00
Deirdre Connolly
1e71793357
Filling out Sprout and Sapling Shielded Addresses
2020-03-28 02:42:13 -04:00
Deirdre Connolly
7af9b80f3b
Add the beginnings of Sprout and Sapling key types
2020-03-28 02:42:13 -04:00
Deirdre Connolly
b4832ab7cb
Add x25519-dalek as dependency
2020-03-28 02:42:13 -04:00
Deirdre Connolly
b03d70090f
Module-level doc comments
2020-03-28 02:42:13 -04:00
Deirdre Connolly
ea773c7a4b
Add module-level doc comment for keys/transparent.rs
2020-03-28 02:42:13 -04:00
Deirdre Connolly
532bbaf460
Impl zcash_deserialize for secp256k1::PublicKey
2020-03-28 02:42:13 -04:00
Deirdre Connolly
3fbfd10f2c
Finish migration of TransparentAddress out of addresses.rs
2020-03-28 02:42:13 -04:00
Deirdre Connolly
7ea39fbdce
Use secp256k1 serde flag to make keys serializable
2020-03-28 02:42:13 -04:00
Deirdre Connolly
bd247067ae
Move TransparentAddress stuff to its own module
2020-03-28 02:42:13 -04:00
Henry de Valence
824193eeeb
Add block 434873 with a bad version field.
2020-03-18 21:34:02 -04:00
Henry de Valence
6ec934a8d7
impl FromStr for BlockHeaderHash
...
This is very convenient for putting block hashes in the source code.
2020-03-18 21:34:02 -04:00
Henry de Valence
dd8ba287bf
Correct block version parsing.
2020-03-18 21:34:02 -04:00
Deirdre Connolly
2a155cadfc
Fix some clippy lints
2020-03-12 22:02:17 -04:00
Deirdre Connolly
b9240971fd
Add impl Arbitrary for TransparentAddress and a roundtrip proptest
...
addresses.rs is now large with just transparent stuff, i am already planning to break this up
further in the addresses/ module.
2020-03-12 22:02:17 -04:00
Deirdre Connolly
4b53c2eac3
Remove AddressPayloadHash, move hashing to TransparentAddress method
2020-03-12 22:02:17 -04:00
Deirdre Connolly
a5f4db7528
Move just the Network enum to -chain, keep everything else in -network
2020-03-12 22:02:17 -04:00
Deirdre Connolly
b68e1e2d55
Move Network, Magic, and magics to zebra-chain
2020-03-12 22:02:17 -04:00
Deirdre Connolly
14120cf828
Clean up comments
2020-03-12 22:02:17 -04:00
Deirdre Connolly
27d960c61e
Remove an answered XXX
2020-03-12 22:02:17 -04:00
Deirdre Connolly
5602ed66a9
Add tests, use Base58Check, not Base58
2020-03-12 22:02:17 -04:00
Deirdre Connolly
f11821fcc8
base58 to string
2020-03-12 22:02:17 -04:00
Deirdre Connolly
9887b7c8b7
Fix up TransparentAddresses
2020-03-12 22:02:17 -04:00
Deirdre Connolly
16ee53a909
Impl zcash_(de)serialize for TransparentAddress
2020-03-12 22:02:17 -04:00
Deirdre Connolly
72ddc7d7a1
Add AddressPayloadHash type
...
Includes From impls for Script, secp256k1::PublicKey
2020-03-12 22:02:17 -04:00
Deirdre Connolly
9a4e4e4236
Stub out transparent addresses, keys with secp256k1
2020-03-12 22:02:17 -04:00
Deirdre Connolly
0998b90392
Stub out sprout, sapling key modules
2020-03-12 22:02:17 -04:00
Deirdre Connolly
db86ef6e8b
Pull in secp256k1 wrapper crate as a dep
2020-02-28 13:19:47 -05:00
Henry de Valence
ff3efd504c
Add Zebra logo to all workspace crates.
...
Also add html_root_url attributes.
2020-02-26 21:25:35 -08:00
Deirdre Connolly
af455f9896
Refine Note types a little more
2020-02-22 22:24:26 -05:00
Deirdre Connolly
a6a3a640ca
Tidied up some note encryption types
2020-02-22 18:33:51 -05:00
Deirdre Connolly
8aefadd00f
Add multiple types to lay out NotePlaintext's for sprout and sapling
2020-02-22 18:33:51 -05:00
Deirdre Connolly
1a10975389
Add memo test vector for invalid utf8 bytes
2020-02-22 18:33:51 -05:00
Henry de Valence
afa2c2347f
fmt
2020-02-21 06:48:25 -05:00
Deirdre Connolly
272c3479a8
Remove unused BlockTestVector struct
...
Resolves #260
2020-02-20 15:05:13 -05:00
Henry de Valence
2d2603cf65
Add a CoinbaseData field, replacing Vec<u8>.
...
The CoinbaseData field can only be constructed by the transaction parser, so we
can ensure that a coinbase input is always serializable, as CoinbaseData
instances can't be constructed outside of the parser that maintains the data
size invariant.
2020-02-19 15:42:20 -05:00
Henry de Valence
b443d7a4be
Fix clippy lints.
2020-02-14 18:23:41 -05:00
Henry de Valence
d887faf16f
Add PartialOrd, Ord to BlockHeight.
2020-02-14 18:23:41 -05:00
Henry de Valence
c4d72177c2
Add a Block::coinbase_height() method.
2020-02-14 18:23:41 -05:00
Henry de Valence
56d7391f6d
Add convenience methods to Transaction.
...
Because we represent each transaction version as a different variant of the
Transaction enum, we end up in a situation where fields that are common to
different transaction versions are awkward to access, requiring a match
statement with identical match arms.
To fix this, this commit adds the following convenience methods:
* `Transaction::inputs() -> impl Iterator<Item=&TransparentInput>`;
* `Transaction::outputs() -> impl Iterator<Item=&TransparentOutput>`;
* `Transaction::lock_time() -> LockTime`;
* `Transaction::expiry_height() -> Option<ExpiryHeight>`;
The last returns an `Option` because the field is only present in V3 and V4
transactions.
There are some remaining fields that do not get common accessors, because it
probably doesn't make sense to access independently of knowing the transaction
version: `joinsplit_data`, `shielded_data`, `value_balance`.
2020-02-14 18:23:41 -05:00
Henry de Valence
44b299d15c
Parse block heights in coinbase transactions.
...
BIP34, which is included in Zcash, encodes the block height into each
block by adding it into the unused BitcoinScript field of the block's
coinbase transaction. However, this is done just by requiring that the
script pushes the block height onto the stack when it executes, and
there are multiple different ways to push data onto the stack in
BitcoinScript. Also, the genesis block does not include the block
height, by accident.
Because we want to *parse* transactions into an algebraic data type that
encodes their structural properties, rather than allow possibly-invalid
data to float through the internals of our node, we want to extract the
block height upfront and store it separately from the rest of the
coinbase data, which is inert. So the serialization code now contains
just enough logic to parse BitcoinScript-encoded block heights, and
special-case the encoding of the genesis block.
Elsewhere in the source code, the `LockTime` struct requires that we
must use block heights less than 500,000,000 (above which the number is
interpreted as a unix timestamp, not a height). To unify invariants, we
ensure that the parsing logic works with block heights up to
500,000,000, even though these are unlikely to ever be used for Zcash.
2020-02-14 18:23:41 -05:00
Henry de Valence
5059c23e99
Add test vectors for genesis & early blocks.
2020-02-14 18:23:41 -05:00
Henry de Valence
4957567409
Represent coinbase inputs explicitly.
...
Coinbase inputs are handled differently from other inputs and have
different consensus rules, so they should be represented differently in
the source code. This lets us discard extraneous details (for instance,
it's not necessary to maintain the all-zero hash) and specialize logic.
2020-02-14 18:23:41 -05:00
Deirdre Connolly
99e3b16476
Make Memo a wrapper for Box<[u8; 512]>
2020-02-13 15:04:04 -05:00
Deirdre Connolly
ea8fa5ef46
Not public for the moment
2020-02-13 15:04:04 -05:00
Deirdre Connolly
01fcce53f4
Move memo to its own module under note_encryption, turn try_from into a match cmp
2020-02-13 15:04:04 -05:00
Deirdre Connolly
54b1172dc8
Avoid a few heap allocations that aren't strictly needed
2020-02-13 15:04:04 -05:00
Deirdre Connolly
2468acb9db
Add some docs to clarify that a Memo is a 'plaintext' type, the parent note will be encrypted
2020-02-13 15:04:04 -05:00
Deirdre Connolly
d7ccf255e1
Update memo link to spec
...
Co-Authored-By: Henry de Valence <hdevalence@hdevalence.ca>
2020-02-13 15:04:04 -05:00
Deirdre Connolly
362f773762
Tidy tests
2020-02-13 15:04:04 -05:00
Deirdre Connolly
30a7647682
Move over various EncryptedCiphertext types from transaction/ module
2020-02-13 15:04:04 -05:00
Deirdre Connolly
ecaaa21d1c
Improve test for Memo::from support
2020-02-13 15:04:04 -05:00
Deirdre Connolly
b8f7487e54
Use AsRef<[u8]>> in From impl
2020-02-13 15:04:04 -05:00
Deirdre Connolly
8572c70716
impl From<String> for Memo
...
I want From<str> but need Sized
2020-02-13 15:04:04 -05:00
Deirdre Connolly
d4d1cf8d7b
Add memo type with Debug impl and some test cases
2020-02-13 15:04:04 -05:00
Henry de Valence
3c6fda8e0b
Make the BlockHeaderHash conversions work on borrows.
2020-02-10 09:03:56 -08:00
Henry de Valence
5f6bf188ff
Derive Hash for BlockHeaderHash.
...
This allows using BlockHeaderHashes in HashSets, HashMaps, etc.
2020-02-10 09:03:56 -08:00
Henry de Valence
ebf60b8840
Make BlockHeader fields public.
2020-02-10 09:03:56 -08:00
Deirdre Connolly
824f206dbe
Add several Debug impls for existing types
...
Resolves #237
2020-02-07 21:30:48 -08:00
Deirdre Connolly
866acde6e8
Add BLOCK_MAINNET_415000_BYTES test vector and a test to deserialize it
...
And println! it, for human eyeballs checking.
Resolves #218
Also changes the header constant to use _BYTES.
2020-02-07 13:42:21 -08:00
Henry de Valence
972d16518f
Make ZcashSerialize infallible mod its Writer.
...
Closes #158 .
As discussed on the issue, this makes it possible to safely serialize
data into hashes, and encourages serializable data to make illegal
states unrepresentable.
2020-02-05 19:48:43 -05:00
Henry de Valence
f04f4f0b98
Apply clippy fixes
2020-02-05 12:42:32 -08:00
Deirdre Connolly
b860461644
Update test block header hash
2020-02-04 18:04:53 -05:00
Deirdre Connolly
6dedb7e101
Write and read the equihash solution compactsize on (de)serialize
2020-02-04 18:04:53 -05:00
Deirdre Connolly
a79969b38f
Add comment around sha256d_flush test
2020-02-04 18:04:53 -05:00
Deirdre Connolly
4fcb66ad3b
Read and write the block header version, which is fixed at 4
2020-02-04 18:04:53 -05:00
Deirdre Connolly
7ebb5ccd41
Add a simple test to check that our mainnet blockheader test vector deserializes without error
2020-02-04 18:04:53 -05:00
Deirdre Connolly
9257d838bd
Use Result::expect() in test (de)serializations
2020-02-04 18:04:53 -05:00
Deirdre Connolly
9b6a9d8e86
Remove debugging variable assignments
2020-02-04 18:04:53 -05:00
Deirdre Connolly
d12db25acb
Cleanup
2020-02-04 18:04:53 -05:00
Deirdre Connolly
54628d889e
Add proptests-regressions/block/tests.txt
2020-02-04 18:04:53 -05:00
Deirdre Connolly
36e9bb162f
Move block type tests and proptest support impls to block::tests
2020-02-04 18:04:53 -05:00
Deirdre Connolly
6508540a92
Remove derive(Arbitrary) on BlockHeader
2020-02-04 18:04:53 -05:00
Deirdre Connolly
b758a8f753
Extend blockheaderhash unit test to check a single (de)serialization case roundtrip
2020-02-04 18:04:53 -05:00
Deirdre Connolly
dab99ba861
Impl Zcash(De)Serialization for Block
2020-02-04 18:04:53 -05:00
Deirdre Connolly
f5c135ee1b
Use updated EquihashSolution in BlockHeader
2020-02-04 18:04:53 -05:00
Deirdre Connolly
4d7bd3e2d7
derive(Copy) on SaplingNoteTreeRootHash
2020-02-04 18:04:53 -05:00
Deirdre Connolly
0f4d3e4a6d
derive(Arbitrary) on MerkleTreeRootHash
2020-02-04 18:04:53 -05:00
Deirdre Connolly
d5800e168c
Add a roundtrip (de)serialization proptest for EquihashSolution
2020-02-04 18:04:53 -05:00
Deirdre Connolly
c2bb6c15f8
Implement a bunch of traits for EquihashSolution
2020-02-04 18:04:53 -05:00
Deirdre Connolly
e82cf0f5a8
Add BlockHeaderHash (de)serialization roundtrip proptest
2020-02-04 18:04:53 -05:00
Deirdre Connolly
69164a6943
Add test for BlockHeaderHash::from(BlockHeader)
2020-02-04 18:04:53 -05:00
Deirdre Connolly
29e1be2442
Impl Zcash(De)Serialize for BlockHeader
2020-02-04 18:04:53 -05:00
Deirdre Connolly
e9d1f91d67
Make MerkleTreeRootHash wrapped array public
2020-02-04 18:04:53 -05:00
Deirdre Connolly
3ea4a6a9ab
Move transaction test vectors around
...
Resolves #210
2020-02-04 18:04:53 -05:00
Deirdre Connolly
1ca55846eb
Little test to exercise sha256dWriter::flush()
2020-02-04 18:04:53 -05:00
dependabot-preview[bot]
73463c33f4
Bump ed25519-zebra from 0.1.0 to 0.2.0
...
Bumps [ed25519-zebra](https://github.com/ZcashFoundation/ed25519-zebra ) from 0.1.0 to 0.2.0.
- [Release notes](https://github.com/ZcashFoundation/ed25519-zebra/releases )
- [Changelog](https://github.com/ZcashFoundation/ed25519-zebra/blob/main/CHANGELOG.md )
- [Commits](https://github.com/ZcashFoundation/ed25519-zebra/compare/0.1.0...0.2.0 )
Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-30 20:51:20 -08:00
Deirdre Connolly
359a7dc5eb
Add some proptest shrinkage
2020-01-28 03:48:23 -05:00
Deirdre Connolly
46fa30a66a
Don't use Utc::now() in our LockTime strategy
2020-01-28 03:48:23 -05:00
Deirdre Connolly
ac3c31b1c2
Rearrange and tidy imports
2020-01-28 03:48:23 -05:00
Deirdre Connolly
157add149a
Note that shielded_data::EncryptedCiphertext should move as part of note encryption work
...
Co-Authored-By: Henry de Valence <hdevalence@hdevalence.ca>
2020-01-28 03:48:23 -05:00
Deirdre Connolly
101f0a5c0a
Remove commented out asserts in serialize
...
Co-Authored-By: Henry de Valence <hdevalence@hdevalence.ca>
2020-01-28 03:48:23 -05:00
Deirdre Connolly
cdeaeaa3d6
Remove commented out asserts
...
Co-Authored-By: Henry de Valence <hdevalence@hdevalence.ca>
2020-01-28 03:48:23 -05:00
Deirdre Connolly
09e34f258f
Note that joinsplit::EncryptedCiphertext structs should move as part of note encryption work
...
Co-Authored-By: Henry de Valence <hdevalence@hdevalence.ca>
2020-01-28 03:48:23 -05:00
Deirdre Connolly
283d06bb08
Add (de)serialization roundtrip proptext for shielded_data::(Encrypted,Out)Ciphertext
2020-01-28 03:48:23 -05:00
Deirdre Connolly
2df20b9e6c
Add (de)serialization roundtrip proptext for joinsplit::EncryptedCiphertext
2020-01-28 03:48:23 -05:00
Deirdre Connolly
f379b36208
Add v4 transaction proptest shrinkage
2020-01-28 03:48:23 -05:00
Deirdre Connolly
a259a6b4b1
Add and use v4_strategy()
2020-01-28 03:48:23 -05:00
Deirdre Connolly
a93e2db44b
Add and use OutCiphertext
...
Instead of [u64; 10].
2020-01-28 03:48:23 -05:00
Deirdre Connolly
289f8ec9ca
impl Arbitrary for SpendDescription and refine impl for ShieldedData
2020-01-28 03:48:23 -05:00
Deirdre Connolly
f8781c3415
Refine Arbitrary impl for JoinSplitData<P>
2020-01-28 03:48:23 -05:00
Deirdre Connolly
90086d4d2d
derive(Arbitrary) on Sapling*Note*Tree types
2020-01-28 03:48:23 -05:00
Deirdre Connolly
100c5b15ec
Impl Arbitrary for ShieldedData and derive it for other types
...
Wraps the construction of redjubjub Signature so we don't
need an explicit impl for it.
2020-01-28 03:48:23 -05:00
Deirdre Connolly
7632863454
Impl Arbitrary for JoinSplitData<P>
...
Wraps the construction of ed25519 PublicKeyBytes and Signature so we don't
need an explicit impl for ed25519 types.
2020-01-28 03:48:23 -05:00
Deirdre Connolly
7e34a543ff
Impl Arbitrary for Groth16Proof
2020-01-28 03:48:23 -05:00
Deirdre Connolly
b47e886eed
Add transaction v3 proptest strategy
2020-01-28 03:48:23 -05:00
Deirdre Connolly
b786e1e19c
derive Arbitrary on BlockHeight
2020-01-28 03:48:23 -05:00
Deirdre Connolly
9cbc60a2d7
Proptest v1 and v2 transaction variants
2020-01-28 03:48:23 -05:00
Deirdre Connolly
31b759a924
Update (de)serialization to use EncryptedCiphertext types
2020-01-28 03:48:23 -05:00
Deirdre Connolly
ffd64d4b71
Add shielded_data::EncryptedCiphertext
2020-01-28 03:48:23 -05:00
Deirdre Connolly
95f3c61e53
Add joinsplit::EncryptedCiphertext and derive(Arbitrary) on JoinSplit*
2020-01-28 03:48:23 -05:00
Deirdre Connolly
7d520f8133
Impl Arbitrary for Bctv14Proof
2020-01-28 03:48:23 -05:00
Deirdre Connolly
f4df61eb47
Remove commented out extra Arbitrary impl for Locktime
2020-01-28 03:48:23 -05:00
Deirdre Connolly
b0c0055915
Transaction::V1 round trip proptest
2020-01-28 03:48:23 -05:00
Deirdre Connolly
dfb28b7854
Stubbing out an Arbitrary impl for variant V1 of the Transaction enum
2020-01-28 03:48:23 -05:00
Deirdre Connolly
1ee79b79d3
Add proptest-regressions for transaction/tests.rs
2020-01-28 03:48:23 -05:00
Deirdre Connolly
eb5b3dfefc
Add zcash_[de]serialize roundtrip proptest for Script type
2020-01-28 03:48:23 -05:00
Deirdre Connolly
86f631f9b7
Truncate LockTime::Time datetimes to only seconds for proptests
2020-01-28 03:48:23 -05:00
Deirdre Connolly
71d5571e39
Add roundtrip proptest for LockTime serialization/deserialization
...
Relates to #150
2020-01-28 03:48:23 -05:00
Henry de Valence
60f3f35d89
Refine Ed25519 byte arrays to ed25519-zebra types.
2020-01-24 16:43:31 -05:00
Henry de Valence
2e04610be3
Fix doc errors (missing links, etc).
2020-01-24 13:38:23 -08:00
Henry de Valence
4d5c8c7940
Clarify Transaction docs to point to iterator methods.
...
Closes #191 .
2020-01-24 13:38:23 -08:00
Henry de Valence
41021c65ad
Implement transaction (de)serialization.
2019-12-31 02:46:39 -05:00
Henry de Valence
53cae4647e
Make invalid ShieldedData unrepresentable.
...
ShieldedData objects must have at least one spend or output; using Either
ensures that at least one must be present. This is similar to the
JoinSplitData case, but slightly more complicated: rather than enforcing that
one list has at least one element (which can be done as `(first, rest)`), here
we need to use Either. This has the downside that it is possible to construct
multiple equivalent internal representations (choosing whether a spend or
output goes in the `first` slot), but this easily fixed with a custom PartialEq
implementation.
2019-12-31 02:46:39 -05:00
Henry de Valence
3a7ddbad2d
Add another convenience method for arrays, this time 64 bytes.
2019-12-31 02:46:39 -05:00
Henry de Valence
049998c751
Fix publicity for SaplingNoteTreeRootHash
2019-12-31 02:46:39 -05:00
Henry de Valence
8ff4139c1f
Use Groth16Proof in ShieldedData, not just JoinSplits.
2019-12-31 02:46:39 -05:00
Henry de Valence
92ddf0542f
Provide impl Zcash[De]Serialize for Vec<T: Zcash[De]Serialize>.
...
This replaces the read_list function and makes the code significantly cleaner.
The only downside is that it loses exact preallocation, but this is probably not a big deal.
2019-12-31 02:46:39 -05:00
Henry de Valence
1199cfa23e
impl Zcash[De]Serialize for Script
2019-12-31 02:46:39 -05:00
Henry de Valence
392825c4cb
Add Zcash[De]Serialize bound to ZkSnarkProof.
2019-12-31 02:46:39 -05:00
Henry de Valence
fa1e168fb5
Ensure that invalid JoinSplitDatas are unrepresentable.
...
All JoinSplitDatas must contain at least one JoinSplit.
2019-12-31 02:46:39 -05:00
Henry de Valence
c26304d983
Correct an error in transaction modeling.
...
In the previous transaction modeling I defined the structs so that the number
of old and new commitments for a JoinSplit were variable, when in fact the
Sprout design fixes both to be 2. So now they are hardcoded as 2 in the source
code as well. This commit also fixes some missing `pub` fields on the
`JoinSplit` struct.
2019-12-31 02:46:39 -05:00
Henry de Valence
056127dc94
Copy a transaction test vector from librustzcash.
2019-12-31 02:46:39 -05:00
Henry de Valence
2965187b91
Upgrade tokio, futures, hyper to released versions.
2019-12-13 17:42:15 -05:00
Henry de Valence
4315235d52
Use RedJubjub types in zebra-chain. ( #142 )
2019-12-12 14:23:19 -05:00
Henry de Valence
c013895cd7
Update Transaction definition. ( #105 )
...
* Added a few more top-level fields for the Transaction struct
* Add a placeholder Script type.
This could alternately use bytes::Bytes to save some allocations
but I don't think this is important to get perfectly now. In the future, we
will want to have all of the script handling code in the zebra-script crate,
but we will need to have a container type for an encoded script in zebra-chain,
because otherwise zebra-chain would depend on zebra-script and not the other
way around.
* Rename Transaction{Input,Output} -> Transparent{Input,Output}.
These are only *transparent* inputs and outputs, so by putting Transparent in
the name (instead of Transaction) it's more clear that a transaction's inputs
or outputs can also be shielded.
* Add a LockTime enum.
* First attempt at a Transaction enum.
This attempts to map the versioning and field presence rules into an ADT, so
that structurally invalid transactions (e.g., a BCTV14 proof in a Sapling
transaction) are unrepresentable.
* Update zebra-chain/src/transaction.rs
Co-Authored-By: Daira Hopwood <daira@jacaranda.org>
* Add fixme note on type refinement.
* Rename Transaction variants according to version.
* Split transaction.rs into submodules.
* Start filling in spend, output descriptions.
* Progress on JoinSplit data structures.
This has a lot of duplication and should really use generics to abstract over
Sprout-on-BCTV14 or Sprout-on-Groth16.
* Add data types for Bctv14 and Groth16 proofs.
This also adds a trait to abstract over them.
* Make JoinSplit descriptions generic over the proof system.
* Update zebra-chain/src/transaction/joinsplit.rs
2019-12-05 15:56:58 -05:00
Deirdre Connolly
51b888c0ff
Impl custom Debug for TransactionHash
...
Resolves #104
2019-12-05 10:07:47 -08:00
Henry de Valence
f00c16a624
Require that compactsize encodings are canonical.
2019-11-20 11:59:54 -05:00
Henry de Valence
68a6837cc1
Add a bytes round-trip test for compactsize encoding.
2019-11-20 11:59:54 -05:00
Henry de Valence
986b5ee46b
Fix overlapping range in compactsize encoding.
2019-11-20 11:59:54 -05:00
Henry de Valence
ca24aaf58e
Add the seed for the failing proptest case.
2019-11-20 11:59:54 -05:00
Henry de Valence
2b9991e4e7
Add a basic proptest for compactsize encodings.
...
There's a compiler warning about overlapping ranges so this test should catch the bug.
2019-11-20 11:59:54 -05:00
Henry de Valence
5b801400c1
Update zebra-chain/Cargo.toml
2019-10-17 09:33:10 -07:00