Skip to content

Conversation

benalleng
Copy link

THIS PR IS NOT INTENDED TO BE MERGED

This commit acts as the initial approach set out by Artur, Armin, and myself to add payjoin support into liana.

Any changes from this PR will be split up into their individual issues / PRs for more precise review.

Some initial starting points may be to add bip21 support as an example which is a small lift and is ultimately not payjoin specific

@benalleng benalleng force-pushed the payjoin-v4 branch 2 times, most recently from e96d087 to 92236a2 Compare August 7, 2025 22:47
@benalleng

This comment was marked as resolved.

@benalleng benalleng force-pushed the payjoin-v4 branch 2 times, most recently from 34857cd to 6c00f6c Compare August 18, 2025 18:06
@pythcoiner
Copy link
Collaborator

note: not yet taken time to look at this, on my todo for this week

@pythcoiner pythcoiner mentioned this pull request Aug 30, 2025
9 tasks
Copy link
Collaborator

@pythcoiner pythcoiner left a comment

Choose a reason for hiding this comment

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

I take a first look at this PR, not yet dig the payjoin logic but here few preliminary comments.

I've also opened this issue for general talk about payjoin integration

LoadWallet(Wallet),
Info(Result<GetInfoResult, Error>),
ReceiveAddress(Result<(Address, ChildNumber), Error>),
ReceiveAddress(Result<(Address, ChildNumber, Option<Url>), Error>),
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'd be in favor of a separate variant ReceivePayjoin here instead merging the 2 purposes

&self
.addresses
.bip21s
.get(self.address(i).expect("Address should be in bip21")),
Copy link
Collaborator

Choose a reason for hiding this comment

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

we should not panic here, just stop and log w/ tracing::error

label: form::Value<String>,
address: form::Value<String>,
amount: form::Value<String>,
bip21: form::Value<String>,
Copy link
Collaborator

Choose a reason for hiding this comment

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

I dont think we should have a separate field for BIP21, we should be able to parse both BIP21 & address in the address field

SelectHardwareWallet(usize),
CreateRbf(CreateRbfMessage),
ShowQrCode(usize),
ShowBip21QrCode(usize),
Copy link
Collaborator

Choose a reason for hiding this comment

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

I dont think we should have a separate message for this

self.derivation_index(i),
) {
if let Some(modal) = ShowBip21QrCodeModal::new(bip21, *index) {
self.modal = Modal::ShowBip21QrCode(modal);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we really need a different modal, can't we reuse the initial QR modal?

None,
)
.save(&persister)
.unwrap();
Copy link
Collaborator

Choose a reason for hiding this comment

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

we can error here instead

}

/// Initiate a payjoin sender
// TODO bip21 should be a uri not a string
Copy link
Collaborator

Choose a reason for hiding this comment

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

yes validation should be done early

let uri = uri
.check_pj_supported()
.map_err(|_| "URI does not support Payjoin".to_string())
.unwrap();
Copy link
Collaborator

Choose a reason for hiding this comment

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

we should error instead

}

/// Get Payjoin URI (BIP21) and its sender/receiver status by txid
pub fn get_payjoin_info(&self, txid: &bitcoin::Txid) -> Result<PayjoinStatus, CommandError> {
Copy link
Collaborator

Choose a reason for hiding this comment

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

In this fn info logs should be debug

)
})?;

for index in 0..spend_psbt.inputs.len() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

info => debug
warn => error

arminsabouri and others added 4 commits October 9, 2025 09:52
This commit acts as the initial approach set out by Artur to add payjoin
tnio liana.

Any changes from this PR will be split up into their individual issues /
PRs for more exact review.
When the receive session for loop failed to proceed past a certain
callback method it stopped the entire for loop but now it simply skips
over those sessions allowing the other sessions to proceed giving those
older sessions an opportunity to be fixed or deleted.
@benalleng benalleng force-pushed the payjoin-v4 branch 2 times, most recently from 1984f04 to 7f6b618 Compare October 9, 2025 15:30
update msrv to 1.85.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants