[#wallet]
= wallet
:mrdocs:

Wallet subsystem&period;

== Namespaces

[cols="1,4"]
|===
| Name| Description
| xref:wallet/DBKeys.adoc[`DBKeys`] 
| Record type prefixes used as keys in the wallet database&period;
| xref:wallet/WalletTool.adoc[`WalletTool`] 
| Command&hyphen;line wallet tool commands&period;
| xref:wallet/feebumper.adoc[`feebumper`] 
| Helpers for replacing a wallet transaction with a higher&hyphen;fee version&period;
| xref:wallet/wallet_crypto_tests.adoc[`wallet&lowbar;crypto&lowbar;tests`] 
| Test&hyphen;only helpers for exercising the wallet crypto internals&period;
|===


== Types

[cols="1,4"]
|===
| Name| Description
| xref:wallet/Balance.adoc[`Balance`] 
| Breakdown of a wallet&apos;s balance by category&period;
| xref:wallet/BerkeleyROBatch.adoc[`BerkeleyROBatch`] 
| RAII class that provides access to a BerkeleyRODatabase
| xref:wallet/BerkeleyROCursor.adoc[`BerkeleyROCursor`] 
| Cursor that iterates over the records of a BerkeleyRODatabase&period;
| xref:wallet/BerkeleyRODatabase.adoc[`BerkeleyRODatabase`] 
| A class representing a BerkeleyDB file from which we can only read records&period; This is used only for migration of legacy to descriptor wallets
| xref:wallet/BytePrefix.adoc[`BytePrefix`] 
| Compares equal to any byte span that begins with the same prefix&period;
| xref:wallet/CAddressBookData.adoc[`CAddressBookData`] 
| Address book data&period;
| xref:wallet/CCoinControl.adoc[`CCoinControl`] 
| Coin Control Features&period;
| xref:wallet/CCrypter.adoc[`CCrypter`] 
| Encryption&sol;decryption context with key information
| xref:wallet/CHDChain.adoc[`CHDChain`] 
| Simple HD chain data model&period;
| xref:wallet/CKeyMetadata.adoc[`CKeyMetadata`] 
| Metadata about a wallet key, such as its creation time and HD derivation info&period;
| xref:wallet/CMasterKey.adoc[`CMasterKey`] 
| Master key for wallet encryption
| xref:wallet/CMerkleTx.adoc[`CMerkleTx`] 
| Legacy class used for deserializing vtxPrev for backwards compatibility&period; vtxPrev was removed in commit 93a18a3650292afbb441a47d1fa1b94aeb0164e3, but old wallet&period;dat files may still contain vtxPrev vectors of CMerkleTxs&period; These need to get deserialized for field alignment when deserializing a CWalletTx, but the deserialized values are discarded&period;&ast;
| xref:wallet/COutput.adoc[`COutput`] 
| A UTXO under consideration for use in funding a new transaction&period;
| xref:wallet/COutputEntry.adoc[`COutputEntry`] 
| A single received or sent output belonging to the wallet&period;
| xref:wallet/CRecipient.adoc[`CRecipient`] 
| A transaction output target&colon; a destination, an amount, and fee handling&period;
| xref:wallet/CWallet.adoc[`CWallet`] 
| A CWallet maintains a set of transactions and balances, and provides the ability to create new transactions&period;
| xref:wallet/CWalletTx.adoc[`CWalletTx`] 
| A transaction with a bunch of additional info that only the owner cares about&period; It includes any unrecorded transactions needed to link it back to the block chain&period;
| xref:wallet/CachableAmount.adoc[`CachableAmount`] 
| Cachable amount subdivided into avoid reuse and all balances
| xref:wallet/CoinEligibilityFilter.adoc[`CoinEligibilityFilter`] 
| Parameters for filtering which OutputGroups we may use in coin selection&period; We start by being very selective and requiring multiple confirmations and then get more permissive if we cannot fund the transaction&period;
| xref:wallet/CoinFilterParams.adoc[`CoinFilterParams`] 
| Parameters that filter which coins are considered available for spending&period;
| xref:wallet/CoinSelectionParams.adoc[`CoinSelectionParams`] 
| Parameters for one iteration of Coin Selection&period;
| xref:wallet/CoinsResult.adoc[`CoinsResult`] 
| COutputs available for spending, stored by OutputType&period; This struct is really just a wrapper around OutputType vectors with a convenient method for concatenating and returning all COutputs as one vector&period;
| xref:wallet/CreatedTransactionResult.adoc[`CreatedTransactionResult`] 
| Outcome of building a new transaction, bundling the transaction with its fee details&period;
| xref:wallet/DatabaseBatch.adoc[`DatabaseBatch`] 
| RAII class that provides access to a WalletDatabase
| xref:wallet/DatabaseCursor.adoc[`DatabaseCursor`] 
| Iterates over records stored in a wallet database&period;
| xref:wallet/DatabaseOptions.adoc[`DatabaseOptions`] 
| Options controlling how a wallet database is opened or created&period;
| xref:wallet/DbTxnListener.adoc[`DbTxnListener`] 
| Callbacks invoked when a wallet database transaction commits or aborts&period;
| xref:wallet/DescriptorScriptPubKeyMan.adoc[`DescriptorScriptPubKeyMan`] 
| A ScriptPubKeyMan backed by a single output descriptor&period;
| xref:wallet/Groups.adoc[`Groups`] 
| A pair of output group collections split by whether they hold only positive&hyphen;value UTXOs&period;
| xref:wallet/InMemoryWalletDatabase.adoc[`InMemoryWalletDatabase`] 
| An in&hyphen;memory SQLiteDatabase&period; Used as a temporary build artifact where no on&hyphen;disk persistence is needed&period;
| xref:wallet/LegacyDataSPKM.adoc[`LegacyDataSPKM`] 
| Manages the minimum data needed to load and migrate a legacy wallet&period;
| xref:wallet/LegacySigningProvider.adoc[`LegacySigningProvider`] 
| SigningProvider wrapper for LegacyDataSPKM that does not provide private keys&period;
| xref:wallet/MigrationData.adoc[`MigrationData`] 
| struct containing information needed for migrating legacy wallets to descriptor wallets
| xref:wallet/MigrationResult.adoc[`MigrationResult`] 
| Result of migrating a legacy wallet to descriptor wallets&period;
| xref:wallet/MinimumFeeRateResult.adoc[`MinimumFeeRateResult`] 
| Result of resolving the minimum fee rate to use for a transaction&period;
| xref:wallet/OutputGroup.adoc[`OutputGroup`] 
| A group of UTXOs paid to the same output script&period;
| xref:wallet/OutputGroupTypeMap.adoc[`OutputGroupTypeMap`] 
| Stores several &apos;Groups&apos; whose were mapped by output type&period;
| xref:wallet/OutputPtrComparator.adoc[`OutputPtrComparator`] 
| Comparator ordering shared pointers to COutput by the pointed&hyphen;to output&period;
| xref:wallet/PreselectedInput.adoc[`PreselectedInput`] 
| Holds the user&hyphen;supplied details for a single manually selected transaction input&period;
| xref:wallet/ReserveDestination.adoc[`ReserveDestination`] 
| A wrapper to reserve an address from a wallet
| xref:wallet/SQLiteBatch.adoc[`SQLiteBatch`] 
| RAII class that provides access to a WalletDatabase
| xref:wallet/SQLiteCursor.adoc[`SQLiteCursor`] 
| RAII class that provides a database cursor
| xref:wallet/SQLiteDatabase.adoc[`SQLiteDatabase`] 
| An instance of this class represents one SQLite3 database&period;
| xref:wallet/SQliteExecHandler.adoc[`SQliteExecHandler`] 
| Class responsible for executing SQL statements in SQLite databases&period; Methods are virtual so they can be overridden by unit tests testing unusual database conditions&period;
| xref:wallet/ScriptPubKeyMan.adoc[`ScriptPubKeyMan`] 
| A class implementing ScriptPubKeyMan manages some (or all) scriptPubKeys used in a wallet&period; It contains the scripts and keys related to the scriptPubKeys it manages&period; A ScriptPubKeyMan will be able to give out scriptPubKeys to be used, as well as marking when a scriptPubKey has been used&period; It also handles when and how to store a scriptPubKey and its related scripts and keys, including encryption&period;
| xref:wallet/SelectionFilter.adoc[`SelectionFilter`] 
| Pairs a coin eligibility filter with whether mixing output types is allowed&period;
| xref:wallet/SelectionResult.adoc[`SelectionResult`] 
| The set of inputs chosen by a coin selection algorithm, along with its metrics&period;
| xref:wallet/TxSize.adoc[`TxSize`] 
| Holds the virtual size and weight of a transaction&period;
| xref:wallet/TxStateBlockConflicted.adoc[`TxStateBlockConflicted`] 
| State of rejected transaction that conflicts with a confirmed block&period;
| xref:wallet/TxStateConfirmed.adoc[`TxStateConfirmed`] 
| State of transaction confirmed in a block&period;
| xref:wallet/TxStateInMempool.adoc[`TxStateInMempool`] 
| State of transaction added to mempool&period;
| xref:wallet/TxStateInactive.adoc[`TxStateInactive`] 
| State of transaction not confirmed or conflicting with a known block and not in the mempool&period; May conflict with the mempool, or with an unknown block, or be abandoned, never broadcast, or rejected from the mempool for another reason&period;
| xref:wallet/TxStateUnrecognized.adoc[`TxStateUnrecognized`] 
| State of transaction loaded in an unrecognized state with unexpected hash or index values&period; Treated as inactive (with serialized hash and index values preserved) by default, but may enter another state if transaction is added to the mempool, or confirmed, or abandoned, or found conflicting&period;
| xref:wallet/WalletBatch.adoc[`WalletBatch`] 
| Access to the wallet database&period; Opens the database and provides read and write access to it&period; Each read and write is its own transaction&period; Multiple operation transactions can be started using TxnBegin() and committed using TxnCommit() Otherwise the transaction will be committed when the object goes out of scope&period; Optionally (on by default) it will flush to disk on close&period; Every 1000 writes will automatically trigger a flush to disk&period;
| xref:wallet/WalletContext.adoc[`WalletContext`] 
| WalletContext struct containing references to state shared between CWallet instances, like the reference to the chain interface, and the list of opened wallets&period;
| xref:wallet/WalletDatabase.adoc[`WalletDatabase`] 
| An instance of this class represents one database&period;
| xref:wallet/WalletDescInfo.adoc[`WalletDescInfo`] 
| Exportable form of a WalletDescriptor with the descriptor as a string and without its ID or cache&period;
| xref:wallet/WalletDescriptor.adoc[`WalletDescriptor`] 
| Descriptor with some wallet metadata
| xref:wallet/WalletDestination.adoc[`WalletDestination`] 
| A destination together with whether it belongs to the internal (change) chain&period;
| xref:wallet/WalletError.adoc[`WalletError`] 
| Wallet&hyphen;layer error with both programmatic and user&hyphen;facing information&period;
| xref:wallet/WalletRescanReserver.adoc[`WalletRescanReserver`] 
| RAII object to check and reserve a wallet rescan
| xref:wallet/WalletStorage.adoc[`WalletStorage`] 
| Wallet storage things that ScriptPubKeyMans need in order to be able to store things to the wallet database&period; It provides access to things that are part of the entire wallet and not specific to a ScriptPubKeyMan such as wallet flags, wallet version, encryption keys, encryption status, and the database itself&period; This allows a ScriptPubKeyMan to have callbacks into CWallet without causing a circular dependency&period; WalletStorage should be the same for all ScriptPubKeyMans of a wallet&period;
| xref:wallet/WalletTXO.adoc[`WalletTXO`] 
| A single wallet transaction output, pairing a wallet transaction with one of its outputs&period;
| xref:wallet/WalletTxOrderComparator.adoc[`WalletTxOrderComparator`] 
| Orders wallet transactions by their position in the ordered transaction list&period;
|===


== Type Aliases

[cols="1,4"]
|===
| Name| Description
| xref:wallet/BerkeleyROData.adoc[`BerkeleyROData`] 
| Ordered map of raw key&sol;value records read from a BerkeleyDB file&period;
| xref:wallet/CKeyingMaterial.adoc[`CKeyingMaterial`] 
| Secure byte buffer used to hold sensitive key material in memory&period;
| xref:wallet/CryptedKeyMap.adoc[`CryptedKeyMap`] 
| Map from key id to its public key and encrypted private key material&period;
| xref:wallet/FilteredOutputGroups.adoc[`FilteredOutputGroups`] 
| Output groups keyed by the eligibility filter that selected them&period;
| xref:wallet/KeyMap.adoc[`KeyMap`] 
| Map from key id to its private key&period;
| xref:wallet/LoadWalletFn.adoc[`LoadWalletFn`] 
| Callback invoked when a wallet is loaded, receiving the wallet interface&period;
| xref:wallet/OutputSet.adoc[`OutputSet`] 
| A set of COutput pointers ordered by the pointed&hyphen;to output&period;
| xref:wallet/SyncTxState.adoc[`SyncTxState`] 
| Subset of states transaction sync logic is implemented to handle&period;
| xref:wallet/TxState.adoc[`TxState`] 
| All possible CWalletTx states
|===


== Enums

[cols="1,4"]
|===
| Name| Description
| xref:wallet/AddressPurpose.adoc[`AddressPurpose`] 
| Address purpose field that has been been stored with wallet sending and receiving addresses since BIP70 payment protocol support was added in https&colon;&sol;&sol;github&period;com&sol;bitcoin&sol;bitcoin&sol;pull&sol;2539&period; This field is not currently used for any logic inside the wallet, but it is still shown in RPC and GUI interfaces and saved for new addresses&period; It is basically redundant with an address&apos;s IsMine() result&period;
| xref:wallet/DBErrors.adoc[`DBErrors`] 
| Error statuses for the wallet database&period; Values are in order of severity&period; When multiple errors occur, the most severe (highest value) will be returned&period;
| xref:wallet/DatabaseFormat.adoc[`DatabaseFormat`] 
| On&hyphen;disk format of a wallet database&period;
| xref:wallet/DatabaseStatus.adoc[`DatabaseStatus`] 
| Result of opening or creating a wallet database&period;
| xref:wallet/SelectionAlgorithm.adoc[`SelectionAlgorithm`] 
| Identifies which coin selection algorithm produced a result&period;
| xref:wallet/WalletErrorCode.adoc[`WalletErrorCode`] 
| Machine&hyphen;readable wallet error codes&period;
| xref:wallet/WalletFlags.adoc[`WalletFlags`] 
| Feature and state flags stored on a wallet&period;
|===


== Functions

[cols="1,4"]
|===
| Name| Description
| xref:wallet/AddWallet.adoc[`AddWallet`] 
| Register a loaded wallet with the wallet context&period;
| xref:wallet/AddWalletSetting.adoc[`AddWalletSetting`] 
| Add wallet name to persistent configuration so it will be loaded on startup&period;
| xref:wallet/AllInputsMine.adoc[`AllInputsMine`] 
| Returns whether all of the inputs belong to the wallet
| xref:wallet/AppendLastProcessedBlock.adoc[`AppendLastProcessedBlock`] 
| Appends the wallet&apos;s last processed block to an RPC result object&period;
| xref:wallet/AttemptSelection.adoc[`AttemptSelection`] 
| Attempt to find a valid input set that preserves privacy by not mixing OutputTypes&period; `ChooseSelectionResult()` will be called on each OutputType individually and the best the solution (according to the waste metric) will be chosen&period; If a valid input cannot be found from any single OutputType, fallback to running `ChooseSelectionResult()` over all available coins&period;
| xref:wallet/AutomaticCoinSelection.adoc[`AutomaticCoinSelection`] 
| Select a set of coins such that nTargetValue is met&semi; never select unconfirmed coins if they are not ours
| xref:wallet/AvailableCoins.adoc[`AvailableCoins`] 
| Populate the CoinsResult struct with vectors of available COutputs, organized by OutputType&period;
| xref:wallet/BDBDataFile.adoc[`BDBDataFile`] 
| Returns the path to the Berkeley DB data file for a wallet path&period;
| xref:wallet/CachedTxGetAmounts.adoc[`CachedTxGetAmounts`] 
| Splits a wallet transaction into received and sent entries plus its fee&period;
| xref:wallet/CachedTxGetChange.adoc[`CachedTxGetChange`] 
| Returns the cached change amount of a wallet transaction&period;
| xref:wallet/CachedTxGetCredit.adoc[`CachedTxGetCredit`] 
| Returns the cached total credit of a wallet transaction&period;
| xref:wallet/CachedTxGetDebit.adoc[`CachedTxGetDebit`] 
| Returns the cached total debit of a wallet transaction&period;
| xref:wallet/CachedTxIsFromMe.adoc[`CachedTxIsFromMe`] 
| Returns whether a wallet transaction debits from the wallet&period;
| xref:wallet/CachedTxIsTrusted-04.adoc[`CachedTxIsTrusted`] 
| `CachedTxIsTrusted` overloads
| xref:wallet/CalculateMaximumSignedInputSize-09.adoc[`CalculateMaximumSignedInputSize`] 
| `CalculateMaximumSignedInputSize` overloads
| xref:wallet/CalculateMaximumSignedTxSize-08.adoc[`CalculateMaximumSignedTxSize`] 
| `CalculateMaximumSignedTxSize` overloads
| xref:wallet/ChooseSelectionResult.adoc[`ChooseSelectionResult`] 
| Attempt to find a valid input set that meets the provided eligibility filter and target&period; Multiple coin selection algorithms will be run and the input set that produces the least waste (according to the waste metric) will be chosen&period;
| xref:wallet/CoinGrinder.adoc[`CoinGrinder`] 
| Select coins using the CoinGrinder deterministic search algorithm&period;
| xref:wallet/CreateFromDump.adoc[`CreateFromDump`] 
| Creates a new wallet database from a previously dumped file&period;
| xref:wallet/CreateTransaction.adoc[`CreateTransaction`] 
| Create a new transaction paying the recipients with a set of coins selected by SelectCoins()&semi; Also create the change output, when needed
| xref:wallet/CreateWallet.adoc[`CreateWallet`] 
| Create a new wallet and load it into the context&period;
| xref:wallet/DecryptKey.adoc[`DecryptKey`] 
| Decrypts an encrypted private key and validates it against its public key&period;
| xref:wallet/DecryptSecret.adoc[`DecryptSecret`] 
| Decrypts a secret with the master key using the given IV&period;
| xref:wallet/DiscourageFeeSniping.adoc[`DiscourageFeeSniping`] 
| Set a height&hyphen;based locktime for new transactions (uses the height of the current chain tip unless we are not synced with the current chain
| xref:wallet/DumpWallet.adoc[`DumpWallet`] 
| Dumps the records of a wallet database to a human&hyphen;readable file&period;
| xref:wallet/EncryptSecret.adoc[`EncryptSecret`] 
| Encrypts a secret with the master key using the given IV&period;
| xref:wallet/EnsureUniqueWalletName.adoc[`EnsureUniqueWalletName`] 
| Ensures that a wallet name is specified across the endpoint and wallet&lowbar;name&period; Throws `RPC&lowbar;INVALID&lowbar;PARAMETER` if none or different wallet names are specified&period;
| xref:wallet/EnsureWalletContext.adoc[`EnsureWalletContext`] 
| Retrieves the WalletContext stored in an RPC context, throwing if absent&period;
| xref:wallet/EnsureWalletIsUnlocked.adoc[`EnsureWalletIsUnlocked`] 
| Throws an RPC error if the wallet is locked&period;
| xref:wallet/ExportDescriptors.adoc[`ExportDescriptors`] 
| Export the descriptors from a wallet so that they can be imported elsewhere
| xref:wallet/ExportWatchOnlyWallet.adoc[`ExportWatchOnlyWallet`] 
| Make a new watchonly wallet file containing the public descriptors from this wallet The exported watchonly wallet file will be named and placed at the path specified in &apos;destination&apos;
| xref:wallet/FetchSelectedInputs.adoc[`FetchSelectedInputs`] 
| Fetch and validate coin control selected inputs&period; Coins could be internal (from the wallet) or external&period;
| xref:wallet/FindNonChangeParentOutput.adoc[`FindNonChangeParentOutput`] 
| Find non&hyphen;change parent output&period;
| xref:wallet/FundTransaction.adoc[`FundTransaction`] 
| Insert additional inputs into the transaction by calling CreateTransaction()&semi;
| xref:wallet/GenerateChangeTarget.adoc[`GenerateChangeTarget`] 
| Choose a random change target for each transaction to make it harder to fingerprint the Core wallet based on the change output values of transactions it creates&period; Change target covers at least change fees and adds a random value on top of it&period; The random value is between 50ksat and min(2 &ast; payment&lowbar;value, 1milsat) When payment&lowbar;value &lt;&equals; 25ksat, the value is just 50ksat&period;
| xref:wallet/GenerateWalletDescriptor.adoc[`GenerateWalletDescriptor`] 
| Builds a new wallet descriptor for the given key and output type&period;
| xref:wallet/GetAddressBalances.adoc[`GetAddressBalances`] 
| Returns the confirmed balance held at each of the wallet&apos;s addresses&period;
| xref:wallet/GetAddressGroupings.adoc[`GetAddressGroupings`] 
| Groups addresses that are believed to share a common owner&period;
| xref:wallet/GetAlgorithmName.adoc[`GetAlgorithmName`] 
| Return the human&hyphen;readable name of a selection algorithm&period;
| xref:wallet/GetAvoidReuseFlag.adoc[`GetAvoidReuseFlag`] 
| Resolves the effective avoid&hyphen;reuse flag from a request parameter&period;
| xref:wallet/GetBalance.adoc[`GetBalance`] 
| Computes the wallet&apos;s balance broken down by category&period;
| xref:wallet/GetDefaultWallet.adoc[`GetDefaultWallet`] 
| Return the default wallet and report how many wallets are loaded&period;
| xref:wallet/GetDiscardRate.adoc[`GetDiscardRate`] 
| Return the maximum feerate for discarding change&period;
| xref:wallet/GetMinimumFee.adoc[`GetMinimumFee`] 
| Return the minimum fee for this size given a fee rate result&period;
| xref:wallet/GetMinimumFeeRate.adoc[`GetMinimumFeeRate`] 
| Estimate the minimum fee rate considering user set parameters and the required fee
| xref:wallet/GetRequiredFee.adoc[`GetRequiredFee`] 
| Return the minimum required absolute fee for this size based on the required fee rate
| xref:wallet/GetRequiredFeeRate.adoc[`GetRequiredFeeRate`] 
| Return the minimum required feerate taking into account the minimum relay feerate and user set minimum transaction feerate
| xref:wallet/GetWallet.adoc[`GetWallet`] 
| Look up a loaded wallet by name&period;
| xref:wallet/GetWalletDir.adoc[`GetWalletDir`] 
| Get the path of the wallet directory&period;
| xref:wallet/GetWalletForJSONRPCRequest.adoc[`GetWalletForJSONRPCRequest`] 
| Figures out what wallet, if any, to use for a JSONRPCRequest&period;
| xref:wallet/GetWalletNameFromJSONRPCRequest.adoc[`GetWalletNameFromJSONRPCRequest`] 
| Extracts the wallet name encoded in a JSON&hyphen;RPC request endpoint, if any&period;
| xref:wallet/GetWalletPath.adoc[`GetWalletPath`] 
| Determine the path that the wallet is stored in
| xref:wallet/GetWalletRPCCommands.adoc[`GetWalletRPCCommands`] 
| Returns the RPC commands provided by the wallet component&period;
| xref:wallet/GetWallets.adoc[`GetWallets`] 
| Return all wallets currently loaded in the context&period;
| xref:wallet/GroupOutputs.adoc[`GroupOutputs`] 
| Group coins by the provided filters&period;
| xref:wallet/HandleLoadWallet.adoc[`HandleLoadWallet`] 
| Register a callback invoked whenever a wallet is loaded&period;
| xref:wallet/HandleWalletError.adoc[`HandleWalletError`] 
| Translates a wallet loading result into the appropriate RPC error&period;
| xref:wallet/HasLegacyRecords-0e.adoc[`HasLegacyRecords`] 
| `HasLegacyRecords` overloads
| xref:wallet/InputIsMine.adoc[`InputIsMine`] 
| Returns whether the output spent by an input belongs to the wallet&period;
| xref:wallet/IsBDBFile.adoc[`IsBDBFile`] 
| Returns whether the file at the path is a Berkeley DB file&period;
| xref:wallet/IsSQLiteFile.adoc[`IsSQLiteFile`] 
| Returns whether the file at the path is a SQLite file&period;
| xref:wallet/KnapsackSolver.adoc[`KnapsackSolver`] 
| Select coins using the original Knapsack approximation, used as a fallback&period;
| xref:wallet/LabelFromValue.adoc[`LabelFromValue`] 
| Validates and extracts an address label from an RPC value&period;
| xref:wallet/ListCoins.adoc[`ListCoins`] 
| Return list of available coins and locked coins grouped by non&hyphen;change output address&period;
| xref:wallet/ListDatabases.adoc[`ListDatabases`] 
| Recursively list database paths in directory&period;
| xref:wallet/LoadCryptedKey.adoc[`LoadCryptedKey`] 
| Loads an encrypted key from a database record into the wallet&period;
| xref:wallet/LoadEncryptionKey.adoc[`LoadEncryptionKey`] 
| Loads a master encryption key from a database record into the wallet&period;
| xref:wallet/LoadHDChain.adoc[`LoadHDChain`] 
| Loads HD chain data from a database record into the wallet&period;
| xref:wallet/LoadKey.adoc[`LoadKey`] 
| Loads an unencrypted key from a database record into the wallet&period;
| xref:wallet/LoadWallet.adoc[`LoadWallet`] 
| Load an existing wallet from disk into the context&period;
| xref:wallet/LoadWallets.adoc[`LoadWallets`] 
| Load wallet databases&period;
| xref:wallet/LogDBInfo.adoc[`LogDBInfo`] 
| Logs information about the database, including available engines, features, and other capabilities&period;
| xref:wallet/MakeBerkeleyRODatabase.adoc[`MakeBerkeleyRODatabase`] 
| Return object giving access to Berkeley Read Only database at specified path&period;
| xref:wallet/MakeDatabase.adoc[`MakeDatabase`] 
| Creates or opens a wallet database at the given path&period;
| xref:wallet/MakeInMemoryWalletDatabase.adoc[`MakeInMemoryWalletDatabase`] 
| Create a new in&hyphen;memory wallet database&period;
| xref:wallet/MakeSQLiteDatabase.adoc[`MakeSQLiteDatabase`] 
| Open or create a SQLite wallet database at the given path&period;
| xref:wallet/MakeWalletDatabase.adoc[`MakeWalletDatabase`] 
| Open the database backend for a wallet&period;
| xref:wallet/MaybeResendWalletTxs.adoc[`MaybeResendWalletTxs`] 
| Called periodically by the schedule thread&period; Prompts individual wallets to resend their transactions&period; Actual rebroadcast schedule is managed by the wallets themselves&period;
| xref:wallet/MigrateLegacyToDescriptor-08.adoc[`MigrateLegacyToDescriptor`] 
| `MigrateLegacyToDescriptor` overloads
| xref:wallet/NotifyWalletLoaded.adoc[`NotifyWalletLoaded`] 
| Fire the load&hyphen;wallet callbacks for a newly loaded wallet&period;
| xref:wallet/OutputGetChange.adoc[`OutputGetChange`] 
| Returns the change amount an output contributes&period;
| xref:wallet/OutputGetCredit.adoc[`OutputGetCredit`] 
| Returns the credit an output contributes if it belongs to the wallet&period;
| xref:wallet/OutputIsChange.adoc[`OutputIsChange`] 
| Returns whether an output is a change output of the wallet&period;
| xref:wallet/PurposeFromString.adoc[`PurposeFromString`] 
| Parse an address purpose from its serialized string form&period;
| xref:wallet/PurposeToString.adoc[`PurposeToString`] 
| Convert an address purpose to its serialized string form&period;
| xref:wallet/PushParentDescriptors.adoc[`PushParentDescriptors`] 
| Fetch parent descriptors of this scriptPubKey&period;
| xref:wallet/ReadDatabaseArgs.adoc[`ReadDatabaseArgs`] 
| Fills database options from command&hyphen;line arguments&period;
| xref:wallet/RemoveWallet-07.adoc[`RemoveWallet`] 
| Remove a wallet from the wallet context and optionally update its load&hyphen;on&hyphen;startup setting&period;
| xref:wallet/RemoveWalletSetting.adoc[`RemoveWalletSetting`] 
| Remove wallet name from persistent configuration so it will not be loaded on startup&period;
| xref:wallet/RestoreWallet.adoc[`RestoreWallet`] 
| Restore a wallet from a backup file&period;
| xref:wallet/RunWithinTxn.adoc[`RunWithinTxn`] 
| Executes the provided function &apos;func&apos; within a database transaction context&period;
| xref:wallet/SQLiteDataFile.adoc[`SQLiteDataFile`] 
| Returns the path to the SQLite data file for a wallet path&period;
| xref:wallet/SQLiteDatabaseVersion.adoc[`SQLiteDatabaseVersion`] 
| Return the version of the SQLite library in use&period;
| xref:wallet/ScriptIsChange.adoc[`ScriptIsChange`] 
| Returns whether a script is a change output of the wallet&period;
| xref:wallet/SelectCoins.adoc[`SelectCoins`] 
| Select all coins from coin&lowbar;control, and if coin&lowbar;control &apos;m&lowbar;allow&lowbar;other&lowbar;inputs&equals;true&apos;, call &apos;AutomaticCoinSelection&apos; to select a set of coins such that nTargetValue &hyphen; pre&lowbar;set&lowbar;inputs&period;total&lowbar;amount is met&period;
| xref:wallet/SelectCoinsBnB.adoc[`SelectCoinsBnB`] 
| Select coins using the Branch and Bound algorithm to find a changeless solution&period;
| xref:wallet/SelectCoinsSRD.adoc[`SelectCoinsSRD`] 
| Select coins by Single Random Draw (SRD)&period; SRD selects eligible OutputGroups from a shuffled ordering until the effective value of the input set suffices to create the recipient outputs and a change output with an amount of at least CHANGE&lowbar;LOWER&period; While the maximum selection weight is exceeded during selection, the OutputGroup with the lowest effective value is dropped from the selection before additional OutputGroups are selected&period; Due to this greedy approach, SRD can fail to discover possible solutions in pathological cases&period;
| xref:wallet/StartWallets.adoc[`StartWallets`] 
| Complete startup of wallets&period;
| xref:wallet/TxGetChange.adoc[`TxGetChange`] 
| Returns the total change amount of a transaction&period;
| xref:wallet/TxGetCredit.adoc[`TxGetCredit`] 
| Returns the total credit of a transaction&apos;s outputs owned by the wallet&period;
| xref:wallet/TxStateString.adoc[`TxStateString`] 
| Return TxState or SyncTxState as a string for logging or debugging&period;
| xref:wallet/UnloadWallets.adoc[`UnloadWallets`] 
| Stop and unload all wallets held by the context&period;
| xref:wallet/VerifyWallets.adoc[`VerifyWallets`] 
| Responsible for reading and validating the &hyphen;wallet arguments and verifying the wallet database&period;
| xref:wallet/WaitForDeleteWallet.adoc[`WaitForDeleteWallet`] 
| Explicitly delete the wallet&period; Blocks the current thread until the wallet is destructed&period;
| xref:wallet/operator_lt-06.adoc[`operator&lt;`] 
| Less&hyphen;than operators
|===


== Variables

[cols="1,4"]
|===
| Name| Description
| xref:wallet/CHANGE_LOWER.adoc[`CHANGE&lowbar;LOWER`] 
| lower bound for randomly&hyphen;chosen target change amount
| xref:wallet/CHANGE_UPPER.adoc[`CHANGE&lowbar;UPPER`] 
| upper bound for randomly&hyphen;chosen target change amount
| xref:wallet/DEFAULT_ADDRESS_TYPE.adoc[`DEFAULT&lowbar;ADDRESS&lowbar;TYPE`] 
| Default for &hyphen;addresstype
| xref:wallet/DEFAULT_AVOIDPARTIALSPENDS.adoc[`DEFAULT&lowbar;AVOIDPARTIALSPENDS`] 
| Default for &hyphen;avoidpartialspends
| xref:wallet/DEFAULT_CONSOLIDATE_FEERATE.adoc[`DEFAULT&lowbar;CONSOLIDATE&lowbar;FEERATE`] 
| &hyphen;consolidatefeerate default
| xref:wallet/DEFAULT_DISABLE_WALLET.adoc[`DEFAULT&lowbar;DISABLE&lowbar;WALLET`] 
| &hyphen;disablewallet default
| xref:wallet/DEFAULT_DISCARD_FEE.adoc[`DEFAULT&lowbar;DISCARD&lowbar;FEE`] 
| &hyphen;discardfee default
| xref:wallet/DEFAULT_FALLBACK_FEE.adoc[`DEFAULT&lowbar;FALLBACK&lowbar;FEE`] 
| &hyphen;fallbackfee default
| xref:wallet/DEFAULT_KEYPOOL_SIZE.adoc[`DEFAULT&lowbar;KEYPOOL&lowbar;SIZE`] 
| Default for &hyphen;keypool
| xref:wallet/DEFAULT_MAX_AVOIDPARTIALSPEND_FEE.adoc[`DEFAULT&lowbar;MAX&lowbar;AVOIDPARTIALSPEND&lowbar;FEE`] 
| maximum fee increase allowed to do partial spend avoidance, even for nodes with this feature disabled by default
| xref:wallet/DEFAULT_MAX_DEPTH.adoc[`DEFAULT&lowbar;MAX&lowbar;DEPTH`] 
| Default maximum chain depth for a coin to be considered available&period;
| xref:wallet/DEFAULT_MIN_DEPTH.adoc[`DEFAULT&lowbar;MIN&lowbar;DEPTH`] 
| Default minimum chain depth for a coin to be considered available&period;
| xref:wallet/DEFAULT_SPEND_ZEROCONF_CHANGE.adoc[`DEFAULT&lowbar;SPEND&lowbar;ZEROCONF&lowbar;CHANGE`] 
| Default for &hyphen;spendzeroconfchange
| xref:wallet/DEFAULT_TRANSACTION_MAXFEE.adoc[`DEFAULT&lowbar;TRANSACTION&lowbar;MAXFEE`] 
| &hyphen;maxtxfee default
| xref:wallet/DEFAULT_TRANSACTION_MINFEE.adoc[`DEFAULT&lowbar;TRANSACTION&lowbar;MINFEE`] 
| &hyphen;mintxfee default
| xref:wallet/DEFAULT_TX_CONFIRM_TARGET.adoc[`DEFAULT&lowbar;TX&lowbar;CONFIRM&lowbar;TARGET`] 
| &hyphen;txconfirmtarget default
| xref:wallet/DEFAULT_WALLETBROADCAST.adoc[`DEFAULT&lowbar;WALLETBROADCAST`] 
| &hyphen;walletbroadcast default
| xref:wallet/DEFAULT_WALLETCROSSCHAIN.adoc[`DEFAULT&lowbar;WALLETCROSSCHAIN`] 
| &hyphen;walletcrosschain default
| xref:wallet/DEFAULT_WALLET_RBF.adoc[`DEFAULT&lowbar;WALLET&lowbar;RBF`] 
| &hyphen;walletrbf default
| xref:wallet/DEFAULT_WALLET_REJECT_LONG_CHAINS.adoc[`DEFAULT&lowbar;WALLET&lowbar;REJECT&lowbar;LONG&lowbar;CHAINS`] 
| Default for &hyphen;walletrejectlongchains
| xref:wallet/DEFAULT_WALLET_TX_VERSION.adoc[`DEFAULT&lowbar;WALLET&lowbar;TX&lowbar;VERSION`] 
| Default transaction version used when building wallet transactions&period;
| xref:wallet/DUMMY_NESTED_P2WPKH_INPUT_SIZE.adoc[`DUMMY&lowbar;NESTED&lowbar;P2WPKH&lowbar;INPUT&lowbar;SIZE`] 
| Pre&hyphen;calculated constants for input size estimation in _virtual size_
| xref:wallet/HELP_REQUIRING_PASSPHRASE.adoc[`HELP&lowbar;REQUIRING&lowbar;PASSPHRASE`] 
| Help text appended to RPC methods that require the wallet passphrase&period;
| xref:wallet/HIGH_APS_FEE.adoc[`HIGH&lowbar;APS&lowbar;FEE`] 
| discourage APS fee higher than this amount
| xref:wallet/HIGH_MAX_TX_FEE.adoc[`HIGH&lowbar;MAX&lowbar;TX&lowbar;FEE`] 
| &hyphen;maxtxfee will warn if called with a higher fee than this amount (in satoshis)
| xref:wallet/HIGH_TX_FEE_PER_KB.adoc[`HIGH&lowbar;TX&lowbar;FEE&lowbar;PER&lowbar;KB`] 
| Discourage users to set fees higher than this amount (in satoshis) per kB
| xref:wallet/KNOWN_WALLET_FLAGS.adoc[`KNOWN&lowbar;WALLET&lowbar;FLAGS`] 
| Bitmask of all wallet flags recognized by this version&period;
| xref:wallet/LEGACY_OUTPUT_TYPES.adoc[`LEGACY&lowbar;OUTPUT&lowbar;TYPES`] 
| Output types associated with LegacyDataSPKM&period;
| xref:wallet/MUTABLE_WALLET_FLAGS.adoc[`MUTABLE&lowbar;WALLET&lowbar;FLAGS`] 
| Bitmask of wallet flags that may be changed after wallet creation&period;
| xref:wallet/RESULT_LAST_PROCESSED_BLOCK.adoc[`RESULT&lowbar;LAST&lowbar;PROCESSED&lowbar;BLOCK`] 
| RPC result describing the block a piece of wallet information was generated on&period;
| xref:wallet/STRING_TO_WALLET_FLAG.adoc[`STRING&lowbar;TO&lowbar;WALLET&lowbar;FLAG`] 
| Maps each wallet flag string name back to its flag value&period;
| xref:wallet/UNKNOWN_TIME.adoc[`UNKNOWN&lowbar;TIME`] 
| Constant representing an unknown spkm creation time
| xref:wallet/WALLET_CRYPTO_IV_SIZE.adoc[`WALLET&lowbar;CRYPTO&lowbar;IV&lowbar;SIZE`] 
| Size in bytes of the AES initialization vector&period;
| xref:wallet/WALLET_CRYPTO_KEY_SIZE.adoc[`WALLET&lowbar;CRYPTO&lowbar;KEY&lowbar;SIZE`] 
| Size in bytes of the AES&hyphen;256 encryption key derived for the wallet&period;
| xref:wallet/WALLET_CRYPTO_SALT_SIZE.adoc[`WALLET&lowbar;CRYPTO&lowbar;SALT&lowbar;SIZE`] 
| Size in bytes of the salt mixed into the passphrase during key derivation&period;
| xref:wallet/WALLET_FLAG_TO_STRING.adoc[`WALLET&lowbar;FLAG&lowbar;TO&lowbar;STRING`] 
| Maps each wallet flag to its serialized string name&period;
| xref:wallet/WALLET_INCREMENTAL_RELAY_FEE.adoc[`WALLET&lowbar;INCREMENTAL&lowbar;RELAY&lowbar;FEE`] 
| minimum recommended increment for replacement txs
|===



[.small]#Created with https://www.mrdocs.com[MrDocs]#
