rust-payjoin icon indicating copy to clipboard operation
rust-payjoin copied to clipboard

How to run `payjoin-directory` locally?

Open thebrandonlucas opened this issue 7 months ago • 8 comments

I ran the following from latest master (c35b20a4fba52468f6be284c87b6df8c3e201f49):

RUST_LOG=debug cargo run --bin payjoin-directory
   Compiling payjoin-directory v0.0.2 (/home/blu/src/rust-payjoin/payjoin-directory)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.72s
     Running `target/debug/payjoin-directory`
Logging initialized
2025-06-09T12:58:39.286312Z  INFO payjoin_directory::key_config: Loaded existing OHTTP Key Configuration from ohttp_keys/1.ikm

I checked the code and saw that the directory runs on port 8080 by default. I tried to run a receive with the following config.toml:

# Nigiri uses the following RPC credentials
[bitcoind]
rpcuser = "admin1"
rpcpassword = "123"
rpchost = "http://localhost:18443/wallet/receiver"

# For v2, our config also requires a payjoin directory server and OHTTP relay
[v2]
pj_directory = "http://0.0.0.0:8080"
ohttp_relays = ["https://pj.benalleng.com", "https://pj.bobspacebkk.com", "https://ohttp.achow101.com"]

And got a 400 Bad Request:

UST_LOG=debug cargo run --bin payjoin-cli -- receive 10000
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.10s
     Running `/home/blu/src/rust-payjoin/target/debug/payjoin-cli receive 10000`
[2025-06-09T13:07:46Z DEBUG payjoin_cli::app::config] App config: Config { db_path: "payjoin.sled", max_fee_rate: None, bitcoind: BitcoindConfig { rpchost: Url { scheme: "http", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("localhost")), port: Some(18443), path: "/wallet/receiver", query: None, fragment: None }, cookie: None, rpcuser: "admin1", rpcpassword: "123" }, version: Some(V2(V2Config { ohttp_keys: None, ohttp_relays: [Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("pj.benalleng.com")), port: None, path: "/", query: None, fragment: None }, Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("pj.bobspacebkk.com")), port: None, path: "/", query: None, fragment: None }, Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("ohttp.achow101.com")), port: None, path: "/", query: None, fragment: None }], pj_directory: Url { scheme: "http", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("localhost")), port: Some(8080), path: "/", query: None, fragment: None } })) }
[2025-06-09T13:07:46Z DEBUG sled::pagecache::iterator] ordering before clearing tears: {0: 0}, max_header_stable_lsn: 0
[2025-06-09T13:07:46Z DEBUG sled::pagecache::iterator] in clean_tail_tears, found missing item in tail: None and we'll scan segments {0: 0} above lowest lsn 0
[2025-06-09T13:07:46Z DEBUG sled::pagecache::iterator] filtering out segments after detected tear at (lsn, lid) 12635
[2025-06-09T13:07:46Z DEBUG sled::pagecache::iterator] hit max_lsn 12635 in iterator, stopping
[2025-06-09T13:07:46Z DEBUG sled::pagecache::snapshot] zeroing the end of the recovered segment at lsn 0 between lids 12636 and 524287
[2025-06-09T13:07:46Z DEBUG sled::pagecache::blob_io] gc_blobs removing any blob with an lsn above 12636
[2025-06-09T13:07:46Z DEBUG sled::pagecache::segment] SA starting with tip 524288 stable -1 free {}
[2025-06-09T13:07:46Z DEBUG sled::pagecache::iobuf] starting log at recovered active offset 12636, recovered lsn 12636
[2025-06-09T13:07:46Z DEBUG sled::pagecache::iobuf] starting IoBufs with next_lsn: 12636 next_lid: 12636
[2025-06-09T13:07:46Z DEBUG sled::pagecache] load_snapshot loading pages from 0..8
[2025-06-09T13:07:46Z DEBUG bitcoincore_rpc] JSON-RPC request: getblockchaininfo []
[2025-06-09T13:07:46Z DEBUG bitcoincore_rpc] JSON-RPC request: getnetworkinfo []
[2025-06-09T13:07:46Z DEBUG bitcoincore_rpc] JSON-RPC request: getnewaddress [null,null]
[2025-06-09T13:07:46Z DEBUG bitcoincore_rpc] JSON-RPC request: getblockchaininfo []
[2025-06-09T13:07:46Z DEBUG bitcoincore_rpc] JSON-RPC request: getnetworkinfo []
Bootstrapping private network transport over Oblivious HTTP
[2025-06-09T13:07:46Z DEBUG reqwest::connect] starting new connection: http://localhost:8080/
[2025-06-09T13:07:46Z DEBUG reqwest::connect] proxy(https://pj.benalleng.com) intercepts 'http://localhost:8080/'
[2025-06-09T13:07:46Z DEBUG rustls::client::hs] No cached session for DnsName("pj.benalleng.com")
[2025-06-09T13:07:46Z DEBUG rustls::client::hs] Not resuming any session
[2025-06-09T13:07:46Z DEBUG rustls::client::hs] Using ciphersuite TLS13_AES_256_GCM_SHA384
[2025-06-09T13:07:46Z DEBUG rustls::client::tls13] Not resuming
[2025-06-09T13:07:46Z DEBUG rustls::client::tls13] TLS1.3 encrypted extensions: [ServerNameAck]
[2025-06-09T13:07:46Z DEBUG rustls::client::hs] ALPN protocol is None
[2025-06-09T13:07:46Z DEBUG rustls::common_state] Sending warning alert CloseNotify
[2025-06-09T13:07:46Z DEBUG sled::pagecache::logger] IoBufs dropped
Error: Unexpected status code from payjoin directory: 400 Bad Request

I also tried using http://localhost:8080 for pj_directory. When I change the pj_directory to https://payjo.in, everything works fine. I'm wondering what step I am missing here to run and use a directory locally. There doesn't

thebrandonlucas avatar Jun 09 '25 13:06 thebrandonlucas

I think this issues occurs because the Ohttp relays can not resolve http://localhost:8080 to point to your local host . Localhost will be unresolvable for the relays since that will point to their own local host .

A work around would be making your local host reachable over the internet using something like Ngrok or any tunnel of your choosing .

zealsham avatar Jun 09 '25 14:06 zealsham

another unsafe workaround is to terminate directory TLS with a reverse proxy like nginx and hand packets directly to the directory, ignoring the use of an OHTTP relay.

DanGould avatar Jun 09 '25 14:06 DanGould

I think this issues occurs because the Ohttp relays can not resolve http://localhost:8080/ to point to your local host . Localhost will be unresolvable for the relays since that will point to their own local host .

This makes a lot of sense, thank you.

I tried the ngrok method and got a bit further, but still no dice. Looks like it still has something to do with a failure to bootstrap OHTTP properly, perhaps due to a .well-known/ohttp-gateway not being setup by ngrok. On the ngrok server side, we're seeing a 500 Internal Server Error when trying to POST to the .well-known/ohttp-gateway. Perhaps the ability to do this is what we need yet is disabled on the ngrok side? I may have to try this using a solution on my own VPS via a self-hostable alternative to ngrok like frp?

payjoin-directory:

cargo run --bin payjoin-directory
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.07s
     Running `/home/blu/src/rust-payjoin/target/debug/payjoin-directory`
Logging initialized
2025-06-10T15:12:04.178298Z  INFO payjoin_directory::key_config: Loaded existing OHTTP Key Configuration from ohttp_keys/1.ikm
2025-06-10T15:12:11.357669Z ERROR payjoin_directory: Redis error: Connection refused (os error 111)
2025-06-10T15:12:11.357722Z ERROR payjoin_directory: Internal server error: Internal server error

ngrok http 8080:

HTTP Requests                                                                                                                                                                   
-------------                                                                                                                                                                   
                                                                                                                                                                                
11:12:11.135 EDT GET  /.well-known/ohttp-gateway 200 OK                                                                                                                         
11:12:11.331 EDT POST /.well-known/ohttp-gateway 500 Internal Server Error                                                                                                      
11:12:10.879 EDT GET  /.well-known/ohttp-gateway 200 OK

payjoin-cli receive:

RUST_LOG=DEBUG cargo run --bin payjoin-cli -- receive 10000
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.10s
     Running `/home/blu/src/rust-payjoin/target/debug/payjoin-cli receive 10000`
[2025-06-10T15:12:10Z DEBUG payjoin_cli::app::config] App config: Config { db_path: "payjoin.sled", max_fee_rate: None, bitcoind: BitcoindConfig { rpchost: Url { scheme: "http", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("localhost")), port: Some(18443), path: "/wallet/receiver", query: None, fragment: None }, cookie: None, rpcuser: "admin1", rpcpassword: "123" }, version: Some(V2(V2Config { ohttp_keys: None, ohttp_relays: [Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("pj.benalleng.com")), port: None, path: "/", query: None, fragment: None }, Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("pj.bobspacebkk.com")), port: None, path: "/", query: None, fragment: None }, Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("ohttp.achow101.com")), port: None, path: "/", query: None, fragment: None }], pj_directory: Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("f619-96-75-30-113.ngrok-free.app")), port: None, path: "/", query: None, fragment: None } })) }
[2025-06-10T15:12:10Z DEBUG sled::pagecache::iterator] ordering before clearing tears: {0: 0}, max_header_stable_lsn: 0
[2025-06-10T15:12:10Z DEBUG sled::pagecache::iterator] in clean_tail_tears, found missing item in tail: None and we'll scan segments {0: 0} above lowest lsn 0
[2025-06-10T15:12:10Z DEBUG sled::pagecache::iterator] filtering out segments after detected tear at (lsn, lid) 14405
[2025-06-10T15:12:10Z DEBUG sled::pagecache::iterator] hit max_lsn 14405 in iterator, stopping
[2025-06-10T15:12:10Z DEBUG sled::pagecache::snapshot] zeroing the end of the recovered segment at lsn 0 between lids 14406 and 524287
[2025-06-10T15:12:10Z DEBUG sled::pagecache::snapshot] removing old snapshot file "/home/blu/src/rust-payjoin/receiver/payjoin.sled/snap.00000000000034D4"
[2025-06-10T15:12:10Z DEBUG sled::pagecache::blob_io] gc_blobs removing any blob with an lsn above 14406
[2025-06-10T15:12:10Z DEBUG sled::pagecache::segment] SA starting with tip 524288 stable -1 free {}
[2025-06-10T15:12:10Z DEBUG sled::pagecache::iobuf] starting log at recovered active offset 14406, recovered lsn 14406
[2025-06-10T15:12:10Z DEBUG sled::pagecache::iobuf] starting IoBufs with next_lsn: 14406 next_lid: 14406
[2025-06-10T15:12:10Z DEBUG sled::pagecache] load_snapshot loading pages from 0..8
[2025-06-10T15:12:10Z DEBUG bitcoincore_rpc] JSON-RPC request: getblockchaininfo []
[2025-06-10T15:12:10Z DEBUG bitcoincore_rpc] JSON-RPC request: getnetworkinfo []
[2025-06-10T15:12:10Z DEBUG bitcoincore_rpc] JSON-RPC request: getnewaddress [null,null]
[2025-06-10T15:12:10Z DEBUG bitcoincore_rpc] JSON-RPC request: getblockchaininfo []
[2025-06-10T15:12:10Z DEBUG bitcoincore_rpc] JSON-RPC request: getnetworkinfo []
Bootstrapping private network transport over Oblivious HTTP
[2025-06-10T15:12:10Z DEBUG reqwest::connect] starting new connection: https://f619-96-75-30-113.ngrok-free.app/
[2025-06-10T15:12:10Z DEBUG reqwest::connect] proxy(https://ohttp.achow101.com) intercepts 'https://f619-96-75-30-113.ngrok-free.app/'
[2025-06-10T15:12:10Z DEBUG rustls::client::hs] No cached session for DnsName("ohttp.achow101.com")
[2025-06-10T15:12:10Z DEBUG rustls::client::hs] Not resuming any session
[2025-06-10T15:12:10Z DEBUG rustls::client::hs] Using ciphersuite TLS13_AES_256_GCM_SHA384
[2025-06-10T15:12:10Z DEBUG rustls::client::tls13] Not resuming
[2025-06-10T15:12:10Z DEBUG rustls::client::tls13] TLS1.3 encrypted extensions: [ServerNameAck]
[2025-06-10T15:12:10Z DEBUG rustls::client::hs] ALPN protocol is None
[2025-06-10T15:12:10Z DEBUG rustls::client::hs] No cached session for DnsName("f619-96-75-30-113.ngrok-free.app")
[2025-06-10T15:12:10Z DEBUG rustls::client::hs] Not resuming any session
[2025-06-10T15:12:11Z DEBUG rustls::client::hs] Using ciphersuite TLS13_AES_128_GCM_SHA256
[2025-06-10T15:12:11Z DEBUG rustls::client::tls13] Not resuming
[2025-06-10T15:12:11Z DEBUG rustls::client::tls13] TLS1.3 encrypted extensions: []
[2025-06-10T15:12:11Z DEBUG rustls::client::hs] ALPN protocol is None
[2025-06-10T15:12:11Z DEBUG rustls::common_state] Sending warning alert CloseNotify
[2025-06-10T15:12:11Z DEBUG rustls::common_state] Sending warning alert CloseNotify
[2025-06-10T15:12:11Z DEBUG sled::pagecache::iobuf] advancing offset within the current segment from 14406 to 15285
[2025-06-10T15:12:11Z DEBUG sled::pagecache::iobuf] wrote lsns 14406-15284 to disk at offsets 14406-15284, maxed false complete_len 879
[2025-06-10T15:12:11Z DEBUG sled::pagecache::iobuf] mark_interval(14406, 879)
[2025-06-10T15:12:11Z DEBUG sled::pagecache::iobuf] new highest interval: 14406 - 15284
[2025-06-10T15:12:11Z DEBUG sled::pagecache::iobuf] make_stable(15284) returning
Receive session established
Request Payjoin by sharing this Payjoin Uri:
bitcoin:bcrt1qpy8gqcfjplq29w5chqa5tf8345j77msnk78xvj?amount=0.0001&pj=HTTPS://F619-96-75-30-113.NGROK-FREE.APP/6H9K0QM6K9Z47%23RK1QFPV6P4KD55RKZNRCCLS37KFG4JSMA0PGNZ29AGGA7EZ6Z9GCTYDX+OH1QYP3UQPXKKXS0JFP2H5TUW930DN7KUH3UAUTHDPLYD2U7DU8M4DRXLQ+EX1EWWYJ6Q
Polling receive request...
[2025-06-10T15:12:11Z DEBUG reqwest::connect] starting new connection: https://ohttp.achow101.com/
[2025-06-10T15:12:11Z DEBUG rustls::client::hs] No cached session for DnsName("ohttp.achow101.com")
[2025-06-10T15:12:11Z DEBUG rustls::client::hs] Not resuming any session
[2025-06-10T15:12:11Z DEBUG rustls::client::hs] Using ciphersuite TLS13_AES_256_GCM_SHA384
[2025-06-10T15:12:11Z DEBUG rustls::client::tls13] Not resuming
[2025-06-10T15:12:11Z DEBUG rustls::client::tls13] TLS1.3 encrypted extensions: [ServerNameAck]
[2025-06-10T15:12:11Z DEBUG rustls::client::hs] ALPN protocol is None
[2025-06-10T15:12:11Z DEBUG rustls::common_state] Sending warning alert CloseNotify
[2025-06-10T15:12:11Z DEBUG sled::pagecache::logger] IoBufs dropped
Error: GET fallback failed

thebrandonlucas avatar Jun 10 '25 15:06 thebrandonlucas

Update: Got past this error! Turns out it wasn't ngrok, it was the fact that I did not have redis installed and running (the other error message in the payjoin-directory logs).

Now it just seems that there is an error with the size of the response that the receiver is sending to the directory. It gets all the way to trying to send the response back to the sender for broadcast via the directory. Here is the flow with the new error

Directory:

cargo run --bin payjoin-directory
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.16s
     Running `/home/blu/src/rust-payjoin/target/debug/payjoin-directory`
Logging initialized
2025-06-11T12:14:32.431606Z  INFO payjoin_directory::key_config: Loaded existing OHTTP Key Configuration from ohttp_keys/1.ikm

Receiver

cargo run --bin payjoin-cli -- receive 10000
[...]
Bootstrapping private network transport over Oblivious HTTP
Receive session established
Request Payjoin by sharing this Payjoin Uri:
bitcoin:bcrt1q0a3zwtum27vpk6hn4wdlehunpx8ae7uj8hnhx2?amount=0.0001&pj=HTTPS://F619-96-75-30-113.NGROK-FREE.APP/MCH28A8DDF3Y5%23RK1QGMF7GJF3KA3GT7TXL89XUWH6CTMSRCXAP36JRSVHVX2PLTSWXU7J+OH1QYP3UQPXKKXS0JFP2H5TUW930DN7KUH3UAUTHDPLYD2U7DU8M4DRXLQ+EX1CMZY56Q
Polling receive request...
Fallback transaction received. Consider broadcasting this to get paid if the Payjoin fails:
02000000000101678f49e3720db89ee71cd893984fe7aae72db00a68af84018d55219c51b5c2fc0000000000fdffffff0210270000000000001600147f62272f9b57981b6af3ab9bfcdf93098fdcfb925654814a000000001600143d69dc400fe308612eb1b4c02efc6d665572b16a0247304402200497a0d9c7e69d49c84eb9a9abbba6ba0fdbc8797105ece60ea669027a5bdffa02201cef1c4c01628f329427e8070f5547bee36cf2565937b71d391b6842d12823c40121027ceacb9f0a5155c0332033210afc997238e53ccae13b07ed91f5f39be0698ab600000000
Got a request from the sender. Responding with a Payjoin proposal.
Response successful. Watch mempool for successful Payjoin. TXID: 7aaef18363c2689bfc99677d7eb4af3cbfaf269992b07bb5911679aad631e0d4

Sender

cargo run --bin payjoin-cli -- send "$BIP_21" --fee-rate 2
[...]
'bitcoin:bcrt1q0a3zwtum27vpk6hn4wdlehunpx8ae7uj8hnhx2?amount=0.0001&pj=HTTPS://F619-96-75-30-113.NGROK-FREE.APP/MCH28A8DDF3Y5%23RK1QGMF7GJF3KA3GT7TXL89XUWH6CTMSRCXAP36JRSVHVX2PLTSWXU7J+OH1QYP3UQPXKKXS0JFP2H5TUW930DN7KUH3UAUTHDPLYD2U7DU8M4DRXLQ+EX1CMZY56Q' --fee-rate 2`
Bootstrapping private network transport over Oblivious HTTP
Posting Original PSBT Payload request...
Sent fallback transaction
The receiver sent an invalid response: v2 encapsulation error: Directory response error: Unexpected response size 103, expected 8192 bytes
Error: The receiver sent an invalid response: v2 encapsulation error: Directory response error: Unexpected response size 103, expected 8192 bytes

Caused by:
    Response error

thebrandonlucas avatar Jun 11 '25 12:06 thebrandonlucas

Trying to understand the motivations, wouldn't it make more sense to also run an OHTTP relay locally?

And to debug this particular issue, what happens if you bypass the OHTTP relay entirely (by setting the relay URI to be your directory's OHTTP gateway URI, i.e. HTTPS://F619-96-75-30-113.NGROK-FREE.APP/.well-known/ohttp-gateway?

We should probably improve the error reporting, since unexpected response sizes typically mean the relay is returning an error response itself instead of relaying a response from the OHTTP gateway it would make sense to at least print the status code if not the response body as well

nothingmuch avatar Jun 11 '25 14:06 nothingmuch

Trying to understand the motivations, wouldn't it make more sense to also run an OHTTP relay locally?

Motivation is ultimately just to learn how to run a Payjoin Directory (and OHTTP relay as well, for that matter) with the purpose of eventually writing up a tutorial and/or packaging it up via nix or docker or something to make these as easy as possible for people to run. Ultimate goal is to have more and more people running OHTTP relays and payjoin directories because it'll be so easy. I'm playing around with this inspired by discussion in #735: could we package up the payjoin-directory or OHTTP relay (with prometheus/grafana) such that people have something easy to run and deploy out of the box if they want to support payjoin?

I only didn't run an ohttp relay locally because I'm unsure how and didn't anticipate the complications, but I can pursue that route instead. FWIW I am running this now on a remote server and got the same error as above, so now I'm trying to find the gap in my knowledge of how the production payjoin directories are running successfully but mine isn't.

And to debug this particular issue, what happens if you bypass the OHTTP relay entirely (by setting the relay URI to be your directory's OHTTP gateway URI, i.e. HTTPS://F619-96-75-30-113.NGROK-FREE.APP/.well-known/ohttp-gateway?

Thanks for the suggestion, I'll try this when I have a moment later.

We should probably improve the error reporting, since unexpected response sizes typically mean the relay is returning an error response itself instead of relaying a response from the OHTTP gateway it would make sense to at least print the status code if not the response body as well

Agreed, I notice RUST_LOG=debug has no effect on payjoin-directory unlike with payjoin-cli.

thebrandonlucas avatar Jun 11 '25 15:06 thebrandonlucas

And to debug this particular issue, what happens if you bypass the OHTTP relay entirely ... Thanks for the suggestion, I'll try this when I have a moment later.

This is a useful debugging tidbit FWIW, the response body received by the relay is just sent as is to the directory, but it should probably come with a warning to be extra sure that real requests definitely go through the relay or privacy falls apart

Agreed, I notice RUST_LOG=debug has no effect on payjoin-directory unlike with payjoin-cli.

It has a few trace logs, but i don't think the sender is reaching the directory, if it generates an error response it would still be 8192 bytes when encapsulated

nothingmuch avatar Jun 11 '25 15:06 nothingmuch

@nothingmuch Okay updates after playing around a bit more:

And to debug this particular issue, what happens if you bypass the OHTTP relay entirely (by setting the relay URI to be your directory's OHTTP gateway URI, i.e. HTTPS://F619-96-75-30-113.NGROK-FREE.APP/.well-known/ohttp-gateway?

Sorry I'm not 100% sure what you mean here, did you mean literally pass HTTPS://F619-96-75-30-113.NGROK-FREE.APP/.well-known/ohttp-gateway as the ohttp_relays param to payjoin-cli's config.toml?

e.g. ohttp_relays = ["HTTPS://F619-96-75-30-113.NGROK-FREE.APP/.well-known/ohttp-gateway"]

If so, I did that, and also tried just HTTPS://F619-96-75-30-113.NGROK-FREE.APP. Both resulted in:

Bootstrapping private network transport over Oblivious HTTP
Error: No valid relays available

I also took your suggestion to run ohttp-relay locally. I can now reliably reproduce everything with everything running locally.

With this in both my receiver and sender config.toml:

[...]
pj_directory = "https://payjo.in"
ohttp_relays = ["http://0.0.0.0:3001"]

A payjoin succeeds. If I change it to this however, I can reproduce the errors as before:

[...]
pj_directory = "https://ca5b-23-234-119-185.ngrok-free.app"
ohttp_relays = ["http://0.0.0.0:3001"]

Receiver run:

cargo run --bin payjoin-cli -- receive 10000
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.11s
     Running `/home/blu/src/rust-payjoin/target/debug/payjoin-cli receive 10000`
Bootstrapping private network transport over Oblivious HTTP
Receive session established
Request Payjoin by sharing this Payjoin Uri:
bitcoin:bcrt1qehwd34pnnxlt5l6ptzsc50h7p4meyelcxpff74?amount=0.0001&pj=HTTPS://CA5B-23-234-119-185.NGROK-FREE.APP/CYZ9PU6JK2QZ6%23RK1QDKE6RUUUPG9EVMGNW658XH4HSLRLY2LW7XDXU69PWQ7989STLR3K+OH1QYPPYHH4F9UJUNDU3WRTDAZ4RHH8QN9RXSPHLSK3QDAS2AGH5QYU98C+EX13ESYK6Q
Polling receive request...
Fallback transaction received. Consider broadcasting this to get paid if the Payjoin fails:
020000000001012ce9dc4e3d0db427d731e55b8a06a5d11dd1315b5eaa311b1f1b245203396f5c0000000000fdffffff021027000000000000160014cddcd8d43399beba7f4158a18a3efe0d779267f85654814a00000000160014846b54d591cb4804881293d6386aa7548350bfd40247304402201e60b09a4a99c8d91fadee2aed13c07daeddebf12c0ee7037d9072c543b332b5022045b6713c9ec86003bd6b45273ad3f95564dc11dd8e26a1409159308792b24cea0121027ceacb9f0a5155c0332033210afc997238e53ccae13b07ed91f5f39be0698ab600000000
Got a request from the sender. Responding with a Payjoin proposal.
Response successful. Watch mempool for successful Payjoin. TXID: aa1bcc7bff5b050abe6281dd4ee910c8e62fc49997e7e6b35e7162903d064c04

Sender run:

cargo run --bin payjoin-cli -- send "$BIP_21" --fee-rate 2
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.10s
     Running `/home/blu/src/rust-payjoin/target/debug/payjoin-cli send 'bitcoin:bcrt1qehwd34pnnxlt5l6ptzsc50h7p4meyelcxpff74?amount=0.0001&pj=HTTPS://CA5B-23-234-119-185.NGROK-FREE.APP/CYZ9PU6JK2QZ6%23RK1QDKE6RUUUPG9EVMGNW658XH4HSLRLY2LW7XDXU69PWQ7989STLR3K+OH1QYPPYHH4F9UJUNDU3WRTDAZ4RHH8QN9RXSPHLSK3QDAS2AGH5QYU98C+EX13ESYK6Q' --fee-rate 2`
Bootstrapping private network transport over Oblivious HTTP
Posting Original PSBT Payload request...
Sent fallback transaction
The receiver sent an invalid response: v2 encapsulation error: Directory response error: Unexpected response size 103, expected 8192 bytes
Error: The receiver sent an invalid response: v2 encapsulation error: Directory response error: Unexpected response size 103, expected 8192 bytes

Caused by:
    Response error

Thus far I had been trying everything on latest master (aad4c0f71dda7811e9abed20f1012febf834a567), but I figured I should switch to the latest release version relevant to payjoin-directory (8456a6a0effe50eefffe357dcb674fe29b31f597, or payjoin-directory-0.0.2). Same error as above. I am curious what commit/release the payjo.in directory is running on and what differences there may be with how I'm running this, or if it is simply running on a different version where this works.

thebrandonlucas avatar Jun 11 '25 23:06 thebrandonlucas