Skip to content

Instantly share code, notes, and snippets.

Currently the bitcoinj wallet API vends transaction objects and consequently wallet apps show their payment history as a list of transactions. This is not ideal in lots of cases. For example, a refund will appear disconnected from the original payment.
Here is a proposal for how to aggregate transactions (and more) into payments. Note payments are mutable, because they will collect data as time passes.
A payment consists of:
- Payment request. This can be either a BIP70 payment request or a BIP21 (URI) payment request. For payments that are sender initiated this part is missing (a payment will be more or less just a wrapper around a single transaction in this case).
- Transactions. We're interested in those which pay towards the payment request or refund money already paid.
- Confidences of these transactions.
- User notes