zcash-light-client-ffi/CHANGELOG.md

12 KiB

Changelog

All notable changes to this library will be documented in this file.

The format is based on Keep a Changelog, and this library adheres to Semantic Versioning.

Unreleased

0.8.0 - 2024-04-17

Added

  • zcashlc_is_valid_sapling_address

Changed

  • Updates to zcash_client_sqlite version 0.10.3 to add migrations that ensure the wallet's default Unified address contains an Orchard receiver.
  • zcashlc_get_memo now takes an additional output_pool parameter. This fixes a problem with the retrieval of Orchard memos.

Removed

  • zcashlc_is_valid_shielded_address - use zcashlc_is_valid_sapling_address instead.

0.7.4 - 2024-03-28

Added

  • zcashlc_put_orchard_subtree_roots

0.7.3 - 2024-03-27

  • Updates to zcash_client_backend 0.12.1 to fix a bug in note selection when sending to a transparent recipient.

0.7.2 - 2024-03-27

  • Updates to zcash_client_sqlite 0.10.2 to fix a bug in an SQL query that prevented shielding of transparent funds.

0.7.1 - 2024-03-25

  • Updates to zcash_client_sqlite version 0.10.1 to fix an incorrect constraint on the sent_notes table. Databases built or upgraded using version 0.7.0 will need to be deleted and restored from seed.

0.7.0 - 2024-03-25

This version has been yanked due to a bug in zcash_client_sqlite version 0.10.0

Notable Changes

  • Adds Orchard support.

Added

  • Structs and functions for listing accounts in the wallet:
    • zcashlc_list_accounts
    • zcashlc_free_accounts
    • FfiAccounts
    • FfiAccount
  • zcashlc_is_seed_relevant_to_any_derived_account

Changed

  • Update to zcash_client_backend version 0.12.0 and zcash_client_sqlite version 0.10.0.
  • zcashlc_scan_blocks now takes a TreeState protobuf object that provides the frontiers of the note commitment trees as of the end of the block prior to the range being scanned.

0.6.0 - 2024-03-07

Added

  • zcashlc_create_proposed_transactions

Changed

  • Migrated to zcash_client_sqlite 0.9.

  • zcashlc_propose_shielding now raises an error if more than one transparent receiver has funds that require shielding, to avoid creating transactions that link these receivers on chain. It also now takes a transparent_receiver argument that can be used to select a specific receiver for which to shield funds.

  • zcashlc_propose_shielding now returns a "none" FfiBoxedSlice (with its ptr field set to null) if there are no funds to shield, or if the funds are below shielding_threshold.

Removed

  • zcashlc_create_proposed_transaction (use zcashlc_create_proposed_transactions instead).

0.5.1 - 2024-01-30

Update to librustzcash tag ecc_sdk-20240130a.

Fixes

This release fixes a problem in the serialization of transaction proposals having empty transaction requests (shielding transactions are change-only and contain no payments.)

0.5.0 - 2024-01-29

Notable Changes

This release updates the librustzcash dependencies to the stable interim tag ecc_sdk-20240129. This provides improvements to wallet query performance that have not yet been released in a published version of the zcash_client_sqlite crate, as well as numerous unreleased changes to the zcash_client_backend and zcash_primitives crates.

Added

  • FFI data structures:
    • FfiBalance
    • FfiAccountBalance
    • FfiWalletSummary
    • FfiScanSummary
    • FfiBoxedSlice
  • FFI methods:
    • zcashlc_propose_transfer
    • zcashlc_propose_transfer_from_uri
    • zcashlc_propose_shielding
    • zcashlc_create_proposed_transaction
    • zcashlc_get_wallet_summary
    • zcashlc_free_wallet_summary
    • zcashlc_free_boxed_slice
    • zcashlc_free_scan_summary

Changed

  • zcashlc_scan_blocks now returns a FfiScanSummary value.

Removed

  • zcashlc_get_balance (use zcashlc_get_wallet_summary instead)
  • zcashlc_get_scan_progress (use zcashlc_get_wallet_summary instead)
  • zcashlc_get_verified_balance (use zcashlc_get_wallet_summary instead)
  • zcashlc_create_to_address (use zcashlc_propose_transfer and zcashlc_create_proposed_transaction instead)
  • zcashlc_shield_funds (use zcashlc_propose_shielding and zcashlc_create_proposed_transaction instead)

0.4.1 - 2023-10-20

Issues Resolved

Updated dependencies:

  • zcash_client_sqlite 0.8.1

0.4.0 - 2023-09-25

Notable Changes

This release overhauls the FFI library to provide support for allowing wallets to spend funds without fully syncing the blockchain. This results in significant changes to much of the API; it is recommended that users review the changes from the previous release carefully.

Changed

  • anyhow is now used for error management

Issues Resolved

  • [#95] Update to zcash_client_backend and zcash_client_sqlite with fast sync support

Updated dependencies:

  • zcash_address 0.3

  • zcash_client_backend 0.10.0

  • zcash_client_sqlite 0.8.0

  • zcash_primitives 0.13.0

  • zcash_proofs 0.13.0

  • orchard 0.6

  • ffi_helpers 0.3

  • secp256k1 0.26

Added dependencies:

  • anyhow 0.1
  • prost 0.12
  • cfg-if 1.0
  • rayon 1.7
  • log-panics 2.0
  • once_cell 1.0
  • sharded-slab 0.1
  • tracing 0.1
  • tracing-subscriber 0.3

0.3.1

  • [#88] unmined transaction shows note value spent instead of tx value

Fixes an issue where a sent transaction would show the whole note spent value instead of the value of that the user meant to transfer until it was mined.

0.3.0

  • [#87] Outbound transactions show the wrong amount on v_transactions

removes v_tx_received and v_tx_sent.

v_transactions now shows the account_balance_delta column where the clients can query the effect of a given transaction in the account balance. If fee was paid from the account that's being queried, the delta will include it. Transactions where funds are received into the queried account, will show the amount that the acount is receiving and won't include the transaction fee since it does not change the balance of the account.

Creates v_tx_outputs that allows clients to know the outputs involved in a transaction.

0.2.0

  • [#34] Fix SwiftPackageManager deprecation Warning We had to change the name of the package to make it match the name of the github repository due to Swift Package Manager conventions.

please see README.md for more information on how to import this package going forward.

FsBlock Db implementation and removal of BlockBb cache.

Implements zcashlc_init_block_metadata_db, zcashlc_write_block_metadata, zcashlc_free_block_meta, zcashlc_free_blocks_meta

Declare repr(C) structs for FFI:

  • FFIBlockMeta: a block metadata row
  • FFIBlocksMeta: a structure that holds an array of FFIBlockMeta

expose shielding threshold for shield_funds

  • [#81] Adopt latest crate versions Bumped dependencies to zcash_primitives 0.10, zcash_client_backend 0.7, zcash_proofs 0.10, zcash_client_sqlite 0.5.0

this adds support for min_confirmations on shield_funds and shielding_threshold.

  • [#78] removing cocoapods support

0.1.1

Updating:

 - zcash_client_backend v0.6.0 -> v0.6.1
 - zcash_client_sqlite v0.4.0 -> v0.4.2
 - zcash_primitives v0.9.0 -> v0.9.1

This fixes the following issue

  • [#72] fixes get_transparent_balance() fails when no UTXOs

0.1.0

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.