Skip to main content

Module wallet

Module wallet 

Source

Structs§

BatchCheckpoints
The checkpoints that a batch of scanned blocks adds to the wallet’s note commitment trees beyond those its own commitments create, as put_blocks computes them before it builds the batch’s subtrees (batch_checkpoints).
PutBlocksRows
The note commitment data accumulated by put_blocks_rows across a sequence of scanned blocks: exactly the input that the note commitment tree stage of put_blocks consumes.

Enums§

PutBlocksError

Constants§

PRUNING_DEPTH
The maximum number of blocks the wallet is allowed to rewind. This is consistent with the bound in zcashd, and allows block data deeper than this delta from the chain tip to be pruned.
SPEND_MAP_RETENTION_BLOCKS
The number of trailing blocks in a batch whose spend-map entries are always retained, even when put_blocks_rows can prove that insertion is skippable. This keeps the maps’ contents aligned with a LowLevelWalletWrite::prune_tracked_spends pruning depth of the same value, and comfortably exceeds the maximum reorg depth the wallet tolerates.

Traits§

PutBlocksDbTtransparent-inputs
A trait alias capturing the database capabilities required by put_blocks.
PutBlocksRowsDbTtransparent-inputs
A trait alias capturing the database capabilities required by put_blocks_rows.
StoreDecryptedTxDbTtransparent-inputs
A trait alias capturing the database capabilities required by store_decrypted_tx.

Functions§

assign_block_end_retention
Sets the retention of each block-end commitment in commitments, the first of which is at start_position.
batch_checkpoints
Computes the checkpoints that the batch of scanned blocks above from_state through last_scanned_height must add to each note commitment tree beyond those its own commitments create. Each *_commitments slice is a pool’s commitment stream for the batch as put_blocks_rows returns it, with the scanner’s Checkpoint retention still on every block end: the stream is read before any demotion, so that a checkpoint ensured below the window (a retained anchor) still lands on the right tree state.
batch_ensure_heights
Given the checkpoint heights present in each of the three shielded pools’ note commitment trees, in the order (Sapling, Orchard, Ironwood), returns for each pool the complete set of checkpoint heights it must ensure for a batch of scanned blocks covering range.
build_subtrees
Creates subtrees from note commitments in parallel.
checkpoint_floor
The checkpoint floor of a batch of scanned blocks ending at last_scanned_height: the height at and below which no block end of the batch keeps its own checkpoint.
checkpoint_positions
Produces an overall set of checkpoints from a list of subtrees.
cross_pool_ensure_heights
Given the checkpoint heights present in each of the three shielded pools’ note commitment trees, in the order (Sapling, Orchard, Ironwood), returns for each pool the set of checkpoint heights it must ensure so that every pool ends up checkpointed at every height that is checkpointed in any pool.
detect_wallet_transparent_outputs
Returns the transparent outputs of tx for which the wallet should store records: those paying an address of a wallet account, and, when funding_account is given, those paying anyone else.
ensure_checkpoints
Produces the checkpoints that must be added to a pool’s note commitment tree so that it gains a checkpoint at each of the requested heights. A height in created_checkpoints is skipped, since inserting the batch’s subtrees creates its checkpoint. Any other height receives a checkpoint at the position recorded in block_end_positions for the nearest block at or below it that carries a commitment, or at the provided frontier’s position when no such block precedes it in the batch.
generate_transparent_gap_addressestransparent-inputs
Generates transparent gap addresses for a given account and key scope.
keeps_checkpoint
Whether a block end at height keeps its own checkpoint: it does inside the checkpoint window (above checkpoint_floor, see checkpoint_floor), and at a height the anchor-retention policy retains.
put_blocks
Adds information about a sequence of scanned blocks to the provided data store.
put_blocks_rows
Persists the row-level (non-tree) data for a sequence of scanned blocks: block metadata, transaction and note rows, spent-note marking, nullifier tracking and pruning, and — when the transparent-inputs feature is enabled — transparent gap address maintenance for the involved accounts.
shielded_sent_output_recipient
Returns the account to record as having sent a decrypted shielded output, the recipient to record against it, and its value; or None where the wallet has no send to record.
store_decrypted_tx
Persists a decrypted transaction to the wallet database.
transparent_sent_output_recipient
Returns the account that funded a transparent output and the recipient to record against it, or None if no wallet account is known to have funded it.
update_tree
Updates the given note commitment tree with all newly read note commitments starting at the block frontier_height + 1.

Type Aliases§

SentOutput
The record a wallet makes for an output one of its accounts sent: the account that funded the output, the recipient it paid, and its value.