Skip to content

Implement Escrow-Based Atomic Swap with Partial Payments #407

@fejilaup-cloud

Description

@fejilaup-cloud

Description

Currently, atomic swaps are all-or-nothing. For high-value IP sales, buyers should be able to pay in installments with escrow holding funds until all payments are received.

Tasks

  • Add payment_schedule: Vec to SwapRecord (amount, due_date)
  • Implement initiate_swap_with_schedule(env, ip_id, schedule) -> u64
  • Implement submit_installment_payment(env, swap_id, payment_amount) — buyer-only
  • Track paid vs. remaining balance in swap state
  • Only release decryption key after final payment received
  • Add tests for multi-installment flow and partial payments

Priority: High | Estimated Time: 4 hours

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions