Open
Description
Description
We can design a more intuitive transaction-building flow by splitting tx-building into the follow stages:
- Coin Control
- Determine which coins can be candidates, and which coins to filter out.
- Determine coin groups (which coins must be spent together, and which coins must NOT be spent together).
- Add plan to each coin (from planning module).
- Coin Selection
- Select coins for the actual transaction.
- Determine whether we need a drain output (change policy).
- Transaction Finalization
- Formulate unsigned transaction.
- Reordering/shuffling of inputs/outputs.
- PSBT Preparation
- Maps the candidates chosen by coin selection to their plans and uses the plan to create the PSBT input.
- Maps the outputs (including drain if exists) into the PSBT.
- Signing
Implementation Details
- For "must be spent together", group them somehow like:
Vec<(Plan, TxOut, OutPoint)>
.
Related
- Meeting minutes: https://hackmd.io/@evanlinjin/bdk_minutes_20221005
- Old ticket: Implement transaction builder LLFourn/bdk_core_staging#40
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
In Progress