Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to librustzcash version 0.7 #32

Merged
merged 60 commits into from
Nov 16, 2022
Merged
Show file tree
Hide file tree
Changes from 57 commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
476b357
Migrate to `zcash_primitives 0.7.0`
str4d Jun 27, 2022
afb9dbd
Generate Sapling ExtSKs using the UnifiedSpendingKey type
str4d Aug 1, 2022
d0f175a
Update changelog for ZIP 316 changes
str4d Aug 19, 2022
53fd41e
Use librustzcash's built-in database migrations. (#33)
nuttycom Aug 24, 2022
2918091
Require the caller to consistently provide a number of confirmations.
pacu Mar 3, 2022
ccae3ca
Improve use of `unsafe` and fix clippy complaints.
nuttycom Aug 24, 2022
5c38d29
Reuse FFIUVKBoxedSlice for all FFI methods where we return a Vec<String>
nuttycom Aug 25, 2022
6d5b16c
Update to librustzcash version that includes Orchard key generation.
nuttycom Aug 25, 2022
ff04662
Fix documentation related to struct alignment.
nuttycom Aug 26, 2022
9b6d111
Merge pull request #38 from nuttycom/librustzcash_0_7-fix_mem_forget
nuttycom Aug 26, 2022
f170347
Remove Spending key from arguments to `shield_funds`.
pacu Aug 21, 2022
d7d2ab9
Add FFI function to validate spending key `zcashlc_is_valid_sapling_e…
pacu Aug 21, 2022
6ffdf7a
Merge pull request #31 from zcash-hackworks/shield_funds_to_zip_316
nuttycom Aug 26, 2022
014dc55
[#26] make FFI accept byte slices for memos
pacu Jun 1, 2022
84fe7aa
Apply suggestions from code review
nuttycom Sep 6, 2022
41adf69
Clarify db_data string documentation.
nuttycom Sep 6, 2022
6a95020
Merge pull request #27 from zcash-hackworks/make-memos-great-again
nuttycom Sep 6, 2022
d6b0218
Change memo parameters back to *const u8
nuttycom Sep 7, 2022
b968007
Change memo parameters back to *const u8 (#42)
nuttycom Sep 7, 2022
e82feac
Use *mut u8 pointers for memo return.
nuttycom Sep 7, 2022
d29c1f5
Merge pull request #44 from nuttycom/swift_friendly_memos
pacu Sep 8, 2022
4d34d17
Add FFI method to access transparent receiver of UA
str4d Sep 9, 2022
bd08ada
Merge pull request #46 from zcash-hackworks/ua-access-transparent-rec…
str4d Sep 9, 2022
94d626d
Add FFI method to extract typecodes of a UA's receivers
str4d Sep 9, 2022
49084ee
Add links to ZIP 316 about how to interpret typecodes
str4d Sep 10, 2022
ae26b76
Merge pull request #47 from zcash-hackworks/ua-extract-receiver-typec…
nuttycom Sep 14, 2022
2951880
Use unified spending keys instead of Sapling extended spending keys.
nuttycom Sep 8, 2022
a6de2eb
Update CHANGELOG.md
nuttycom Sep 15, 2022
f1df12b
Merge pull request #45 from nuttycom/librustzcash_0_7-usk_encoding
nuttycom Sep 15, 2022
ddf8a35
Update librustzcash & group crate dependency versions.
nuttycom Sep 23, 2022
058491f
Add zcashlc_list_transparent_receivers
nuttycom Sep 23, 2022
9f1b3d9
Merge pull request #49 from nuttycom/librustzcash_0_7-list_taddrs
nuttycom Sep 23, 2022
15d3cc6
Add methods to obtain total transparent account balances.
nuttycom Sep 23, 2022
9a0c487
Merge pull request #50 from nuttycom/librustzcash_0_7-transparent_bal…
nuttycom Sep 23, 2022
8474b0b
Add account balance API methods to the changelog.
nuttycom Sep 28, 2022
d6bbb87
Update librustzcash revision.
nuttycom Sep 28, 2022
13e66d6
Update to librustzcash 022964056fbe6dac8fe3adbf89f29c046cdc4cec
nuttycom Oct 14, 2022
451d5ee
Update `orchard` dependency version.
nuttycom Oct 17, 2022
20c355b
Add the ability to retrieve metadata about a Zcash address string.
nuttycom Oct 17, 2022
4cb3306
Merge pull request #51 from nuttycom/get_zcash_address_metadata
nuttycom Oct 17, 2022
ae4c4f2
Allow the null memo when sending to a taddr
nuttycom Oct 24, 2022
6e164bf
Merge pull request #52 from nuttycom/require_null_memo_to_t
pacu Oct 24, 2022
b7b8fe1
Update to latest librustzcash.
nuttycom Oct 24, 2022
6e8d165
Shield all available funds for the account in `zcashlc_shield_funds`
nuttycom Oct 25, 2022
0e71971
Merge branch 'shield_from_taddr' into librustzcash_0_7
nuttycom Oct 26, 2022
f089d0d
update to latest librustzcash rev
pacu Oct 26, 2022
e18c75d
Merge pull request #60 from zcash-hackworks/update_librustzcash
nuttycom Oct 26, 2022
62f403d
rename SEMVER
pacu Oct 27, 2022
4485728
Update librustzcash dependency version.
nuttycom Nov 4, 2022
6f86561
Update SEMVER for beta.2
pacu Nov 4, 2022
8c4d7e3
SEMVER beta.3 + Update to librustzcash `6047c1d0030b2a40abd35cbc7ba15…
pacu Nov 4, 2022
f98f631
Return anchor height rather than target height
sellout Nov 14, 2022
06157ef
Update CHANGELOG.md
sellout Nov 14, 2022
7290c49
Updates based on Daira’s review
sellout Nov 15, 2022
c89ff21
Update rust/Cargo.toml and rust/src/lib.rs
sellout Nov 15, 2022
4170976
Reformat author section of TOML
sellout Nov 15, 2022
e8716f6
Get anchor heights instead of target heights
sellout Nov 15, 2022
2919de8
Update rust/src/lib.rs
sellout Nov 16, 2022
afeb09e
Document zcashlc_get_memo
sellout Nov 16, 2022
2096654
Complete documentation for zcashlc_decrypt_and_store_transaction
sellout Nov 16, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ rust/target/

# These are build by-products that `make xcframework` produces
products/
Products/

# These are SPM generated files
.swiftpm
112 changes: 109 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,109 @@
# 0.0.3
- [#13] Migrate to `zcash/librustzcash` revision with NU5 awareness (#20)
This enables mobile wallets to send transactions after NU5 activation.
# Unreleased

Unified spending keys are now used in all places where spending authority
is required, both for performing spends of shielded funds and for shielding
transparent funds. Unified spending keys are represented as opaque arrays
of bytes, and FFI methods are provided to permit derivation of viewing keys
from the binary unified spending key representation.

IMPORTANT NOTE: the binary representation of a unified spending key may be
cached, but may become invalid and require re-derivation from seed to use as
input to any of the relevant APIs in the future, in the case that the
representation of the spending key changes or new types of spending authority
are recognized. Spending keys give irrevocable spend authority over
a specific account. Clients that choose to store the binary representation
of unified spending keys locally on device, should handle them with the
same level of care and secure storage policies as the wallet seed itself.

## Added
- `zcashlc_create_account` provides new account creation functionality.
This is now the preferred API for the creation of new spend authorities
within the wallet; `zcashlc_init_accounts_table_with_keys` remains available
but should only be used if it is necessary to add multiple accounts at once,
such as when restoring a wallet from seed where multiple accounts had been
previously derived.

Key derivation API:
- `zcashlc_derive_spending_key`
- `zcashlc_spending_key_to_full_viewing_key`

Address retrieval, derivation, and verification API:
- `zcashlc_get_current_address`
- `zcashlc_get_next_available_address`
- `zcashlc_get_sapling_receiver_for_unified_address`
- `zcashlc_get_transparent_receiver_for_unified_address`
- `zcashlc_is_valid_unified_address`
- `zcashlc_is_valid_unified_full_viewing_key`
- `zcashlc_list_transparent_receivers`
- `zcashlc_get_typecodes_for_unified_address_receivers`
- `zcashlc_free_typecodes`
- `zcashlc_get_address_metadata`
Balance API:
- `zcashlc_get_verified_transparent_balance_for_account`
- `zcashlc_get_total_transparent_balance_for_account`

New memo access API:
- `zcashlc_get_received_memo`
- `zcashlc_get_sent_memo`

## Changed
- `zcashlc_create_to_address` now has been changed as follows:
- it no longer takes the string encoding of a Sapling extended spending key
as spend authority; instead, it takes the binary encoded form of a unified
spending key as returned by `zcashlc_create_account` or
`zcashlc_derive_spending_key`. See the note above.
- it now takes the minimum number of confirmations used to filter notes to
spend as an argument.
- the memo argument is now passed as a potentially-null pointer to an
`[u8; 512]` instead of a C string.
- `zcashlc_shield_funds` has been changed as follows:
- it no longer takes the transparent spending key for a single P2PKH address
as spend authority; instead, it takes the binary encoded form of a unified
spending key as returned by `zcashlc_create_account`
or `zcashlc_derive_spending_key`. See the note above.
- the memo argument is now passed as a potentially-null pointer to an
`[u8; 512]` instead of a C string.
- it no longer takes a destination address; instead, the internal shielding
address is automatically derived from the account ID.
- Various changes have been made to correctly implement ZIP 316:
- `FFIUnifiedViewingKey` now stores an account ID and the encoding of a
ZIP 316 Unified Full Viewing Key.
- `zcashlc_init_accounts_table_with_keys` now takes a slice of ZIP 316 UFVKs.
- `zcashlc_put_utxo` no longer has an `address_str` argument (the address is
instead inferred from the script).
- `zcashlc_get_verified_balance` now takes the minimum number of confirmations
used to filter received notes as an argument.
- `zcashlc_get_verified_transparent_balance` now takes the minimum number of
confirmations used to filter received notes as an argument.
- `zcashlc_get_total_transparent_balance` now returns a balance that includes
all UTXOs including those only in the mempool (i.e. those with 0
confirmations).

## Removed

The following spending key derivation APIs have been removed and replaced by
`zcashlc_derive_spending_key`:
- `zcashlc_derive_extended_spending_key`
- `zcashlc_derive_transparent_private_key_from_seed`
- `zcashlc_derive_transparent_account_private_key_from_seed`

The following viewing key APIs have been removed and replaced by
`zcashlc_spending_key_to_full_viewing_key`:
- `zcashlc_derive_extended_full_viewing_key`
- `zcashlc_derive_shielded_address_from_viewing_key`
- `zcashlc_derive_unified_viewing_keys_from_seed`

The following address derivation APIs have been removed in favor of
`zcashlc_get_current_address` and `zcashlc_get_next_available_address`:
- `zcashlc_get_address`
- `zcashlc_derive_shielded_address_from_seed`
- `zcashlc_derive_transparent_address_from_secret_key`
- `zcashlc_derive_transparent_address_from_seed`
- `zcashlc_derive_transparent_address_from_public_key`

- `zcashlc_init_accounts_table` has been removed in favor of
`zcashlc_create_account`

# 0.0.3
- [#13] Migrate to `zcash/librustzcash` revision with NU5 awareness (#20)
This enables mobile wallets to send transactions after NU5 activation.
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,17 @@ Depending on what state the intermediate build products might be in, you may fir
2. Update `s.version` in `libzcashlc.podspec` to the new release version.
3. (assuming you have the `pod` command) `pod trunk push libzcashlc.podspec`


## License

Licensed under MIT license ([LICENSE](LICENSE) or http://opensource.org/licenses/MIT).

Downstream code forks should note that 'libzcashlc' (and thus XCFramework)
depends on the 'orchard' crate, which is licensed under the [Bootstrap Open
Source License](https://github.com/zcash/orchard/blob/main/LICENSE-BOSL). A
license exception is provided allowing some derived works that are linked or
combined with the 'orchard' crate to be copied or distributed under the original
licenses (in this case MIT), provided that the included portions of the
'orchard' code remain subject to BOSL. See
https://github.com/zcash/orchard/blob/main/COPYING for details of which derived
works can make use of this exception.
2 changes: 1 addition & 1 deletion libzcashlc.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'libzcashlc'
s.version = '0.0.3'
s.version = '0.1.0-beta.3'
s.summary = 'Rust core for Zcash clients'
s.homepage = 'https://github.com/zcash-hackworks/zcash-light-client-ffi'
s.license = { :type => 'MIT', :file => 'LICENSE' }
Expand Down
Loading