Skip to content

Add Payjoin support #149

Open
Open

Description

@notmandatory

Description

Implement (optional) BIP-0078 PayJoin support in the bdk-cli wallet using the rust bip78 project. PayJoin transactions provides a way to collaboratively create a transaction with a receiver in a way that prevents on-chain surveillance from using the common input ownership heuristic. Adding this feature to the bdk-cli project will demonstrate to other wallet builders using bdk how to add PayJoin support.

Expected Outcomes

  • Integrate BIP-0078 functionality as an optional feature in bdk-cli using the rust bip78 crate
  • Contribute upstream to the rust bip78 project if any bugs or other issues are found
  • Document how to use new PayJoin functionality with bdk-cli and common services such as BTCPayServer

Resources

Skills Required

  • Rust language development, or similar language with willingness to learn rust
  • Be able to send and receive bitcoin transactions on testnet with bdk-cli and other wallets
  • Basic understanding bitcoin transaction building

Mentor(s)
@notmandatory

Difficulty
Hard

Competency Test

  • Install rust
  • Clone and run bdk-cli, create single signature descriptor wallet, receive and send testnet bitcoin
  • Demonstrate rust coding skill:
    • via simple rust program
    • OR by completing rustlings exercises: variables, functions, if, primitive types

Activity

  1. changed the title [-]Support payjoin[/-] [+]Payjoin[/+] on Jul 27, 2020
  2. self-assigned this
    on Mar 3, 2022
  3. changed the title [-]Payjoin[/-] [+]Add Payjoin support[/+] on Mar 9, 2023
  4. notmandatory commented on Mar 9, 2023

    @notmandatory
    ContributorAuthor

    Moving this to bdk-cli since this doesn't need to be part of the core bdk library, but still useful to have an example using bdk in the bdk-cli tool.

  5. added
    summer-of-bitcoin
    on Mar 9, 2023
  6. DanGould commented on Mar 10, 2023

    @DanGould

    Could this be reviewed in separate send / receive portions? There is a CLI tool based on the bip78, actively maintained payjoin crate that would be straightforward to add to bdk-cli at this point.

  7. notmandatory commented on Mar 11, 2023

    @notmandatory
    ContributorAuthor

    Hi yes since this will be done by a summer of bitcoin student new to rust and bitcoin I'd like the idea of focusing on an easy win of adding send first. Then we can separately work on the receive side, and/or work on any open issues in the bip78 crate or the payjoin bin.

  8. DanGould commented on Mar 21, 2023

    @DanGould

    To get started on a sender CLI integration, check out this bitcoind payjoin-client cli based using the payjoin crate and this bdk + payjoin sender that's working in wasm at https://bitmask.app

  9. moved this to In Progress in Payjoin Roadmap 📝on Apr 2, 2023
  10. rajarshimaitra commented on Apr 13, 2023

    @rajarshimaitra
    Contributor

    Thanks @DanGould for the pointer to the new payjoin repo.

    @notmandatory I think we should update the description to refer to https://github.com/payjoin/rust-payjoin, as that seemed more current.

    I went through the payjoin-client briefly, and it seems the send and recv logic is already there. The payjoin sending and receiving should be more involved than regular send/recv as it requires interaction with the sender. So makes sense to add a new send function.

    This can be done as a separate send_payjoin and recv_payjoin function which takes in a bip21 URL and follows the logic of payjoin-client of the reference crate.

    We can then feature gate it under a new payjoin feature and optional dependency on rust-payjoin.

    This could be an extensive but achievable project for SOB. Pretty excited for this one. 😃

  11. DanGould commented on Apr 13, 2023

    @DanGould
  12. 10 remaining items

  13. DanGould commented on Jun 6, 2023

    @DanGould

    A look at Bitcoin Design Guide's case study might lend some inspiration. BlueWallet requires a bip21 to initiate a send no matter what and then prompts to confirm / change the amount. That user story could apply here as well.

    I think Signal is an application design success story, so I find their contributing guidelines/development idology compelling. The first truth they find self evident is

    The answer is not more options. If you feel compelled to add a preference that's exposed to the user, it's very possible you've made a wrong turn somewhere.

    Reading in the required bip21 amount otherwise prompting seems to align with this philosophy.

  14. notmandatory commented on Jun 7, 2023

    @notmandatory
    ContributorAuthor

    @willowenss API looks good, but I agree with @DanGould we shouldn't need a required --amount option. Another way to handle confirmation in the case you don't want to be prompted is to have an optional -y option that skips the user confirmation prompt about the amount, without that option it would require the user to confirm.

    This is how an option like that is documented for the apt-get command:

    -y, --yes, --assume-yes
               Automatic yes to prompts; assume "yes" as answer to all prompts and run non-interactively.
    

    EDIT: But for now no need for a -y option, can add it later if needed, best to keep it simple if we can.

  15. moved this from In Progress to Todo in Payjoin Roadmap 📝on Apr 11, 2025
  16. moved this from Todo to Backlog in Payjoin Roadmap 📝on Apr 11, 2025
  17. moved this from Backlog to Blocked in Payjoin Roadmap 📝on Apr 11, 2025
  18. moved this from Blocked to Todo in Payjoin Roadmap 📝on Apr 13, 2025
  19. moved this from Todo to In Progress in Payjoin Roadmap 📝on Apr 13, 2025
  20. moved this to In Progress in BDK-CLIon May 28, 2025
  21. added
    enhancement
    and removed
    summer-of-bitcoin
    on May 28, 2025
  22. spacebear21 commented on Jan 5, 2026

    @spacebear21

    #200 addressed this, though it would be nice to follow up with a persistence integration for true async payjoin support.

  23. added this to the CLI 4.0.0 milestone on May 6, 2026
  24. added a commit that references this issue on Jul 2, 2026
  25. removed this from the CLI 4.0.0 milestone on Jul 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancement

Type

No type

Projects

  • Status
    In Progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions