Repository navigation
Description
there is no off-the-shelf way to display historical activity for both senders receivers once a payjoin was initiated, updated, and completed. Basically we want to be able to add "payjoin happened" to a tx history screen (or cli output) in a consistent way. And we want to have documentation and an API around best practices wrt that
any particular protocol offers a number of user-facing APIs that are ~independent from the particular implementation. For Payjoin users, they need some thing that allows them to identify where their money went, and probably the'd expect this thing to be the same independently from which particular wallet they use. Similar probably could be said for some kind of identifier for the flow by which they can easily discern which payment is which if they, e.g., have multiple concurrent payments going on.
We probably can find some good contenders for both of these in the concrete LDK Node implementation, but it feels almost like a layer violation as it's essentially not up to us to make up typical APIs for the payjoin protocol. Hence my view that, as all implementors would have the same issue, it might be good to provide clear guidance in rust-payjoin itself.
Fortunately there are multiple implementations (payjoin-cli, nolooking, LDK-Node, Mutiny) to reference and come up with a unified solution:
- payjoin-cli uses the public key of the session for receivers and the pj_url for senders
- nolooking uses the bip21's bitcoin address for receivers and does not persist sender sessions
- LDK-Node tried using the bip21's bitcoin address for sending
- Mutiny used the public key of the session for receivers and the txid of the original PSBT for senders
- BitMask seems to rely wholly on BDK's transaction list to persist this info
This seems more like a wallet issue than a rust-payjoin issue since the historical activity is related to a label of activity.
payjoin-cli details
payjoin-cli stores Sender and Receiver structs serialized as json and identified by Sender::pj_uri() and Receiver::id() respectively I think the first thing to figure out is whether or not this is sufficient. Historical data is maintained by the blockchain at bitcoin core without issue. Does this serialization make sense?
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
arminsabouri commentedon Feb 24, 2025
related: SatoshiPortal/bullbitcoin-mobile#372
arminsabouri commentedon Feb 24, 2025
There seems to be two motivations for this work:
Imo there is two ways to consider this.
Edit: meeting notes
Save state trait for sender + reciver. A simple interface would include a get method to get a key and a body which is serialized.
arminsabouri commentedon Feb 24, 2025
One open question is what format do we chose for the serialized data? JSON comes with some data overhead but its ussually universally accepted by most software projects. And it would make the implementation easier as we can just use serde::json.
It looks like its also the prefered option of payjoin cli
cc @DanGould
Introduce `Persistable` trait
Introduce `Persistable` trait
Introduce `Persistable` trait
Introduce `Persistable` trait
Introduce `Persistable` trait
Instantiate `v2::Reciver` only after data persistence is complete
Instantiate `v2::Reciver` only after data persistence is complete
85 remaining items
arminsabouri commentedon Jul 18, 2025
The only thing missing is a refrence for "displaying historical payjoin activity" in payjoin-cli. But that can be its own ticket.
DanGould commentedon Jul 18, 2025
I think a reference is fair bounds within this ticket. we still have not demonstrated best practice. getting there
Refactor sender to validate PjParam by version (#901)
Use short id as session id for pj sender
Use short id as session id for pj sender
arminsabouri commentedon Sep 2, 2025
This can take the shape of a new command
--history <active | inactive>. Maybe by default we display all.Inactive sessions should be sorted by created_at. Active sessions should be sorted by completed_at. If session is fatally terminated error should be provided in human readable format. All sessions should be printed in a tabular format with \n delimiting sessions
DanGould commentedon Sep 3, 2025
I'd prefer a subcommand
-- historyjust likesend,receive. vs an option--history. A first iteration that displays all seems appropriate.Introduce persistence traits
Persist receiver when initialized
Persist sender when initialized
arminsabouri commentedon Oct 3, 2025
Our refrence implementation has suitable db schema that can be used as a refrence for other integrations
https://github.com/payjoin/rust-payjoin/blob/master/payjoin-cli/src/db/mod.rs