Commit Graph
100 Commits
Author SHA1 Message Date
Jack Grigg bb4b6982e3 Generate an ovk to encrypt outCiphertext for t-addr senders
Closes #3506.
2018-09-19 00:51:30 +01:00
Jack Grigg bd3c860cb4 Use ovk directly in the TransactionBuilder API instead of fvk 2018-09-18 23:26:31 +01:00
Jack Grigg 8e057ad9ee qa: Test both Overwinter and Sapling peer management 2018-09-12 12:15:37 +01:00
Jack Grigg c861137624 net: Check against the current epoch's version when disconnecting peers 2018-09-12 10:17:33 +01:00
Jack Grigg feee210af6 net: Check against the next epoch's version when evicting peers 2018-09-12 10:10:22 +01:00
Jack Grigg 07d3f947ec Extract a helper method for finding the next epoch 2018-09-12 10:07:44 +01:00
Jack Grigg ebf4c0671e net: Check against the current epoch's version when rejecting nodes 2018-09-12 09:27:28 +01:00
Jack Grigg 94549326c9 Bugfix: Use time instead of block height for Sapling key metadata 2018-09-11 12:45:25 +01:00
Jack Grigg b33a7ec46e wallet: Don't allow an HDSeed to be overwritten
We can maybe relax this restriction later once we have worked out the UX
implications.
2018-09-03 10:45:37 +01:00
Jack Grigg 4c1a26fb60 Add ZIP 32 usage to release notes 2018-09-03 10:45:37 +01:00
Jack Grigg b7f9a7ae02 wallet: Comment out HDSeed and CHDChain persistence to disk
Sapling keys generated from the seed are not yet persisted, so we don't
want to persist the seed or chain state either, otherwise the wallet
could end up in an inconsistent state.

Some tests are temporarily disabled because commenting out HDSeed
persistence breaks invariants inside CCryptoKeyStore.

Revert this commit during the PR for #3388.
2018-09-03 10:45:37 +01:00
Jack Grigg c58dae6cda init: Generate a new HD seed on startup 2018-09-03 10:45:37 +01:00
Jack Grigg 70b4ad2dcd wallet: Switch from SaplingSpendingKey to SaplingExtendedSpendingKey
The wallet now only stores Sapling extended spending keys, and thus can
only be used with keys generated from an HDSeed via ZIP 32.

Note that not all Sapling keys in the wallet will correspond to the
wallet's HDSeed, as a standalone Sapling xsk can be imported via
z_importkey. However, it must have been generated from a seed itself,
and thus is more likely to be backed up elsewhere.
2018-09-03 10:45:37 +01:00
Jack Grigg a4ac4fc3f4 wallet: Store Sapling key metadata indexed by ivk
Closes #3426.
2018-09-03 10:45:37 +01:00
Jack Grigg e2416930ea wallet: Store HDSeed and chain data 2018-09-03 10:45:37 +01:00
Jack Grigg ec653523ad Store HDSeed in CCryptoKeyStore 2018-09-03 10:45:33 +01:00
Jack Grigg 70c8c25e4b Store HDSeed in CBasicKeyStore 2018-09-03 10:27:52 +01:00
Jack Grigg 7614198f9d ZIP 32 Sapling structs 2018-09-03 10:27:52 +01:00
Jack Grigg f8d65e8f03 Update librustzcash with ZIP 32 APIs 2018-09-03 10:27:52 +01:00
Jack Grigg af04224522 Fix file permissions of wallet_sapling RPC test 2018-09-03 08:27:33 +01:00
Jack Grigg 0f436a0a26 Fix RPC test that checks exact wording of cleaned-up error message 2018-09-03 08:23:09 +01:00
Jack Grigg 7c02acc5b6 Minor cleanups 2018-09-03 01:28:31 +01:00
Jack Grigg 1ec06e93b1 Rename z_inputs_ to z_sprout_inputs_ 2018-09-03 01:13:18 +01:00
Jack Grigg e47ccf2a00 libsnark: Use format macro constants for printing fixed-width values 2018-08-30 22:21:25 +01:00
Jack Grigg c53defda9d libsnark: Force constants used in test comparisons to be unsigned 2018-08-30 21:37:10 +01:00
Jack Grigg 2962a72e35 Rename GetFirstBlockTransaction() to GetFirstBlockCoinbaseTx() 2018-08-30 14:58:19 +01:00
Jack Grigg d7bcbfaee4 Fix test after refactor to check bacd-cb-height rule on a genesis block 2018-08-30 14:50:57 +01:00
Jack Grigg fb22b3bbd8 Revert NU activation heights in reverse order
Ensures that global state remains consistent.
2018-08-30 14:44:50 +01:00
Jack Grigg d70d103ee0 Ensure SCOPED_TRACE falls out of scope when necessary 2018-08-30 14:41:56 +01:00
Jack Grigg 07d85a6455 Define additional booleans for readability 2018-08-30 09:42:21 +01:00
Jack Grigg e54c4d2ca1 rpcwallet: Add Sapling support to z_sendmany 2018-08-27 11:36:14 +01:00
Jack Grigg af4057b904 rpcwallet: Prevent use of both Sprout and Sapling addresses in z_sendmany 2018-08-27 11:13:49 +01:00
Jack Grigg 36e2141d92 rpcwallet: Add TransactionBuilder argument to AsyncRPCOperation_sendmany 2018-08-27 11:13:49 +01:00
Jack Grigg 81e0fd2eb9 wallet: Add HaveSpendingKeyForPaymentAddress visitor 2018-08-27 11:13:49 +01:00
Jack Grigg e22c115e78 Move GetSpendingKeyForPaymentAddress visitor into wallet.h
Also fixes it to not use the global pwalletMain.
2018-08-27 11:13:49 +01:00
Jack Grigg 573de712ab rpc: Clarify ivk balance issues in help text 2018-08-25 01:09:12 +01:00
Jack Grigg d316992f55 rpc: Clarify Sprout shielded addresses in help text 2018-08-22 12:33:30 +01:00
Jack Grigg 6c6ed24310 libsnark: Fix stale comment 2018-08-21 18:06:23 +01:00
Jack Grigg 8b3d0ef4e3 libsnark: Use mp_limb_t cast instead of uint64_t when masking bigint.data 2018-08-21 18:05:14 +01:00
Jack Grigg fa92a21a40 libsnark: Adjust SHA256 K value type to match the constant
When used, it is cast to an integer_coeff_t, which is currently a long.
On LP64 systems, this cast is lossless. Issues with LLP64 systems will
be addressed later.
2018-08-21 18:04:50 +01:00
Jack Grigg 831b6af932 Metrics UI: Fall back to 80 cols if GetConsoleScreenBufferInfo() fails 2018-08-21 16:54:40 +01:00
Jack GriggandSean Bowe 053cb3497d Add Sapling support to z_getbalance and z_gettotalbalance
Closes #3214

Co-authored-by: Sean Bowe <ewillbefull@gmail.com>
2018-08-20 11:35:06 +01:00
Jack GriggandSean Bowe 94e99acda6 Add Sapling support to GetFilteredNotes() and GetUnspentFilteredNotes()
This could in future be refactored to be generic over PaymentAddress and
NotePlaintext in the return type, but for now let's be explicit about which
returned notes are for Sprout vs Sapling, and handle them separately.

Co-authored-by: Sean Bowe <ewillbefull@gmail.com>
2018-08-20 11:34:54 +01:00
Jack Grigg c9339bb61f test: Fix comment in WalletTests.FindMySaplingNotes 2018-08-17 21:39:16 +01:00
Jack Grigg bce692390f configure: Don't add -ldl to RUST_LIBS for mingw32 2018-08-17 18:54:04 +01:00
Jack Grigg 7d65dcf4d9 depends: Pass correct compiler, linker, and flags into googletest 2018-08-17 16:47:03 +01:00
Jack Grigg 2456eb80ae Metrics UI: Tell Windows users how to stop zcashd
Ctrl+C is not configured for Windows, as it does not work (yet):
https://github.com/Microsoft/vscode/issues/9347
https://github.com/Microsoft/console/issues/57
2018-08-17 16:46:41 +01:00
Jack Grigg 8fa09c244a Metrics UI: Enable virtual terminal sequence processing on Windows
https://docs.microsoft.com/en-us/windows/console/console-virtual-terminal-sequences
2018-08-17 16:46:29 +01:00
Jack Grigg c5b26acad8 Use boost::filesystem::path::string() instead of path::native()
This fixes a mingw32 conversion error during cross-compilation.
2018-08-17 16:46:18 +01:00
Jack Grigg 1dae6e9336 Pass correct compiler, linker, and flags into libsnark 2018-08-17 16:45:55 +01:00
Jack Grigg f2d3715727 zcutil/build.sh: Remove --enable-werror from default configuration
Windows cross-compile has currently-unavoidable warnings. Upstream Bitcoin Core
has them as well. For now, let's remove this from the default configuration, and
add it to the Linux and OSX CI builders (so we effectively still enforce it for
merged PRs).
2018-08-17 16:45:32 +01:00
Jack Grigg 03ea5a8122 zcutil/build.sh: Use config.site to set default ./configure settings
This is a more reliable way to configure the depends path (matching what is done
upstream), and frees up --prefix for user configuration.
2018-08-17 16:45:28 +01:00
Jack Grigg d10a762fb8 Clean up libzcash CPPFLAGS, CXXFLAGS, and LDFLAGS
By using the flags defined through ./configure instead, libzcash will react to
configuration and build system changes (such as PIC_FLAGS being empty for
Windows builds).
2018-08-17 16:44:05 +01:00
Jack Grigg 283ad96e85 Use -O1 for darwin and mingw32 release builds
In 46ad3c2758 we standardised our linux builds to
use -O1, but we didn't adjust the other targets.
2018-08-17 16:44:00 +01:00
Jack GriggandDavid Mercer ceca40d68f Measure Windows console size for metrics UI
Co-authored-by: David Mercer <radix42@gmail.com>
2018-08-17 16:43:43 +01:00
Jack Grigg 8d45f6e4e2 configure: Don't require RELRO and BIND_NOW when cross-compiling
mingw-w64's ld (at least mingw-w64 4.0.4-2) appears to not support -z
2018-08-17 16:43:20 +01:00
Jack Grigg b057754005 zcutil/build.sh: Use $HOST to specify the depends prefix 2018-08-17 16:43:06 +01:00
Jack GriggandDavid Mercer 3d308c2232 depends: Fix BDB naming issue when cross-compiling
Co-authored-by: David Mercer <radix42@gmail.com>
2018-08-17 16:42:35 +01:00
Jack Grigg f77650a6ac depends: Configure librustzcash for cross-compiling 2018-08-17 16:41:51 +01:00
Jack Grigg b57e4484ef depends: Correctly configure Rust when cross-compiling 2018-08-17 16:41:40 +01:00
Jack Grigg 554e00e8f9 Disable Sapling features on mainnet
Also places them behind an experimental features flag on testnet
2018-08-13 14:18:18 +01:00
Jack Grigg dfcf33fe15 test: Use regtest in key_tests/zs_address_test 2018-08-13 14:17:17 +01:00
Jack Grigg e7ca4eb3c3 test: gtest for Sapling encoding and decoding 2018-08-13 13:20:07 +01:00
Jack Grigg 13751895c7 Move RewindBlockIndex log message inside rewindLength check 2018-08-08 12:08:29 +01:00
Jack Grigg d0372cff5e Adjust Makefile so that common can be used by the wallet 2018-08-05 10:41:06 +01:00
Jack Grigg e188723823 Upgrade Rust to 1.28.0 stable 2018-08-05 10:41:06 +01:00
Jack Grigg 0ecdd0f30a chainparams: Add BIP 44 coin type (as registered in SLIP 44) 2018-08-05 10:41:06 +01:00
Jack Grigg 25d5e80cbe Rename *SpendingKey -> *SproutSpendingKey
Also GetPaymentAddresses -> GetSproutPaymentAddresses
2018-08-03 10:10:26 +01:00
Jack Grigg f84cf5f817 Formatting nits 2018-08-03 02:25:51 +01:00
Jack Grigg 4c77517772 Rename *ViewingKey* -> *SproutViewingKey* 2018-08-03 02:23:38 +01:00
Jack Grigg 74f5b010df Rename Serialized*Size -> SerializedSprout*Size 2018-08-03 01:57:40 +01:00
Jack Grigg 93fcf892d4 Rename SpendingKeyMap -> SproutSpendingKeyMap 2018-08-03 01:47:30 +01:00
Jack Grigg 5175a7f07b Pass SaplingPaymentAddress to store through the CKeyStore 2018-08-03 01:01:45 +01:00
Jack Grigg bc6344b350 Add CWallet::AddCryptedSaplingSpendingKey() hook
To be filled in when we implement Sapling persistence to disk.
2018-08-03 00:23:08 +01:00
Jack Grigg 9c9258c4f8 Remove outdated comment 2018-08-03 00:23:08 +01:00
Jack Grigg 4a89221ffc Check for unencrypted Sapling keys in CCryptoKeyStore::SetCrypted() 2018-08-03 00:23:08 +01:00
Jack Grigg 0adba6789b Add Sapling decryption check to CCryptoKeyStore::Unlock() 2018-08-03 00:23:08 +01:00
Jack Grigg e8a949c153 Rename CryptedSpendingKeyMap -> CryptedSproutSpendingKeyMap 2018-08-03 00:23:08 +01:00
Jack Grigg adf2eadba2 Rename DecryptSpendingKey -> DecryptSproutSpendingKey 2018-08-03 00:23:08 +01:00
Jack Grigg 40dc060cb0 test: Update rpc_wallet_z_importexport to account for Sapling changes 2018-08-01 19:59:57 +01:00
Jack Grigg 4aabeebc1f test: Fix permissions of wallet_addresses 2018-08-01 19:56:01 +01:00
Jack Grigg 4fab49e173 test: Another assert in wallet_zkeys_tests.store_and_load_sapling_zkeys 2018-08-01 09:46:32 +01:00
Jack Grigg d75e69da5a test: Deduplicate logic in wallet_addresses RPC test 2018-08-01 09:44:31 +01:00
Jack Grigg fbd029d99d Formatting 2018-07-31 23:28:42 +01:00
Jack Grigg 3f4ad5967b Fix block hash for checkpoint at height 270000 2018-07-30 17:45:04 +01:00
Jack Grigg eec85c4388 Add Sapling support to z_getnewaddress and z_listaddresses 2018-07-30 16:24:20 +01:00
Jack Grigg 281b51e567 Raise the 90-character limit on Bech32 encodings
Regtest addresses are 91 characters, and ZIP 32's Bech32 encoding will
be significantly longer.
2018-07-30 16:01:22 +01:00
Jack Grigg 4715b31c76 Implement CKeyStore::GetSaplingPaymentAddresses() 2018-07-30 16:01:22 +01:00
Jack Grigg 54a868cf0a Rename xsk to expsk
xsk will be used for ZIP 32 extended spending keys, so renaming here to
reduce confusion.
2018-07-30 14:26:29 +01:00
Jack Grigg a8dd4b0cf1 TransactionBuilder: Make fee configurable 2018-07-30 12:52:48 +01:00
Jack Grigg 45c0d1ec84 TransactionBuilder: Add change output to transaction 2018-07-30 12:46:18 +01:00
Jack Grigg 3466b4677e TransactionBuilder: Add support for transparent inputs and outputs 2018-07-30 11:03:29 +01:00
Jack Grigg 3fd0a269e1 test: Move ECC_Start() call into src/gtest/main.cpp 2018-07-27 17:18:49 +02:00
Jack Grigg 25bb05de23 Formatting 2018-07-27 12:17:14 +02:00
Jack Grigg e5dc5228ea TransactionBuilder: Check that all anchors in a transaction are identical
This reduces the amount of information that is leaked by the choice of anchor.
In future we will make a protocol change to enforce that all inputs use the
same anchor.
2018-07-27 09:46:38 +02:00
Jack Grigg e691e21f40 TransactionBuilder with support for creating Sapling-only transactions 2018-07-25 11:35:10 +02:00
Jack Grigg 70a7535ae8 Expose note position in IncrementalMerkleWitness 2018-07-24 14:54:07 +02:00
Jack Grigg 66a519f55d Alter SaplingNote::nullifier() to take a SaplingFullViewingKey
This means the API will work if you only have a SaplingExtendedSpendingKey,
as will be the case with ZIP 32.
2018-07-24 14:54:01 +02:00
Jack Grigg 26948eb24b Update payment-api.md with type field of z_validateaddress 2018-07-12 22:14:14 +01:00
Jack Grigg bea879157c Add Sapling support to z_validateaddress 2018-07-09 15:38:07 +01:00