Skip to content

Instantly share code, notes, and snippets.

@SamouraiDev
SamouraiDev / gist:4ced85a29996dd56781e2bf319b93aaf
Last active April 5, 2023 07:41
STONEWALL spend description
Utxos are grouped by address type (P2PKH, P2SH-P2WPKH, or P2WPKH).
The group with the same address type as the address being spent to is selected if it is >= twice the spend amount.
If the above condition is not met, then a group with a different address type and a total value >= twice the spend amount is selected.
If the above condition is not met, then 2 groups with total amounts >= the spend amount are chosen.
Transaction composition is arranged by “sets”.
For each set:
The utxos are processed in randomised order.