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.
Re-exports§
pub use super::locking::LockRequest;pub use super::locking::unlock_proposal_inputs;
Modules§
- input_
selection - Types related to the process of selecting inputs to be spent given a transaction request.
Structs§
- Confirmations
Policy - Confirmations
Policy Error - A description of the policy that is used to determine what notes are available for spending, based upon the number of confirmations (the number of blocks in the chain since and including the block in which a note was produced.)
- Spending
Keys - A set of spending keys for an account, for use in execution of transaction proposals.
- Target
Height - A wrapper type around [
BlockHeight] that represents the next chain tip.
Enums§
- Signer
View pczt - Selects the view produced by
redact_pczt_for_signer, according to the capabilities of the receiving Signer.
Functions§
- create_
pczt_ from_ proposal pczt - Constructs a transaction using the inputs supplied by the given proposal.
- 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. - extract_
and_ store_ transaction_ from_ pczt pczt - Finalizes the given PCZT, and persists the transaction to the wallet database.
- propose_
send_ max_ transfer - Proposes spending the maximum available value from the given shielded pools, sending it to a single recipient.
- propose_
shielding transparent-inputs - Constructs a proposal to shield all of the funds belonging to the provided set of addresses.
- propose_
shielding_ coinbase transparent-inputs - Constructs a proposal to shield one or more coinbase transparent outputs to an arbitrary shielded recipient.
- 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. - redact_
pczt_ for_ batch_ signer pczt - Creates a compact wallet PCZT for a batch Signer that obtains its full viewing key independently and returns only new Orchard and Ironwood signatures.
- redact_
pczt_ for_ signer pczt - Creates a redacted copy of a wallet PCZT for an external Signer.
- shield_
transparent_ funds transparent-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§
- Create
ErrT - Errors that may be generated in combined creation and execution of transaction proposals.
- Extract
ErrT pczt - Errors that may be generated when extracting a transaction from a PCZT.
- Propose
Send MaxErrT - Errors that may be generated in construction of proposals for shielded->shielded or shielded->transparent transactions that transfer the maximum value available within an account and do not produce change outputs.
- Propose
Shielding Coinbase ErrT transparent-inputs - Errors that may be generated in construction of proposals for shielding coinbase
transparent outputs to an arbitrary shielded recipient via
propose_shielding_coinbase. - Propose
Shielding ErrT transparent-inputs - Errors that may be generated in construction of proposals for transparent->shielded wallet-internal transfers.
- Propose
Transfer ErrT - Errors that may be generated in construction of proposals for shielded->shielded or shielded->transparent transfers.
- Shield
ErrT transparent-inputs - Errors that may be generated in the execution of shielding proposals.
- Transfer
ErrT - Errors that may be generated in the execution of proposals that may send shielded inputs.