Skip to content

Non-deterministic coin selection #2191

Description

@bc1cindy

in the payjoin receiver #2011 (comment) candidate_inputs_map is a HashMap and rust's HashMap has non-deterministic iteration order (randomized per run), so the input the receiver contributes to the payjoin, and its ordering, is non-deterministic across runs.

unpredictable input ordering is itself a fingerprint, a deterministic order is analyzable and consistent.

switching to BTreeMap makes iteration deterministic (ordered by OutPoint), so the contributed input is stable and reproducible, and input ordering is consistent rather than random.

ref: payjoin/rust-payjoin#1597 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions