bitcoindevkit / bitcoindevkit/bdk-tx

Implement builder interface for SelectorParams.

Open
#41 2 comments 0 reactions 1 assignee Claimed by @aagbotemi View on GitHub
enhancement
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.