Skip to content

Commit dee6890

Browse files
committed
Always signal pjos=0 in V2 receivers
Per [BIP77](https://github.com/bitcoin/bips/blob/master/bip-0077.md#payjoin-uri): > Since BIP 78 payloads are neither encrypted nor authenticated, a directory used for backwards-compatible payloads is known as an "unsecured payjoin server" in BIP 78 parlance. Backwards-compatible receivers MUST disable output substitution by setting pjos=0 to prevent modification by a malicious directory. Note that pjos=0 is ignored by V2 senders per the previous commit.
1 parent dca7f73 commit dee6890

File tree

1 file changed

+2
-2
lines changed
  • payjoin/src/core/receive/v2

1 file changed

+2
-2
lines changed

payjoin/src/core/receive/v2/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ impl Receiver<Initialized> {
389389

390390
/// Build a V2 Payjoin URI from the receiver's context
391391
pub fn pj_uri<'a>(&self) -> crate::PjUri<'a> {
392-
pj_uri(&self.context, OutputSubstitution::Enabled)
392+
pj_uri(&self.context, OutputSubstitution::Disabled)
393393
}
394394

395395
pub(crate) fn apply_unchecked_from_payload(
@@ -1010,6 +1010,6 @@ pub mod test {
10101010
fn test_v2_pj_uri() {
10111011
let uri = Receiver { state: Initialized { context: SHARED_CONTEXT.clone() } }.pj_uri();
10121012
assert_ne!(uri.extras.endpoint, EXAMPLE_URL.clone());
1013-
assert_eq!(uri.extras.output_substitution, OutputSubstitution::Enabled);
1013+
assert_eq!(uri.extras.output_substitution, OutputSubstitution::Disabled);
10141014
}
10151015
}

0 commit comments

Comments
 (0)