`payjoin-cli` Bug: `Error: Replied With Error: The Receiver Rejected The Original PSBT.` With Default Values

by ADMIN 109 views

Introduction

In this article, we will explore a bug in the payjoin-cli tool, specifically the error Error: Replied with error: The receiver rejected the original PSBT. when using default values. We will examine the receiver flow and sender flow to understand the issue and provide a solution.

Receiver Flow

The receiver flow is initiated by running the following command:

RUST_LOG=DEBUG ./payjoin-cli -r "http://localhost:18443/wallet/sender" --rpcuser "admin1" --rpcpassword "123" --ohttp-relay "https://pj.bobspacebkk.com" receive 10000

This command sets up the receiver flow with the following parameters:

  • http://localhost:18443/wallet/sender as the RPC endpoint for the sender
  • admin1 as the RPC user
  • 123 as the RPC password
  • https://pj.bobspacebkk.com as the Oblivious HTTP (OHTTP) relay
  • 10000 as the amount to receive

The receiver flow logs the following output:

[2025-05-14T12:20:11Z 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/sender", query: None, fragment: None }, cookie: None, rpcuser: "admin1", rpcpassword: "123" }, version: Some(V2(V2Config { ohttp_keys: None, ohttp_relay: Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("pj.bobspacebkk.com")), port: None, path: "/", query: None, fragment: None }, pj_directory: Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("payjo.in")), port: None, path: "/", query: None, fragment: None } })) }

This output indicates that the receiver flow is set up with the specified parameters.

Sender Flow

The sender flow is initiated by running the following command:

set BIP_21 "bitcoin:bcrt1qfvftxa00dtf6wmqqeupfkdx7chak2m70ettvj2?amount=0.0001&pj=HTTPS://PAYJO.IN/MXW9JNVE6ZTKZ%23RK1QW6AF5Z9X9A5KTK5T7DSTG37QDENJA9FS5259YGRUJZTLN6PL7LD2+OH1QYP87E2AVMDKXDTU6R25WCPQ5ZUF02XHNPA65JMD8ZA2W4YRQN6UUWG+EX1LHDJ26Q"

This command sets up the sender flow with the following parameters:

  • bitcoin:bc1qfvftxa00dtf6wmqqeupfkdx7chak2m70ettvj2?amount=0.0001&pj=HTTPS://PAYJO.IN/MXW9JNVE6ZTKZ%23RK1QW6AF5Z9X9A5KTK5T7DSTG37QDENJA9FS5259YGRUJZTLN6PL7LD2+OH1QYP87E2AVMDKXDTU6R25WCPQ5ZUF02XHNPA65JMD8ZA2W4YRQN6UUWG+EX1LHDJ26Q as the BIP 21 URI

The sender flow logs the following output:

~/.cargo/bin/payjoin-cli -r "http://localhost:18443/wallet/sender" --rpcuser "admin1" --rpcpassword "123" --ohttp-relay "https://pj.bobspacebkk.com" send $BIP_21 --fee-rate 1
Posting Original PSBT Payload request...
Sent fallback transaction
No response yet.
No response yet.
No response yet.

This output indicates that the sender flow is set up with the specified parameters and is waiting for a response from the receiver flow.

Error: Replied with error: The receiver rejected the original PSBT.

The error Error: Replied with error: The receiver rejected the original PSBT. occurs when the receiver flow rejects the original PSBT sent by the sender flow. This error is caused by the receiver flow not being able to process the PSBT due to some reason.

Solution

To solve this issue, we need to investigate why the receiver flow is rejecting the original PSBT. We can do this by examining the receiver flow logs and looking for any errors or warnings that may indicate the cause of the issue.

One possible cause of this issue is that the receiver flow is not able to process the PSBT due to some reason. This could be due to a bug in the receiver flow code or due to some issue with the PSBT itself.

To fix this issue, we need to identify the cause of the problem and make the necessary changes to the receiver flow code to fix it.

Conclusion

In this article, we explored a bug in the payjoin-cli tool, specifically the error Error: Replied with error: The receiver rejected the original PSBT. when using default values. We examined the receiver flow and sender flow to understand the issue and provided a solution.

The error Error: Replied with error: The receiver rejected the original PSBT. occurs when the receiver flow rejects the original PSBT sent by the sender flow. This error is caused by the receiver flow not being able to process the PSBT due to some reason.

To solve this issue, we need to investigate why the receiver flow is rejecting the original PSBT and make the necessary changes to the receiver flow code to fix it.

Future Work

In the future, we plan to continue investigating this issue and making changes to the receiver flow code to fix it. We also plan to add more logging and debugging statements to the receiver flow code to help identify the cause of the issue.

References

  • payjoin-cli README
  • payjoin-cli source code

Acknowledgments

Introduction

In our previous article, we explored a bug in the payjoin-cli tool, specifically the error Error: Replied with error: The receiver rejected the original PSBT. when using default values. We examined the receiver flow and sender flow to understand the issue and provided a solution.

In this article, we will provide a Q&A section to answer some common questions related to this issue.

Q: What is the cause of the Error: Replied with error: The receiver rejected the original PSBT. error?

A: The Error: Replied with error: The receiver rejected the original PSBT. error occurs when the receiver flow rejects the original PSBT sent by the sender flow. This error is caused by the receiver flow not being able to process the PSBT due to some reason.

Q: Why is the receiver flow rejecting the original PSBT?

A: The receiver flow is rejecting the original PSBT due to some reason. This could be due to a bug in the receiver flow code or due to some issue with the PSBT itself.

Q: How can I fix the Error: Replied with error: The receiver rejected the original PSBT. error?

A: To fix the Error: Replied with error: The receiver rejected the original PSBT. error, you need to investigate why the receiver flow is rejecting the original PSBT and make the necessary changes to the receiver flow code to fix it.

Q: What are some common causes of the Error: Replied with error: The receiver rejected the original PSBT. error?

A: Some common causes of the Error: Replied with error: The receiver rejected the original PSBT. error include:

  • Bug in the receiver flow code
  • Issue with the PSBT itself
  • Problem with the receiver flow configuration

Q: How can I prevent the Error: Replied with error: The receiver rejected the original PSBT. error from occurring?

A: To prevent the Error: Replied with error: The receiver rejected the original PSBT. error from occurring, you can:

  • Make sure the receiver flow code is up-to-date and free of bugs
  • Verify that the PSBT is correct and complete
  • Ensure that the receiver flow configuration is correct and complete

Q: What are some best practices for debugging the Error: Replied with error: The receiver rejected the original PSBT. error?

A: Some best practices for debugging the Error: Replied with error: The receiver rejected the original PSBT. error include:

  • Enable logging and debugging statements in the receiver flow code
  • Use a debugger to step through the receiver flow code and identify the cause of the error
  • Verify that the PSBT is correct and complete

Conclusion

In this article, we provided a Q&A section to answer some common questions related to the Error: Replied with error: The receiver rejected the original PSBT. error. We hope that this Q&A section has been helpful in understanding the cause of the error and how to fix it.

Future Work

In the future, we plan to continue investigating this issue and making changes to the receiver flow code to fix it. We also plan to add more logging and debugging statements to the receiver flow code to help identify the cause of the issue.

References

  • payjoin-cli README
  • payjoin-cli source code

Acknowledgments

We would like to thank the payjoin-cli developers for their help and support in investigating this issue. We would also like to thank the Bitcoin community for their contributions to the development of the payjoin-cli tool.