Module wallet

Source
Expand description

§Functions for creating Zcash transactions that spend funds belonging to the wallet

This module contains several different ways of creating Zcash transactions. This module is designed around the idea that a Zcash wallet holds its funds in notes in either the Orchard or Sapling shielded pool. In order to better preserve users’ privacy, it does not provide any functionality that allows users to directly spend transparent funds except by sending them to a shielded internal address belonging to their wallet.

The important high-level operations provided by this module are propose_transfer, and create_proposed_transactions.

propose_transfer takes a TransactionRequest object, selects inputs notes and computes the fees required to satisfy that request, and returns a Proposal object that describes the transaction to be made.

create_proposed_transactions constructs one or more Zcash [Transaction]s based upon a provided Proposal, stores them to the wallet database, and returns the [TxId] for each constructed transaction to the caller. The caller can then use the WalletRead::get_transaction method to retrieve the newly constructed transactions. It is the responsibility of the caller to retrieve and serialize the transactions and submit them for inclusion into the Zcash blockchain.

Another important high-level operation provided by this module is propose_shielding, which takes a set of transparent source addresses, and constructs a Proposal to send those funds to a wallet-internal shielded address, as described in ZIP 316.

Modules§

input_selection
Types related to the process of selecting inputs to be spent given a transaction request.

Functions§

create_proposed_transactions
Construct, prove, and sign a transaction or series of transactions using the inputs supplied by the given proposal, and persist it to the wallet database.
decrypt_and_store_transaction
Scans a [Transaction] for any information that can be decrypted by the accounts in the wallet, and saves it to the wallet.
propose_shieldingtransparent-inputs
Constructs a proposal to shield all of the funds belonging to the provided set of addresses.
propose_standard_transfer_to_address
Proposes making a payment to the specified address from the given account.
propose_transfer
Select transaction inputs, compute fees, and construct a proposal for a transaction or series of transactions that can then be authorized and made ready for submission to the network with create_proposed_transactions.
shield_transparent_fundstransparent-inputs
Constructs a transaction that consumes available transparent UTXOs belonging to the specified secret key, and sends them to the most-preferred receiver of the default internal address for the provided Unified Spending Key.

Type Aliases§

CreateErrT
Errors that may be generated in combined creation and execution of transaction proposals.
ProposeShieldingErrTtransparent-inputs
Errors that may be generated in construction of proposals for transparent->shielded wallet-internal transfers.
ProposeTransferErrT
Errors that may be generated in construction of proposals for shielded->shielded or shielded->transparent transfers.
ShieldErrTtransparent-inputs
Errors that may be generated in the execution of shielding proposals.
TransferErrT
Errors that may be generated in the execution of proposals that may send shielded inputs.