Update Payment API
I included those missing commands to the API reference: `z_exportviewingkey`, `z_importviewingkey`, and `z_listunspent`.
Do you think we should include `z_mergetoaddress`, `z_getpaymentdisclosure`, and `z_validatepaymentdisclosure` too, despite they are experimental?
I included those missing commands to the API reference: `z_exportviewingkey`, `z_importviewingkey`, and `z_listunspent`.
Do you think we should include `z_mergetoaddress`, `z_getpaymentdisclosure`, and `z_validatepaymentdisclosure` too, despite they are experimental?
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.
Key encoding refactor
Includes code cherry-picked from the following upstream PRs:
- bitcoin/bitcoin#11372
- Only the first three commits (the fourth commit depends on #2390)
Part of #3058.
This patch removes the need for the intermediary Base58 type
CZCPaymentAddress, by providing {Encode,Decode}PaymentAddress
functions that directly operate on the conversion between strings
and libzcash::PaymentAddress.
Bech32 encoding support
Cherry-picked from the following upstream PRs:
- bitcoin/bitcoin#8578
- bitcoin/bitcoin#11167
- Only the second and third commits (first is in #3228, fourth depends on #2390, later ones are SegWit-specific).
- bitcoin/bitcoin#12757
- Only the change to `src/bech32.h`
Part of #3058.
Sapling merkle tree implementation
Closes#3056.
Please also review https://github.com/zcash/librustzcash/pull/8
This PR:
1. Introduces ZCSaplingIncrementalMerkleTree using Pedersen hashes.
2. Adds support for Sapling anchors into consensus rules. (Adds commitments, checks anchors are correct, handles block (dis)connects, etc.)
3. Handles mempool eviction for obsolete anchors.
4. Enforces correctness of block's Sapling root field
5. Changes miner to correctly apply the Sapling root to the block header
6. Handles mempool consistency checks for anchors