Skip to content

v0.3.0

Choose a tag to compare

@ouziel-slama ouziel-slama released this 10 Jan 23:42
· 4 commits to main since this release
2335883

[0.3.0] - 2026-01-11

Changed

Optional Change Output (Breaking)

  • Change output is now optional: Transactions can be built without a change output, enabling wallet sweep use cases
  • TransactionPlan.change_index is now Option<usize> instead of usizeNone when no change output is present

Automatic Dust Change Handling

  • Dust change is automatically omitted: When change would fall below the dust limit (310 sats P2WPKH / 330 sats P2TR), the change output is removed and the extra sats are counted as miner fees
  • calculate_change() now returns Result<Option<u64>, FeeError>:
    • Ok(Some(amount)) when change is above dust limit
    • Ok(None) when change would be dust (caller should omit the change output)
    • Err(InsufficientFunds) when inputs can't cover outputs + fees
  • When a ZELD distribution is provided and change is omitted, the distribution array is automatically adjusted to match the final output count

Removed

Error Codes (Breaking)

  • FeeError::DustOutput removed — dust change is now handled gracefully instead of erroring
  • MinerError::MissingChangeOutput removed — change output is no longer required
  • TypeScript: ZeldMinerErrorCode.NO_CHANGE_OUTPUT removed

Fixed

  • Updated homepage URLs to https://zeldhash.com across all crates and packages

Migration Guide

Rust:

// Before (0.2.x)
let change_index: usize = plan.change_index;

// After (0.3.0)
match plan.change_index {
    Some(idx) => { /* change output at idx */ }
    None => { /* no change output (dust or sweep) */ }
}

TypeScript:

// Before (0.2.x) — required exactly one change output
outputs: [
  { address: userAddr, amount: 60000, change: false },
  { address: changeAddr, change: true }, // required
]

// After (0.3.0) — change is optional; if provided but dust, it's omitted
outputs: [
  { address: userAddr, amount: 60000, change: false },
  // No change output = sweep entire balance minus fees
]