Search on TFTC
How to Set Up Payjoin and CoinJoin in BTCPay Server

How to Set Up Payjoin and CoinJoin in BTCPay Server

Jan 9, 2024

How to Set Up Payjoin and CoinJoin in BTCPay Server


This guide is based on Uncle Rockstar's video explaining how to enable and utilize Payjoin and CoinJoin functionalities in BTCPay Server. It's aimed at Bitcoin users who wish to increase the privacy of their transactions when withdrawing coins from exchanges or for other purposes.

Before proceeding, it is important to note that you should have a basic understanding of what CoinJoin is. If you are new to the concept, Uncle Rockstar recommends checking out resources such as the CoinJoin page on Bitcoin Wiki, Nopara's coin control article, and other educational content available online.

Understanding Bitcoin Privacy: A Comprehensive Guide
Bitcoin was created with a strong ethos of transparency, allowing users to verify system integrity independently. However, the transparent nature of the Bitcoin protocol does not preclude users from maintaining financial privacy.


Before you start the setup process, ensure that you have an instance of BTCPay Server set up and running. If you need guidance on setting up your instance, refer to Uncle Rockstar's previous videos or the BTCPay Server documentation.

Setting Up Your Store for Payjoin and CoinJoin

  1. Creating a Store:
    • Navigate to the BTCPay Server dashboard.
    • Select the option to "Create a New Store."
  2. Installing the CoinJoin Plugin:
    • Ensure that you have the CoinJoin plugin installed. This plugin is developed by Kuks, who is credited for the creation of most of the code used in this guide.
    • If you do not have the plugin installed, find it in the plugin list and install it.
  3. Creating a New Wallet:
    • Go to the option to "Create a New Wallet" within your store settings.
    • Choose to create a "Hot Wallet" to enable Payjoin by default.
    • Write down your recovery phrase. Note that Uncle Rockstar demonstrates this process with a testnet, meaning the coins have no real value.
  4. Setting Up CoinJoins:
    • Navigate to the "Dashboard" and select "CoinJoins."
    • If CoinJoins are not already set up, follow the prompts to get more information and continue the setup.
    • Select a CoinJoin coordinator from the available options. You can choose multiple coordinators, but for simplicity, select one for now and click "Save."
  5. Receiving and Sending Transactions:
    • To receive coins to your wallet, go to "Bitcoin" and click "Receive" to generate the next available address.
    • For withdrawing or sending coins, create a "Point of Sale" app in your store for more convenient address generation.
    • Use the generated URL on your phone or other devices to create payment requests with fresh addresses each time.

Performing a Payjoin Transaction

  1. Initiating a Payjoin Transaction:
    • Ensure the wallet you are sending from supports Payjoin.
    • Use a BIP21 URI with a "PJ" query string parameter to initiate a Payjoin transaction.
  2. Sending the Payjoin Transaction:
    • Paste the BIP21 URI into the wallet that supports Payjoin.
    • Fill in the transaction details.
    • Sign and broadcast the transaction, ensuring that it is recognized as a Payjoin transaction by the inclusion of different outputs and varying bitcoin amounts.

Additional Settings and Considerations

  1. Moving Bitcoin to Cold Storage:
    • After mixing is complete, you may want to transfer your Bitcoin to cold storage for added security.
    • Create another store with a wallet using the xpub from your hardware wallet.
    • Configure the settings to send coins to this new wallet once a privacy target is reached.
  2. Adjusting CoinJoin Settings:
    • Access the "Scientist Mode" for advanced settings.
    • Set parameters such as "Only CoinJoin if Mining Fees Below Median" and "Minimum Denomination of Sats."
    • Use the "Send to Other Wallet" feature to direct coins to your cold storage store.
  3. Running Your Own Coordinator:
    • For advanced users, there are options to run your own CoinJoin coordinator.
    • Set fees and thresholds for your coordinator and use tools like Nostr for coordination discovery.


Uncle Rockstar's video emphasizes the ease of setting up Payjoin and CoinJoin in BTCPay Server, encouraging users to take advantage of these privacy-enhancing technologies. If you encounter any issues or have questions, you can reach out to Uncle Rockstar via Twitter or the video's comment section for assistance.

Lastly, don't let the ongoing debates about Bitcoin's scalability distract you from maintaining your privacy. Utilize the available technologies like Payjoin and CoinJoin, and enjoy the enhanced privacy of your Bitcoin transactions.


Current Block Height

Current Mempool Size

Current Difficulty