Module onchain

Source
Expand description

Onchain wallet integration interfaces.

This module defines the traits and types that an external onchain wallet must implement to be used by the library. The goal is to let integrators plug in their own wallet implementation, so features like boarding (moving onchain funds into Ark) and unilateral exit (claiming VTXOs onchain without server cooperation) are supported.

Key concepts exposed here:

A reference implementation based on BDK is available behind the onchain_bdk cargo feature. Enable it to use the provided OnchainWallet implementation. You can use all features from BDK because bdk_wallet is re-exported.

Re-exports§

pub use bdk_wallet;

Structs§

ChainSource
Client for interacting with the configured on-chain backend.
FeeRates
The FeeRates struct represents the fee rates for transactions categorized by speed or urgency.
LocalUtxo
A standard wallet Utxo owned by the local wallet implementation.
OnchainWallet
BDK-backed onchain wallet implementation.
SpendableExit
A spendable unilateral exit of a Vtxo which can be claimed onchain.

Enums§

ChainSourceClient
ChainSourceSpec
Configuration for the onchain data source.
CpfpError
Returned by the bark API when creating a P2A CPFP transaction fails.
MakeCpfpFees
Indicates how fees should be handled by when creating a CPFP bitcoin::Transaction.
Utxo
Represents an onchain UTXO known to the wallet.

Traits§

Board
Trait alias for wallets that support boarding.
ExitUnilaterally
Trait alias for wallets that support unilateral exit end-to-end.
GetBalance
Ability to query the wallets’ total balance.
GetSpendingTx
Ability to find wallet-local spends of a specific OutPoint.
GetWalletTx
Ability to look up transactions known to the wallet.
MakeCpfp
Ability to create and persist CPFP transactions for spending P2A outputs.
PreparePsbt
Ability to construct funded PSBTs for specific destinations or to drain the wallet.
SignPsbt
Ability to finalize a Psbt into a fully signed Transaction.
TxBuilderExt
BDK-backed onchain wallet implementation.