Sean Bowe
b7a6c32178
Integrate Groth16 verification and proving.
6 years ago
Jack Grigg
e5eab182b5
Use boost::variant to represent shielded addresses and keys
libzcash::PaymentAddress has been renamed to libzcash::SproutPaymentAddress,
and a new typedef boost::variant is now libzcash::PaymentAddress. Similarly
for ViewingKey and SpendingKey.
A new class InvalidEncoding is introduced as the default boost::variant
option for each address and key type; it is used during decoding instead
of boost::optional.
All address and key storage functions in the wallet have been modified to
refer specifically to the Sprout types, as they are used very precisely.
In most other cases, the more general type is leveraged as much as possible,
and we convert to the Sprout type when necessary. This will be subsequently
wrapped in, or replaced with, context-specific functions once Sapling
types are implemented.
6 years ago
Eirik Ogilvie-Wigley
812098256f
Coinbase transactions can not have shielded spend or output
6 years ago
Eirik Ogilvie-Wigley
4b4662b06d
Make sure transactions have non-empty outputs
6 years ago
Sean Bowe
6679855147
Check that duplicate Sapling nullifiers don't exist within a transaction.
6 years ago
Simon
b230fe6836
Refactoring: Rename class libzcash::Note to libzcash::SproutNote.
6 years ago
Jack Grigg
b1608eed82
Add a constant for Overwinter's transaction version
6 years ago
Simon
68cc953012
Part of #2966 , extending Sprout tests to other epochs.
Tests updated:
- test_Get
- test_simple_joinsplit_invalidity
6 years ago
Jack Grigg
be12669982
Add consensus branch ID parameter to SignatureHash, remove SigVersion parameter
We do not need to be able to calculate multiple SignatureHash versions for a
single transaction format; instead, we use the transaction format to determine
the SigVersion.
The consensus branch ID *does* need to be passed in from the outside, as only
the caller knows the context in which the SignatureHash is being calculated
(ie. mempool acceptance vs. block validation).
JoinSplit signature verification has been moved into ContextualCheckTransaction,
where the consensus branch ID can be obtained.
The argument to the sign command for zcash-tx has been modified to take a height
in addition to the optional sigtype flags.
6 years ago
Pieter Wuille
6514771a44
Rename to PrecomputedTransactionData
8 years ago
Nicolas DORIER
90285e7b81
Unit test for sighash caching
Zcash: Modified to use P2PKH.
8 years ago
Pieter Wuille
f762d44973
Precompute sighashes
Original version by Nicolas Dorier. Precomputing version by Pieter Wuille.
Edited for Zcash by Ariel Gabizon and Jack Grigg
7 years ago
Pieter Wuille
c86a1cb86e
BIP143: Verification logic
Includes simplifications by Eric Lombrozo.
Edited for Zcash merge by Ariel Gabizon.
7 years ago
Pieter Wuille
2d42e1a993
Refactor script validation to observe amounts
This is a preparation for BIP143 support.
Edited for Zcash merge by Ariel Gabizon.
8 years ago
Sean Bowe
1a9543d064
Remove crusty old "loadVerifyingKey"/"loadProvingKey" APIs and associated invariants.
7 years ago
Daira Hopwood
00fde35b1c
Make transaction test failures print the comments preceding the test JSON.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
7 years ago
Daira Hopwood
de609b8c54
Strict DER signatures are always enforced; remove the flag and code that used it.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
7 years ago
Simon
ebe750a882
Part of #1969 . Changing min fee calculation also changes the dust threshold.
7 years ago
Jonas Schnelli
a10a6e2a0e
[Univalue] add univalue over subtree
similar to secp256k1 include and compile univalue over a subtree
9 years ago
Jack Grigg
cc71666a51
unsigned int -> size_t for comparing with UniValue.size()
7 years ago
Jonas Schnelli
d014114d67
Remove JSON Spirit wrapper, remove JSON Spirit leftovers
- implement find_value() function for UniValue
- replace all Array/Value/Object types with UniValues, remove JSON Spirit to UniValue wrapper
- remove JSON Spirit sources
9 years ago
Jonas Schnelli
851f58f94e
remove JSON Spirit UniValue wrapper
9 years ago
Jonas Schnelli
9756b7bd29
extend conversion to UniValue
9 years ago
Jeff Garzik
ed21d5bd4b
Convert tree to using univalue. Eliminate all json_spirit uses.
10 years ago
Simon
6605125d4e
Add comment about fix for #2026 .
7 years ago
Sean Bowe
05ec7887f1
Fix use after free in transaction_tests.
7 years ago
Jack Grigg
6fb8d0c2d6
Skip JoinSplit verification before the last checkpoint
Part of #1749
8 years ago
Sean Bowe
bc59f53722
Isolate verification to a `ProofVerifier` context object that allows verification behavior to be tuned by the caller.
8 years ago
Daira Hopwood
71cc1b58a1
Add tests for IsStandardTx applied to v2 transactions.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
8 years ago
Jack Grigg
3774c944f8
Refactor test code to better test JSDescription::Randomized()
8 years ago
Jack Grigg
7f0aa74666
Implement static method for creating a randomized JSDescription
8 years ago
Simon
805344dcf4
Refactor: replace calls to GetTxid() with GetHash()
8 years ago
Sean Bowe
a4b00373ab
Fix transaction test in test_bitcoin.
8 years ago
Simon
10d2c57c0d
Replace calls to GetHash() with GetTxid() for transaction objects.
Where the caller intends to receive a transaction id and not a double
SHA256 hash.
8 years ago
Taylor Hornby
67f0243533
Remove in-band error signalling from SignatureHash, fixing the SIGHASH_SINGLE bug.
8 years ago
Sean Bowe
b7e4abd6f7
Rename some usage of 'pour'.
8 years ago
Sean Bowe
bfeaf0049a
Rename JSDescription's `serials` to `nullifiers`.
8 years ago
Sean Bowe
8675d94b63
Rename vpour to vjoinsplit.
8 years ago
Sean Bowe
a8c68ffe99
Rename CPourTx to JSDescription.
8 years ago
Taylor Hornby
c9c4611d9a
Rename zerocash to zcash in some places.
8 years ago
Taylor Hornby
948d4e6c10
Split JoinSplit proof verification out of CheckTransaction.
8 years ago
Sean Bowe
e8af0028eb
Change error for invalid joinsplit signature for consistency.
8 years ago
Sean Bowe
320f2cc7e0
Switch to Ed25519 for cryptographic binding of joinsplits to transactions.
8 years ago
Taylor Hornby
b48122b57b
Fix tests for JoinSplit signatures
8 years ago
Sean Bowe
2dc3599271
Transplant of libzcash.
8 years ago
Sean Bowe
2140639309
Remove scriptPubKey/scriptSig from CPourTx, and add randomSeed.
8 years ago
Sean Bowe
5961dcb6da
Change ciphertext length to match protocol spec, and refactor the use of constants.
8 years ago
Sean Bowe
1760b3cd88
Deprecate the old tree and remove old tree tests from the test suite.
8 years ago
Sean Bowe
a897db652f
Reorganizing the zerocash tree.
8 years ago
Nathan Wilcox
8cb250885c
Replace magic 2s in rpcwallet and change > to != for arity checks. Replace magic 2's with named constants in test cases.
9 years ago