-
Notifications
You must be signed in to change notification settings - Fork 179
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
Add support for BIP78 payjoins to .onion receivers #638
Conversation
1e3600c
to
61c10f7
Compare
Rebased on the bip78fallback branch as of 61c10f7 |
61c10f7
to
bdd85b9
Compare
Rebased on master as of bdd85b9 (no code change just base branch change) a couple days back. Is anyone planning on testing this? |
I'd like to test this, just not sure what's the easiest way to set up a test receiver for this situation. Maybe BTCPay server? I took a quick look at Wasabi, they don't seem to support BIP78 receive. |
I could look at testing this. @AdamISZ , you don't like the idea of renaming |
Oh thanks for the reminder, I just forgot. I'll do it yeah. Re: btcpayserver I asked in their IRC 'cos I was thinking of trying that myself. Does Wasabi not have this available yet? (onion receiver). |
I took a quick look at the Wasabi docs, and I don't think so. Cross checked with this link below as well. I'm currently working on setting up BTCPay server to run the test. I'm following the testnet instructions here: https://docs.btcpayserver.org/TryItOut/ |
Ah OK nice @Jules23 . Btw I am not testing it on testnet, testnet is too painful. Either regtest or mainnet for me :) Kukks tells me he has such a thing and will link it later. |
bdd85b9
to
1983e08
Compare
@kristapsk changed config var name as of 1983e08 |
Where's the pain point? I'm progressing quite nicely, I am now moving to set up joinmarket on testnet. I have created an invoice with this URI, let me know if this corresponds to what we are testing. bitcoin:tb1qkq53u32tpxk5d2k7dklsgzqcahs8uj6tane533?amount=0.00109348&pj=http://yibzxq3jdqyfjzwgatd3fqihswtrdunjdnlbmb6v6yii5g2ghntbfkad.onion/BTC/pj |
Large reorgs, blocks vary between painfully slow and every few seconds due to the weird algo, much too large (both block height and size of blockchain, kind of ridiculous how big it is, rescanning is not fun), awkward getting hold of coins sometimes, but the biggest one isn't relevant any more I guess: for a long time before and after segwit activation, there were many testnet miners (people with ASICs messing around) who weren't mining segwit transactions. It's just not worth it until they reset it imo. |
I set up local BTCPay Server testnet instance with P2SH-SegWit wallet and created Tor hidden service for it (BTCPay Server automatically creates .onion pj= URLs if site itself is opened via .onion link, no extra configuration there necessary). First payjoin test didn't succeed, ended up with a non-payjoin payment.
|
Hmm, but I forgot to add |
I am currently getting the error below when setting up a testnet instance, and using both wrapped and native segwit joinmarket wallets.
Also, in certain cases, I end up with this. The process doesn't seem to make any progress after the last line. It does surprise me because I have ~0.01 BTC, and Im sending ~0.0005 BTC. I did check that I am using the corrext mixdepth.
|
You set a fee of 1 sat/byte which is right at the relay limit. That's why it didn't work, because we insist iirc on a slight bump above that (1.2).
This is a bug in the error message code, I think someone already told me about. Thanks for the heads up I will check it out shortly.
People often don't realise this, but the defaults are picked up from jmclient/jmclient/configure.py always, and only overwritten if you have something in joinmarket.cfg |
Are the coins confirmed? It is possible to spend unconfirmed coins with |
If confirmed means at least 1 confirmation, then yes, the coins are confirmed. |
OK. Are they frozen? Check with |
Re: Connection refused, it can be a configuration issue, also a question is whether the onion is serving SSL. I was discussing this a bit on IRC, I'm hoping that nobody will be serving using ssl on ephemeral onions, it doesn't really make much sense. |
So you generated the wallet (native or p2sh?), with testnet true, and then you wallet-tooled it and then you deposited, you waited for confirmation, and you see the coins in wallet-tool in mixdepth 0 (my guess), and then you get this direct-send error? Hmm. Is your joinmarket.cfg in your home dir set to testnet? Do you know you can do --datadir=. to use a joinmarket.cfg in the current directory, not interfering with your main instance? Just a few thoughts. I don't have the full information here, you've only shown a stack trace. |
Ah, great! Missed (or have forgotten) that.
Yes, did sendpayment with --txfee=2000 and testnet p2sh-segwit payjoin to BTCPay Server .onion succeeded. |
Yes. I am getting this error with both native and p2sh.
Yes.
I did not know, but I am not running another instance on my machine. |
@Jules23 maybe try a normal direct send payment (-N0 ) to another address in the wallet to see if you get the same not enough funds? |
I'm also getting this error here. I should have noted that at the beginning sorry. Edit: Let me figure this problem out further, I'll let you know once I have a better understanding. |
Here are Kukks' donation endpoints (edit: sorry not literally the endpoints; this is the donation server which will generate the bip21 uri for you, of course) if anyone's interested in trying them:
|
The above worked first time for me on mainnet, see tx 0902979fcc2476d64056537116e2c2b5e1903daca3eda095a457cda336bf91bb Note that they're v3 onions, as expected we can send to them also, fine. |
73b0edc Update macOS installation instructions (Jules Comte) Pull request description: This should be merged after #536, and is a followup to #629 It includes build instructions for libsecp256k1 for those who don't use `install.sh` @AdamISZ I was wrong, it turns out that `install.sh` does need some modifications to work on mac os from scratch. My biggest question at this point is whether I have the list of darwin dependencies correct in `install.sh: line 44` With the current list, I was able to build, and pass the testsuite on fresh installations of Mac OS Catalina with Apple Command Line Tools and Homebrew installed. Top commit has no ACKs. Tree-SHA512: f9feed9d6052cefd043a025212e27347669aa6a082a4543d2f19a64f74ceb51694fa33efb5a92b79f7fc15a70efead4ac32cee3ab78acb6badd894f8b616aede
This was due to me not running tor when attempting a payjoin to a .onion. Can we remind users to run Tor in this case in
Besides these points, I've been able to execute a payjoin with a remote testnet BTCPay server onion instance, with both wrapped and native segwit. |
On balance I think not. The BIP specifies this behaviour. I agree it is a valid question/point of debate, but for now we're just implementing the BIP.
Agreed. I'll add something in there on this, and on the port, but of note: users have always had the same configuration requirement connecting to IRC servers. A very large fraction of our users go over tor for that in the same way (socks5 proxy, to onion), but this is distinct in as much as it may be required for a given payment URI and the user may not even know it (at least, in theory). |
We could probably use some smart probing by default here (try 9050, then 9150). Timeout when connecting to localhost could be really small, I think, something like 1 second? |
a39991a Make scripts compatible with FreeBSD (Kristaps Kaupe) Pull request description: Related - #629 (comment). Top commit has no ACKs. Tree-SHA512: 617ec8a62ff1b53162bf7d204e5f75fde0dae2aa797080d69c5e94a9e965bfd436216a1933c148bb597e8907219844483f812c58881273235e2d79edd40f0161
1983e08
to
91a9116
Compare
Rebased on master in 91a9116 Edit: I have no idea why it's showing 3 commits (the first two are already in master). Appears to be just a glitch. |
Fixed problem in #638 (comment) with 1ee8a42 This is probably mergeable after squash now as it's passed several tests. @Jules23 did you eventually figure out what was wrong with your testnet set up? |
Addressed the first point in #638 (comment) with 0071948 |
51ce63b Use ellipsis for non-immediate menu items (Kristaps Kaupe)
0071948
to
660aca3
Compare
Rebased on master again with 660aca3 - sorry for all this messing around but I can't figure out why the PR shows all the recent commits after |
@AdamISZ Yes! The whole time, I was trying to spend an unconfirmed coin ( the change coin from the Payjoin transaction ).
When you said this, my brain was only thinking of possible unconfirmed coins coming from outside the wallet. I wasn't realizing that when I execute a payjoin, all my balance again becomes unconfirmed as well. O well! Sorry for sowing confusion again. Question: instead of a NotEnoughFunds error, should we tell users that some of their balance is not confirmed ? |
No worries, it's a normal enough error. Thanks for following up.
A lot of us long-time runners just set listunspent_args but this is not at all obvious to new users, moreover, probably the biggest weakness of Joinmarket as a wallet is that it does very little to inform users about confirmation status. This should be fixed (both documentation, somewhat but especially code for CLI and Qt) and I don't think it is very difficult since some of the work on the wallet some months ago (starting with #359 but also some follow ups from that) means we now have confirmations data attached to all utxos. |
In this commit, the jmclient.payjoin module now supports sending payments to BIP21 URIs where the pj= parameter is to a hidden service address. Additionally, the test/payjoinclient and test/payjoinserver modules are edited to support optionally testing payments to an ephemeral hidden service.
660aca3
to
6d8844e
Compare
Attempting merge now and hoping that the above display of all the previous commits is an irrelevant display glitch. |
Nope, it's borked. Replaced this with #648 - exactly the same code, so now merging that. |
In this commit, the jmclient.payjoin module now supports
sending payments to BIP21 URIs where the pj= parameter is
to a hidden service address.
Additionally, the test/payjoinclient and test/payjoinserver
modules are edited to support optionally testing payments to
an ephemeral hidden service.