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:
- Utxo, LocalUtxo & SpendableExit: lightweight types representing wallet UTXOs and spendable exit outputs.
- PreparePsbt & SignPsbt: funding and signing interfaces for building transactions.
- GetBalance, GetWalletTx, GetSpendingTx: read-access to wallet state for balance and Transaction lookups required by various parts of the library.
- MakeCpfp: CPFP construction interfaces used for create child transactions.
- ExitUnilaterally: a convenience trait that aggregates the required capabilities a wallet must provide to support unilateral exits.
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§
- Chain
Source - Client for interacting with the configured on-chain backend.
- FeeRates
- The FeeRates struct represents the fee rates for transactions categorized by speed or urgency.
- Local
Utxo - A standard wallet Utxo owned by the local wallet implementation.
- Onchain
Wallet - BDK-backed onchain wallet implementation.
- Spendable
Exit - A spendable unilateral exit of a Vtxo which can be claimed onchain.
Enums§
- Chain
Source Client - Chain
Source Spec - Configuration for the onchain data source.
- Cpfp
Error - Returned by the bark API when creating a P2A CPFP transaction fails.
- Make
Cpfp Fees - 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.
- Exit
Unilaterally - Trait alias for wallets that support unilateral exit end-to-end.
- GetBalance
- Ability to query the wallets’ total balance.
- GetSpending
Tx - Ability to find wallet-local spends of a specific OutPoint.
- GetWallet
Tx - Ability to look up transactions known to the wallet.
- Make
Cpfp - Ability to create and persist CPFP transactions for spending P2A outputs.
- Prepare
Psbt - Ability to construct funded PSBTs for specific destinations or to drain the wallet.
- Sign
Psbt - Ability to finalize a Psbt into a fully signed Transaction.
- TxBuilder
Ext - BDK-backed onchain wallet implementation.