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.
SdkSynchronizer.closeFlow()is a Flow-providing version ofSynchronizer.close(). It safely closes the Synchronizer together with the related components.WalletCoordinator.deleteSdkDataFlowis a Flow-providing function that deletes all the persisted data in the SDK (databases associated with the wallet, all compact blocks, and data derived from those blocks) but preserves the wallet secrets.
- The SDK components no longer contain logging statements in the release build
safelyConvertToBigDecimal()API fromCurrencyFormatter.ktnow expects decimal separator Char on input- Gradle 8.7
- Android Gradle Plugin 8.3.0
- Kotlin 1.9.23
- Other dependencies update
- Checkpoints update
- The Orchard support has been finished, and the SDK now fully supports sending and receiving funds on the Orchard addresses
- SDK release 1.11.0-beta01 documented that
Synchronizer.newwould throw an exception indicating that an internal migration requires the wallet seed, if called withnull. This has been unintentionally broken the entire time: the handling logic for this case was accidentally removed shortly after it was added. The SDK now correctly throwsInitializeException.SeedRequired.
Synchronizer.refreshAllBalancesnow refreshes the Orchard balances as well- The SDK uses ZIP-317 fee system internally
ZcashSdk.MINERS_FEEhas been deprecated, and will be removed in 2.1.xZecSenddata class now providesProposal?object initiated usingSynchronizer.proposeTransfer- Wallet initialization using
Synchronizer.newnow could throw a newSeedNotRelevantexception when the provided seed is not relevant to any of the derived accounts in the wallet database - Checkpoints update
Synchronizer.sendToAddressandSynchronizer.shieldFundsnow throw an exception if the created transaction successfully reacheslightwalletdbut fails to reach its backing full node's mempool.
WalletBalancenow contains new fieldschangePendingandvaluePending. Fieldstotalandpendingare still provided. See more in the class documentationsdk-lib/src/main/java/cash/z/ecc/android/sdk/model/WalletBalance.ktSynchronizer.transparentBalances: WalletBalancetoSynchronizer.transparentBalance: ZatoshiWalletSnapshot.transparentBalance: WalletBalancetoWalletSnapshot.transparentBalance: ZatoshiMemo.MAX_MEMO_LENGTH_BYTESis now available in public APISynchronizer.sendToAddressandSynchronizer.shieldFundshave been deprecated, and will be removed in 2.1.x (which will create multiple transactions at once for some recipients).
- APIs that enable constructing a proposal for transferring or shielding funds,
and then creating transactions from a proposal. The intermediate proposal can
be used to determine the required fee, before committing to producing
transactions.
Synchronizer.proposeTransferSynchronizer.proposeShieldingSynchronizer.createProposedTransactions
WalletBalanceFixtureclass with mock values that are supposed to be used only for testing purposesMemo.countLength(memoString: String)to count memo length in bytesPersistableWallet.toSafeStringis a safe alternative for the regular [toString] function that prints only non-sensitive partsSynchronizer.validateServerEndpointthis function checks whether the provided server endpoint is valid. The validation is based on comparing:- network type
- sapling activation height
- consensus branch id
- In 2.0.5,
Synchronizer.shieldFundsalways returned an error due to a crash on the Rust side. This release fixes the underlying bug.
cash.z.ecc.android.sdk.model.Proposal(currently unused in the public API).- System tracing to
CompactBlockProcessorand the Rust backend.
- Migrated to NDK 26.1.10909125 and Rust 1.75.0.
- The wallet balances are now updated immediately upon synchronizer start.
- Existing wallets will now only fetch the most recent subtree roots, improving synchronizer startup times.
- Performance of block scanning and
SdkSynchronizer.refreshAllBalanceshas been improved. WalletAddressFixturefixture properties have been updated
- The transparent wallet balance
StateFlownow shows the total transparent balance in the wallet, instead of the balance of the default address. It also now treats all zero-conf balance as available.
SdkSynchronizer.refreshSaplingBalanceandSdkSynchronizer.refreshTransparentBalance(useSdkSynchronizer.refreshAllBalancesinstead).
TransactionOverview.txIdString()to provide a readable transaction ID to SDK-consuming appsMonetarySeparators.current(locale: Locale? = null)now acceptsLocaleon input to force separators locale. If no value is provided, the default one is used.
LightWalletEndpointExtand its functions and variables were removed from the SDK's public APIs entirely. It's preserved only for testing and wallet Demo app purposes. The calling wallet app should provide its ownLightWalletEndpointinstance withinPersistableWalletorSdkSynchronizerAPIs.
- Gradle 8.5
- Kotlin 1.9.21
- Other dependency update
- Checkpoints update
- Several internally unused exceptions from
Exceptions.kt
Synchronizer.getExistingDataDbFilePathpublic API to check and provide file path to the existing data database file or throws [InitializeException.MissingDatabaseException] if the database doesn't exist yet. See #1292.
CompactBlockProcessorswitched internally from balance and progress FFIs to wallet summary FFI APIs. This change brings a block synchronization speed up. No action is required on the client side. See #1282.- Checkpoints update
- Incorrect note deduplication in the
v_transactionsdatabase view: This is a fix in the Rust layer. The amount sent in the transaction was incorrectly reported even though the actual amount was correctly sent. Now, clients should see the amount they expect to see.
- Checkpoints update
PersistableWalletAPI provides a newendpointparameter of typeLightWalletEndpoint, which could be used for the Lightwalletd server customization. The new parameter is part of PersistableWallet persistence. The SDK handles the persistence migration internally.- The 1_000 Zatoshi fee proposed in ZIP-313 is deprecated now, so the minimum is 10_000 Zatoshi, defined in
ZIP-317—the
ZcashSdk.MINERS_FEEnow returns the correct value as described above. Note that the actual fee is handled in a rust layer. - Adopted the latest Bip39 library v1.0.6
Transparent balance is now correctly updated after a shielding transaction is created, instead of only once the transaction is mined.
The Kotlin layer of the SDK now correctly matches the Rust layer PrevHashMismatch exception with ContinuityError
and triggers rewind action.
- Some of the
TransactionOverviewclass parameters changed:idwas removedindexis nullablefeePaidis nullableblockTimeEpochSecondsis nullable
- Block heights are absolute, not relative. Thus, these two operations above the
BlockHeightobject were removed:plus(other: BlockHeight): BlockHeightminus(other: BlockHeight): BlockHeight
CompactBlockProcessornow processes compact blocks from the lightwalletd server using the Spend-before-Sync algorithm, which allows scanning of wallet blocks to be performed in arbitrary order and optimized to make it possible to spend received notes without waiting for synchronization to be complete. This feature shortens the time until a wallet's spendable balance can be used.- The block synchronization mechanism is additionally about one-third faster
thanks to an optimized
CompactBlockProcessor.SYNC_BATCH_SIZE(issue #1206).
CompactBlockProcessor.ProcessorInfo.lastSyncHeightno longer had a well-defined meaning after implementation of the SpendBeforeSync synchronization algorithm and has been removed.CompactBlockProcessor.ProcessorInfo.overallSyncRangeprovides related information.CompactBlockProcessor.ProcessorInfo.isSyncing. UseSynchronizer.statusinstead.CompactBlockProcessor.ProcessorInfo.syncProgress. UseSynchronizer.progressinstead.alsoClearBlockCacheparameter from rewind functions ofSynchronizerandCompactBlockProcessor, as it has no effect on the current behaviour of these functions.- Internally, we removed access to the shared block table from the Kotlin
layer, which resulted in eliminating these APIs:
SdkSynchronizer.findBlockHash()SdkSynchronizer.findBlockHashAsHex()
CompactBlockProcessor.quickRewind()andCompactBlockProcessor.rewindToNearestHeight()now might fail due to internal changes in getting scanned height. Thus, these functions now returnBooleanresults.Synchronizer.new()andPersistableWalletAPIs require a newwalletInitModeparameter of typeWalletInitMode, which describes wallet initialization mode. See related function and sealed class documentation.
Synchronizer.getMemos()now correctly returns a flow of strings for sent and received transactions. Issue #1154.CompactBlockProcessornow triggers transaction polling while block synchronization is in progress as expected. Clients will be notified shortly after every new transaction is discovered viaSynchronizer.transactionsAPI. Issue #1170.
Note: This is the last 1.x version release. The upcoming version 2.0 brings the Spend-before-Sync feature, which speeds up discovering the wallet's spendable balance.
- Updated dependencies:
- Gradle 8.3
- AGP 8.1.1
- Kotlin 1.9.10
- Coroutines 1.7.3
- Compose
- AndroidX
- gRPC/Protobuf
- etc.
- Checkpoints
- The SDK internally migrated from
BackendExtrust backend extension functions to more type-safeTypesafeBackend. Synchronizer.getMemos()now internally handles expectedRuntimeExceptionfrom the rust layer and transforms it in an empty string.
- Adopted the latest Bip39 version 1.0.5
TransactionOverviewobject returned withSdkSynchronizer.transactionsnow contains a correctTransactionState. Pendingin case of the transaction is mined,but not fully confirmed.- When the SDK internally works with a recently created transaction there was a moment in which could the transaction causes the SDK to crash, because of its invalid mined height. Fixed now.
- Synchronizer's functions
getUnifiedAddress,getSaplingAddress,getTransparentAddress, andrefreshUtxosnow do not provideAccount.DEFAULTvalue for the account argument. As accounts are not fully supported by the SDK yet, the caller should explicitly set Account.DEFAULT as the account argument to keep the same behavior. - Gradle 8.1.1
- AGP 8.0.2
- Transparent fund balances are now displayed almost immediately
- Synchronization of shielded balances and transaction history is about 30% faster
- Disk space usage is reduced by about 90%
Synchronizer.statushas been simplified by combiningDOWNLOADING,VALIDATING, andSCANNINGstates into a singleSYNCINGstate.Synchronizer.progressnow returnsFlow<PercentDecimal>instead ofFlow<Int>. PercentDecimal is a type-safe model. UsePercentDecimal.toPercentage()to get a number within 0-100% scale.Synchronizer.clearedTransactionshas been renamed toSynchronizer.transactionsand includes sent, received, and pending transactions. Synchronizer APIs for listing sent, received, and pending transactions have been removed. Clients can determine whether a transaction is sent, received, or pending by filtering theTransactionOverviewobjects returned bySynchronizer.transactionsSynchronizer.send()andshieldFunds()are nowsuspendfunctions withLongreturn values representing the ID of the newly created transaction. Errors are reported by thrown exceptions.DerivationToolis now an interface, rather than anobject, which makes it easier to inject alternative implementations into tests. To adapt to the new API, replace calls toDerivationTool.methodName()withDerivationTool.getInstance().methodName().DerivationToolmethods are no longer suspending, which should make it easier to call them in various situations. Obtaining aDerivationToolinstance viaDerivationTool.getInstance()frontloads the need for a suspending call.DerivationTool.deriveUnifiedFullViewingKeys()no longer has a default argument fornumberOfAccounts. Clients should now passDerivationTool.DEFAULT_NUMBER_OF_ACCOUNTSas the value. Note that the SDK does not currently have proper support for multiple accounts.- The SDK's internals for connecting with librustzcash have been refactored to a separate Gradle module
backend-lib(and therefore a separate artifact) which is a transitive dependency of the Zcash Android SDK. SDK consumers that use Gradle dependency locks may notice this difference, but otherwise it should be mostly an invisible change.
(This version was only deployed as a snapshot and not released on Maven Central)
- The minimum supported version of Android is now API level 27.
- A new package
sdk-incubator-libis now available as a public API. This package contains experimental APIs that may be promoted to the SDK in the future. The APIs in this package are not guaranteed to be stable, and may change at any time. Synchronizer.refreshUtxosnow takesAccounttype as first parameter instead of transparent address of typeString, and thus it downloads all UTXOs for the given account addresses. The Account object provides a default0index Account withAccount.DEFAULT.
- The minimum supported version of Android is now API level 24.
- The SDK's internal networking has been refactored to a separate Gradle module
lightwallet-client-lib(and therefore a separate artifact) which is a transitive dependency of the Zcash Android SDK.- The
z.cash.ecc.android.sdk.model.LightWalletEndpointclass has been moved toco.electriccoin.lightwallet.client.model.LightWalletEndpoint - The new networking module now provides a
LightWalletClientfor asynchronous calls. - Most unary calls respond with the new
Responseclass and its subclasses. Streaming calls will be updated with the Response class later. - SDK clients should avoid using generated GRPC objects, as these are an internal implementation detail and are in process of being removed from the public API. Any clients using GRPC objects will find these have been repackaged from
cash.z.wallet.sdk.rpctocash.z.wallet.sdk.internal.rpcto signal they are not a public API.
- The
TransactionOverview,Transaction.Sent, andTransaction.ReceivedhaveminedHeightas a nullable field now. This fixes a potential crash when fetching transactions when a transaction is in the mempool
cash.z.ecc.android.sdk:Synchronizer.getUnifiedAddressSynchronizer.getSaplingAddressSynchronizer.isValidUnifiedAddrSynchronizer.getMemos(TransactionOverview)Synchronizer.getReceipients(TransactionOverview)
cash.z.ecc.android.sdk.model:AccountFirstClassByteArrayPendingTransactionTransactionUnifiedSpendingKey
cash.z.ecc.android.sdk.tool:DerivationTool.deriveUnifiedSpendingKeyDerivationTool.deriveUnifiedFullViewingKeyDerivationTool.deriveTransparentAccountPrivateKeyDerivationTool.deriveTransparentAddressFromAccountPrivateKeyDerivationTool.deriveUnifiedAddressDerivationTool.deriveUnifiedFullViewingKeysDerivationTool.validateUnifiedFullViewingKey- Still unimplemented.
cash.z.ecc.android.sdk.type:AddressType.UnifiedUnifiedFullViewingKey, representing a Unified Full Viewing Key as specified in ZIP 316.
- The following methods now take or return
UnifiedFullViewingKeyinstead ofUnifiedViewingKey:cash.z.ecc.android.sdk:Initializer.Config.addViewingKeyInitializer.Config.importWalletInitializer.Config.newWalletInitializer.Config.setViewingKeys
cash.z.ecc.android.sdk:Synchronizer.Companion.newnow takes many of the arguments previously passed toInitializer. In addition, an optionalseedargument is required for first-time initialization or ifSynchronizer.newthrows an exception indicating that an internal migration requires the wallet seed. (This second case will be true the first time existing clients upgrade to this new version of the SDK).Synchronizer.new()now returns an instance that implements theCloseableinterface.Synchronizer.stop()is effectively renamed toSynchronizer.close()Synchronizerensures that multiple instances cannot be running concurrently with the same network and aliasSynchronizer.sendToAddressnow takes aUnifiedSpendingKeyinstead of an encoded Sapling extended spending key, and thefromAccountIndexargument is now implicit in theUnifiedSpendingKey.Synchronizer.shieldFundsnow takes aUnifiedSpendingKeyinstead of separately encoded Sapling and transparent keys.Synchronizermethods that previously took anIntfor account index now take anAccountobjectSynchronizer.sendToAddress()andSynchronizer.shieldFunds()return flows that can now be collected multiple times. Prior versions of the SDK had a bug that could submit transactions multiple times if the flow was collected more than once.
- Updated dependencies:
- Kotlin 1.7.21
- AndroidX
- etc.
- Updated checkpoints
cash.z.ecc.android.sdk:Initializer(useSynchronizer.newinstead)Synchronizer.start()- Synchronizer is now started automatically when constructing a new instance.Synchronizer.getAddress(useSynchronizer.getUnifiedAddressinstead).Synchronizer.getShieldedAddress(useSynchronizer.getSaplingAddressinstead)Synchronizer.cancelSynchronizer.cancelSpend
cash.z.ecc.android.sdk.type.UnifiedViewingKey- This type had a bug where the
extpubfield actually was storing a plain transparent public key, and not the extended public key as intended. This made it incompatible with ZIP 316.
- This type had a bug where the
cash.z.ecc.android.sdk.tool:DerivationTool.deriveSpendingKeys(useDerivationTool.deriveUnifiedSpendingKeyinstead)DerivationTool.deriveViewingKey(useDerivationTool.deriveUnifiedFullViewingKeyinstead)DerivationTool.deriveTransparentAddress(useSynchronizer.getLegacyTransparentAddressinstead).DerivationTool.deriveTransparentAddressFromPrivateKey(useSynchronizer.getLegacyTransparentAddressinstead).DerivationTool.deriveTransparentAddressFromPublicKey(useSynchronizer.getLegacyTransparentAddressinstead).DerivationTool.deriveTransparentSecretKey(useDerivationTool.deriveUnifiedSpendingKeyinstead).DerivationTool.deriveShieldedAddressDerivationTool.deriveUnifiedViewingKeys(useDerivationTool.deriveUnifiedFullViewingKeyinstead)DerivationTool.validateUnifiedViewingKey
- The minimum version of Android supported is now API 21
- Fixed R8/ProGuard consumer rule, which eliminates a runtime crash for minified apps
- The SDK now stores sapling param files in
no_backup/co.electricoin.zcashfolder instead of thecache/paramsfolder. Besides that,SaplingParamToolalso does validation of downloaded sapling param file hash and size. No action required from client app.
- No changes; this release is a test of a new deployment process
- The SDK now stores database files in
no_backup/co.electricoin.zcashfolder instead of thedatabasefolder. No action required from client app.
- Split
ZcashNetworkintoZcashNetworkandLightWalletEndpointto decouple network and server configuration - Gradle 7.5.1
- Updated checkpoints
- Enabled automated unit tests run on the CI server
- Added
BlockHeighttypesafe object to represent block heights - Significantly reduced memory usage, fixing potential OutOfMemoryError during block download
- Kotlin 1.7.10
- Updated checkpoints
- Added
Zatoshitypesafe object to represent amounts. - Kotlin 1.7.0
- Updated checkpoints for Mainnet and Testnet
- Fix: SDK can now be used on Intel x86_64 emulators
- Prevent R8 warnings for apps consuming the SDK
- New: Transactions can be created after NU5 activation.
- New: Support for receiving v5 transactions.
- Known issues: The SDK will not run on Intel 64-bit API 31+ emulators. Workarounds include: testing on a physical device, using an older 32-bit API version Intel emulator, or using an ARM emulator.
- Main entrypoint to the SDK has changed. See MIGRATIONS.md
- The minimum version of Android supported is now API 19
- Updated checkpoints for Mainnet and Testnet
- Internal bugfixes around concurrent access to resources, which could cause transient failures and data corruption
- Added ProGuard rules so that SDK clients can use R8 to shrink their apps
- Updated dependencies, including Kotlin 1.6.21, Coroutines 1.6.1, GRPC 1.46.0, Okio 3.1.0, NDK 23
- Known issues: The SDK will not run on Intel 64-bit API 31+ emulators. Workarounds include: testing on a physical device, using an older 32-bit API version Intel emulator, or using an ARM emulator.
- New: Updated checkpoints for Mainnet and Testnet
- New: Updated checkpoints for Mainnet and Testnet
- Fix: Repackaged internal classes to a new
internalpackage name - Fix: Testnet checkpoints have been corrected
- Updated dependencies
- Fix: Corrected logic when calculating birthdates for wallets with zero received notes.
- Fix: Autoshielding confirmation count error so funds are available after 10 confirmations.
- New: Allow developers to enable Rust logs.
- New: Accept GZIP compression from lightwalletd.
- New: Reduce the UTXO retry time.
- Fix: Gracefully handle failures while fetching UTXOs.
- New: Expose StateFlows for balances.
- New: Make it easier to subscribe to transactions.
- New: Cleanup default logs.
- New: Convenience functions for WalletBalance objects.
- Fix: Increase reconnection attempts on failed app restart.
- New: Updated checkpoints for testnet and mainnet.
- New: Add separate flows for sapling, orchard and tranparent balances.
- Fix: Continue troubleshooting and fixing server disconnects.
- Updated dependencies.
- New: Expose network height as StateFlow.
- Fix: Reconnect to lightwalletd when a service exception occurs.
- Fix: Remove unused flag that was breaking new wallet creation for some wallets.
- Fix: Make it safe to call the new prepare function more than once.
- New: Add quick rewind feature, which makes it easy to rescan blocks after an upgrade.
- Fix: Repair complex data migration bug that caused crashes on upgrades.
- Fix: Disable librustzcash logs by default.
- Fix: Address issues with key migration, allowing wallets to reset viewing keys, when needed.
- Fix: Repair publishing so that AARs work on Windows machines [issue #222].
- Fix: Incorrect BranchId on 32-bit devics [issue #224].
- Fix: Rescan should not go beyond the wallet checkpoint.
- New: Drop Android Jetifier since it is no longer used.
- Updated checkpoints, improved tests (added Test Suites) and better error messages.
- Major: Consolidate product flavors into one library for the SDK instead of two.
- Major: Integrates with latest Librustzcash including full Data Access API support.
- Major: Move off of JCenter and onto Maven Central.
- New: Adds Ktlint [Credit: @nighthawk24]
- Fix: Added SaplingParamTool and ability to clear param files from cache [Credit: @herou]
- New: Added responsible disclosure document for vulnerabilities [Credit: @zebambam]
- New: UnifiedViewingKey concept.
- New: Adds support for autoshielding, including database migrations.
- New: Adds basic support for UTXOs, including refresh during scan.
- New: Support the ability to wipe all sqlite data and rebuild from keys.
- New: Switches to ZOMG lightwalletd instances.
- Fix: Only notify subscribers when a new block is detected.
- New: Add scan metrics and callbacks for apps to measure performance.
- Fix: Improve error handling and surface critical Initialization errors.
- New: Adds cleanup and removal of failed transactions.
- New: Improved logic for determining the wallet birthday.
- New: Add the ability to rewind and rescan blocks.
- New: Better safeguards against testnet v mainnet data contamination.
- New: Improved troubleshooting of ungraceful shutdowns.
- Docs: Update README to draw attention to the demo app.
- New: Expose transaction count.
- New: Derive sapling activation height from the active network.
- New: Latest checkpoints for mainnet and testnet.
- New: Updated to latest versions of grpc, grpc-okhttp and protoc
- Fix: Addresses root issue of Android 11 crash on SSL sockets
- New: Implements ZIP-313, reducing the default fee from 10,000 to 1,000 zats.
- Fix: 80% reduction in build warnings from 90 -> 18 and improved docs [Credit: @herou].
- New: Improve birthday configuration and config functions.
- Fix: Broken layout in demo app transaction list.
- New: Added latest checkpoints for testnet and mainnet.
- New: Added display name for Canopy.
- New: Update to the latest lightwalletd service definition.
- Fix: Convert Initializer.Builder to Initializer.Config to simplify the constructors.
- New: Added ability to erase initializer data.
- Fix: Updated to latest librustzcash, fixing send functionality on Canopy.
- New: Modified visibility on a few things to facilitate partner integrations.
- Fix: Publishing has been corrected by jcenter's support team.
- New: Minor improvement to initializer
- New: Synchronizer can now be started with just a viewing key.
- New: Initializer improvements.
- New: Added tool for loading checkpoints.
- New: Added tool for deriving keys and addresses, statically.
- New: Updated and revamped the demo apps.
- New: Added a bit more (unofficial) t-addr support.
- Fix: Broken testnet demo app.
- Fix: Publishing configuration.
- New: Add support for canopy on testnet.
- New: Change the default lightwalletd server.
- New: Add lightwalletd service for fetching t-addr transactions.
- New: prove the concept of local RPC via protobufs.
- New: Iterate on the demo app.
- New: Added new checkpoints.
- Fix: Minor enhancements.
- New: Add robust support for transaction cancellation.
- New: Update to latest version of librustzcash.
- New: Expand test support.
- New: Improve and simplify intialization.
- New: Flag when rust is running in debug mode, causing a 10X slow down.
- New: Contributing guidelines.
- Fix: Minor cleanup and improvements.