Deirdre Connolly
b2584c4a8f
A space
2020-08-14 02:04:12 -04:00
Deirdre Connolly
0c299972ec
Clarify docstring about the Jubjub prime-order subgroup on generate_trapdoor()
2020-08-14 02:04:12 -04:00
Deirdre Connolly
f816761a5c
The pedersen hash to point test vectors now pass
2020-08-14 02:04:12 -04:00
Deirdre Connolly
425275ad35
Fix exclusive range, shift up enumerate() indexes with map()
2020-08-14 02:04:12 -04:00
Deirdre Connolly
be22ef64e5
At least fewer M_i() rounds for test cases
2020-08-14 02:04:12 -04:00
Deirdre Connolly
41c8076dab
Add test vectors that aren't being consumed right now
2020-08-14 02:04:12 -04:00
Deirdre Connolly
14d502a54b
Compute pedersen hash to point in scalar field
2020-08-14 02:04:12 -04:00
Deirdre Connolly
8ececebea7
A space
...
Co-authored-by: teor <teor@riseup.net>
2020-08-14 02:04:12 -04:00
Deirdre Connolly
3b01dc50ef
Use unicode scalar field characters instead of LaTeX
...
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2020-08-14 02:04:12 -04:00
Deirdre Connolly
1d494a2b7a
Docstring wrap
2020-08-14 02:04:12 -04:00
Deirdre Connolly
e22afa3c8f
Generate uniformly random scalar w/ Fr::from_bytes_wide()
...
Which reduces mod r always.
2020-08-14 02:04:12 -04:00
Deirdre Connolly
c46cda920f
Add primitive merkle_crh_sapling function
2020-08-14 02:04:12 -04:00
Deirdre Connolly
10a9aa5844
Add prf_nf and use in From impl to derive Sapling Nullifier
2020-08-14 02:04:12 -04:00
Deirdre Connolly
eb731a6e2f
Add note commitment tree Position type
2020-08-14 02:04:12 -04:00
Deirdre Connolly
65f8f2c613
Add mixing_pedersen_hash
...
Tidy constructors for NoteCommitment
2020-08-14 02:04:12 -04:00
Deirdre Connolly
ed888b38ef
Correctly generate a sapling NoteCommitment from the NoteCommitmentRandomness
2020-08-14 02:04:12 -04:00
Deirdre Connolly
b6385ca36f
Move commitment types into commitments module
...
Docs, tidy
2020-08-14 02:04:12 -04:00
Deirdre Connolly
4ccec84768
Add explicit pedersen_hash function
2020-08-14 02:04:12 -04:00
Deirdre Connolly
83c41869e1
Improve docs
2020-08-14 02:04:12 -04:00
Deirdre Connolly
caef323f9b
pedersen_hash_to_point() works, with submethods using bitvec
...
Also tidy, document
2020-08-14 02:04:12 -04:00
Deirdre Connolly
919557c20c
My BitSlice doesn't have a known size at compile time?
...
error[E0277]: the size for values of type cannot be known at compilation time
2020-08-14 02:04:12 -04:00
Deirdre Connolly
579f1ed134
Flesh out windowed_pedersen_commitment_r
2020-08-14 02:04:12 -04:00
Deirdre Connolly
9d87f30d18
Start of, but currently unfinished, Sapling note commitment / Windowed Pedersen Commitment
2020-08-14 02:04:12 -04:00
Deirdre Connolly
f64e0c4bc5
Sapling value commitment, half done Sapling note commitment
2020-08-14 02:04:12 -04:00
Deirdre Connolly
823b06b219
Break out subtypes into modules, including arbitrary's
2020-08-14 02:04:12 -04:00
Deirdre Connolly
dfb10ab10f
Add NoteCommitment.extract_u()
2020-08-14 02:04:12 -04:00
Deirdre Connolly
33730a05cb
Do not confuse a NoteCommitment for U(NoteCommitment)
2020-08-14 02:04:12 -04:00
Deirdre Connolly
0f46a9b6a8
NoteCommitments, renames, ValueCommitment, strategies, stub commit()
2020-08-14 02:04:12 -04:00
Deirdre Connolly
fa053e2b0b
Derive a Sprout nullifier from a nullifier seed (rho) and spending key
2020-08-14 02:04:12 -04:00
Deirdre Connolly
0d618a3abf
Start treestate module
2020-08-14 02:04:12 -04:00
Deirdre Connolly
28a7420079
Remove unused imports
2020-08-14 02:04:12 -04:00
Deirdre Connolly
15899bc6d3
More Note refinements
2020-08-14 02:04:12 -04:00
Deirdre Connolly
2c285985c8
Move nullifiers to respective note modules, pull in existing types from keys
2020-08-14 02:04:12 -04:00
Jane Lusby
8b78a55c71
Start work implementing sprout note commitment function
2020-08-14 02:04:12 -04:00
teor
0e21a70b88
feature: Implement CompactDifficulty to Work ( #838 )
...
* Implement CompactDifficulty to Work
* Add Bitcoin test vectors for difficulty
2020-08-14 09:48:15 +10:00
Henry de Valence
07917421cb
Correct coinbase check ( #898 )
...
* chain: add Transaction::is_coinbase()
This matches the check in zcashd/src/primitives/transaction.h:682
(CTransaction::IsCoinBase).
* chain: correct Block::is_coinbase_first
This matches zcashd/src/main.cpp:3968-3974 in CheckBlock.
Previously, the check allowed the first transaction to have multiple coinbase inputs.
* chain: return slices from Transaction::inputs()/outputs()
They're slices internally so we might as well just expose them that way.
2020-08-13 14:04:43 -07:00
Henry de Valence
36093b4721
Tweak light client root hash definition.
...
This changes the `light_client_root_hash` field to `light_client_root_bytes` to
hint that it's unparsed, and makes it public to match the rest of the
`BlockHeader` fields. The `LightClientRootHash` serialization methods are
hidden from the public API, so that the `LightClientRootHash` has to be
constructed by the method on the `Block`.
2020-08-11 19:13:50 -04:00
dependabot[bot]
5cb61136c9
build(deps): bump tracing from 0.1.18 to 0.1.19 ( #872 )
...
Bumps [tracing](https://github.com/tokio-rs/tracing ) from 0.1.18 to 0.1.19.
- [Release notes](https://github.com/tokio-rs/tracing/releases )
- [Commits](https://github.com/tokio-rs/tracing/compare/tracing-0.1.18...tracing-0.1.19 )
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-08-11 10:18:54 -07:00
Henry de Valence
f8a24f9c11
Rename script fields to lock/unlock scripts. ( #866 )
...
This is slightly clearer and more correct than the previous pk_script.
2020-08-10 11:49:38 -07:00
teor
7afd76f5fb
feature: Add light_client_root_hash(network) to Block
...
* use the right variant in LightClientRootHash::from_bytes()
* make block.header.light_client_root_hash pub(super)
* add tests for LightClientRootHash and block.light_client_root_hash
2020-08-10 18:54:42 +10:00
teor
ee6f0de14d
refactor: Move NetworkUpgrade to zebra-chain
2020-08-10 18:54:42 +10:00
teor
c4eb136426
feature: Add a LightClientRootHash type
2020-08-10 18:54:42 +10:00
teor
53ce01fd23
fix: Rename the light client hash field
2020-08-10 18:54:42 +10:00
Henry de Valence
a987394782
Add KaTeX to rendered docs. ( #832 )
...
This adds a single test formula to the `zebra-chain` docs. We can remove it
after merging this and running it through CI to confirm that it works.
2020-08-05 17:34:30 -07:00
teor
d49c11ee70
fix: Allow PROPTEST_CASES to override the lower block case default
2020-08-05 02:07:05 -07:00
teor
ac7a4ae517
fix: Speed up the block round trip proptest
...
Reduce the number of cases run by the block round trip proptest, to
speed up the Zebra tests.
2020-08-04 22:35:01 -07:00
teor
78b5bf5e9a
refactor: Move the difficulty tests into their own file
2020-08-04 15:24:52 -04:00
teor
efb9313460
fix: Resolve a type ambiguity in a proptest
...
For some reason, implementing
`PartialOrd<BlockHeaderHash> for ExpandedDifficulty` (or its converse)
makes this unrelated code ambiguous.
2020-08-04 12:29:07 +10:00
teor
c8b502a5da
feature: Compare ExpandedDifficulty and BlockHeaderHash
2020-08-04 12:29:07 +10:00
teor
b7fac7b3bc
feature: Make ExpandedDifficulty use U256 internally
...
Adds a dependency on the primitive-types crate.
Also adds custom hex debug formatting for compact and expanded
difficulties.
2020-08-04 12:29:07 +10:00