bitcoindevkit / bitcoindevkit/bdk-tx
Implement builder interface for SelectorParams.
- Dominant language
- Rust
- Stars
- 13
- Forks
- 17
- Avg merge
- 17h 22m
- Merged PRs (30d)
- 1
Description
Building transactions through `SelectorParams` currently gets no feedback if they accidentally create dust outputs or include multiple `OP_RETURN` outputs. These mistakes only surface at relay time with opaque node rejections.
Implement a builder interface for `SelectorParams` that validates target outputs against configurable mempool standardness rules, cathching dust recipients, multiple `OP_RETURN` outputs, oversized `OP_RETURN` scripts, and missing required fields at construction time.
**Proposed solution**
Introduce a `SelectorParamsBuilder` as a separate type that validates and produces `SelectorParams`.
The `SelectorParams::builder()` chains methods and call `.build()` which validates against a configurable `MempoolPolicy` struct.
**Context**
See [selector.rs L20–L27](https://github.com/bitcoindevkit/bdk-tx/blob/338857fa892345bda610076d644d950b7f1b97d1/src/selector.rs#L20-L27)
Contributor guide
Assessment
This issue has not been assessed yet.