Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot create a P2EP transaction with BIP 21 #622

Closed
johnongit opened this issue Jul 4, 2020 · 5 comments
Closed

Cannot create a P2EP transaction with BIP 21 #622

johnongit opened this issue Jul 4, 2020 · 5 comments

Comments

@johnongit
Copy link

On the last version v0.6.3.1, I'm not able to create a payjoin transaction using a bip21 URI.

When I launch the following command
python sendpayment.py -T P2EP wallet3.jmdat bitcoin:bc1qffkj88zp532a3mjaa6m8lv2fyar9n3n478cplz?amount=0.00018528

JM returns this

Usage: sendpayment.py [options] wallet_file amount destination
sendpayment.py [options] wallet_file bitcoin_uri
sendpayment.py: error: PayJoin requires exactly three arguments: wallet, amount and destination address.

This is not consistent with the BIP21 usage.

sendpayment.py [options] wallet_file bitcoin_uri

@AdamISZ
Copy link
Member

AdamISZ commented Jul 5, 2020

There is some (understandable!) confusion here.
First, there is use of BIP21. For that we need 2 arguments: the wallet name, and the bip21 uri.
Second, there is use of Payjoin in the form introduced into Joinmarket some time ago, which is a payjoin from joinmarket wallet to joinmarket wallet only. For this you use the -T flag and specify the name of the bot as argument.
Third there is the new standardised Payjoin (BIP 78) that should work cross wallets, that is going to be introduced after merge of #536 .

Additionally to consider: if you intend to use a BIP21 uri to make a payjoin payment, using the BIP78 (or really any other) standard, you need to encode the endpoint into the BIP21 uri. In BIP78 specifically that is achieved with a pj= parameter inside the BIP21 uri. Your BIP21 uri is only encoding the address and amount, i.e. it's a normal payment uri not a payjoin.

Once #536 is merged and we have functional BIP78 payjoins available, we will not immediately deprecate the old style Joinmarket-Joinmarket payjoins (using the -T parameter and the receive-payjoin.py script for the receiver) but we will probably make a new BIP78 receiver function, and then deprecate the original version, at some point.

@kristapsk
Copy link
Member

To payjoin from JM wallet to JM wallet with BIP21 URI, you should use BIP21 URI from receiver side, which includes additional jmnick parameter.

@AdamISZ
Copy link
Member

AdamISZ commented Jul 6, 2020

@kristapsk thanks, I had indeed forgotten that point: as of now, the receive-payjoin.py script will output a BIP21 uri which uses the jmnick parameter, which is given to the sender (this is in contrast to the above - in BIP78 a pj parameter is used to do the same thing; in both cases the string value for the parameter is identifying for the sender, how to make the necessary connection to the receiver).

@AdamISZ
Copy link
Member

AdamISZ commented Jul 10, 2020

@evildido if you do actually want to do a payjoin (BIP78) transaction using a BIP21 uri (it should contain the pj= parameter to be valid), you can now do so from master (code to support this is now merged) (you would need to re-run the installation script), I have tested it against a btcpayserver instance and it works for me.

If you just want to test BIP21 usage like the example you gave (which is not a payjoin) then do the same as you did, but just omit the -T parameter.

If you wanted to test a joinmarket-joinmarket wallet payment using that variant of payjoin, see the current documentation on it in docs/PAYJOIN.md (that's what it describes right now, I will update it to have info on the new BIP78 too).

@AdamISZ
Copy link
Member

AdamISZ commented Jul 10, 2020

Closing assuming that one of those three addresses your need, but if not please reopen.

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

No branches or pull requests

3 participants