Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion payjoin-ffi/src/receive/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1239,7 +1239,20 @@ impl PayjoinProposal {
.to_string()
}

/// Construct an OHTTP Encapsulated HTTP POST request for the Proposal PSBT
/// Construct an OHTTP-encapsulated HTTP request carrying the Proposal PSBT.
///
/// The inner HTTP method, body encoding, and target mailbox depend on
/// whether the original sender used Payjoin v2 (BIP 77) or Payjoin v1
/// (BIP 78), as recorded in the session context:
///
/// - v2 sender (reply key present): POST an HPKE-encrypted `PjV2MsgB`
/// payload to the sender's reply mailbox.
/// - v1 sender (no reply key): PUT the base64-encoded PSBT as cleartext
/// UTF-8 bytes to the receiver's own mailbox, per the
/// [BIP 77](https://github.com/bitcoin/bips/blob/master/bip-0077.md)
/// Backwards compatibility section.
///
/// Both paths are then OHTTP-encapsulated to the directory's OHTTP Gateway.
pub fn create_post_request(
&self,
ohttp_relay: String,
Expand Down
15 changes: 14 additions & 1 deletion payjoin/src/core/receive/v2/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1137,7 +1137,20 @@ impl Receiver<PayjoinProposal> {
/// The Payjoin Proposal PSBT.
pub fn psbt(&self) -> &Psbt { &self.psbt_context.payjoin_psbt }

/// Construct an OHTTP Encapsulated HTTP POST request for the Proposal PSBT
/// Construct an OHTTP-encapsulated HTTP request carrying the Proposal PSBT.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

small nit:

Suggested change
/// Construct an OHTTP-encapsulated HTTP request carrying the Proposal PSBT.
/// Construct an OHTTP-encapsulated HTTP request carrying the Proposal PSBT to be sent to the payjoin directory.

Maybe this is already obvious, but as someone who is not as familiar with BIP 77 scheme I think it adds clarity that both sender and receiver mailbox live at the same payjoin directory.

///
/// The inner HTTP method, body encoding, and target mailbox depend on
/// whether the original sender used Payjoin v2 (BIP 77) or Payjoin v1
/// (BIP 78), as recorded in the session context:
///
/// - v2 sender (reply key present): POST an HPKE-encrypted `PjV2MsgB`
/// payload to the sender's reply mailbox.
/// - v1 sender (no reply key): PUT the base64-encoded PSBT as cleartext
/// UTF-8 bytes to the receiver's own mailbox, per the
/// [BIP 77](https://github.com/bitcoin/bips/blob/master/bip-0077.md)
/// Backwards compatibility section.
///
/// Both paths are then OHTTP-encapsulated to the directory's OHTTP Gateway.
pub fn create_post_request(
&self,
ohttp_relay: impl IntoUrl,
Expand Down
Loading