Skip to content

Feature: Multi-Recipient (Batched) Transaction Support to Reduce Fees #4

@jamespepper81

Description

@jamespepper81

Overview

Enhance the BitSleuth Wallet to support sending funds to multiple recipients in a single transaction. This improvement aims to reduce transaction fees through optimized batching and provide a better user experience while lowering network congestion.

Objectives

  • Allow users to specify multiple recipient addresses and corresponding amounts within one transaction.
  • Minimize total and per-recipient network fees via dynamic fee calculation and batching logic.
  • Ensure robust input validation and error handling for all transaction parameters.

Detailed Action Items

  • Transaction Model:
    • Update the transaction builder to support assembling multiple outputs in a single transaction (e.g., tx.outputs[] = [{address, amount}, ...]).
    • Ensure transaction serialization/deserialization supports multi-output transactions.
  • Fee Optimization:
    • Implement fee calculation logic that distributes network fees efficiently across all recipients to ensure savings versus sequential transactions.
    • Benchmark single vs. multi-recipient sends to validate fee reductions (aim ≥15% savings).
  • UI/UX Enhancements:
    • Modify the wallet's send screen to accept and display multiple recipient fields.
    • Provide dynamic validation for address formatting, amount entry, and duplicate/malformed addresses.
    • Add recipient management for easy add/remove/edit and a preview of total outputs and fees before confirmation.
  • Backend & API:
    • Update backend endpoints and signing flows to securely handle and process multi-recipient payloads.
    • Ensure responses and audit logs report per-recipient outcomes and transaction IDs.
  • Validation:
    • Enforce balance checks, dust threshold enforcement, and output count limits.
  • Testing:
    • Unit test building, serialization, and edge cases of multi-recipient transactions.
    • Integration test end-to-end broadcasting, confirmation, and error scenarios.
    • Regression benchmark gas/fee savings.
  • Documentation:
    • Update API references and user docs to illustrate new send structure and example multi-recipient payloads.

Acceptance Criteria

  • Wallet UI allows users to send to multiple recipients easily in a single flow.
  • Sending to multiple recipients in one transaction is reliably confirmed and audit-logged.
  • Fee per recipient is at least 15% lower than sequential single sends (demonstrated with tests).
  • Robust validation prevents accidental or malicious errors (malformed, duplicated, or dust outputs).
  • Developer/API user documentation covers updated usage and example payloads.

Labels: enhancement
Project: Wallet
Assignee: jamespepper81
Type: Task

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No fields configured for Task.

Projects

Status
Backlog

Relationships

None yet

Development

No branches or pull requests

Issue actions