All providers

Bitcoin

Learn how to self-host Bitcoin. Run the node, accept Bitcoin payments, no middle man... not even us. This guide takes the easy road, with the Bitcoin Core app and a ready-made server.

What you need

FieldWhat it does
Mint endpoint URLYour server's public address-minting route. We call it to get a fresh address for each order. Not secret.
Webhook secretA shared secret your server signs with and we verify. It can never touch your wallet. Secret.

Self-hosting means running a blockchain on your own computer or server. It's the most secure way to take crypto payments. On your own computer you run the Bitcoin Core app, a ready-made server, and a public address tool. This guide walks through all of it on a Mac. If you would rather not run anything, connect a hosted crypto service instead.

Money flow

Money

  1. Buyer

    Taps your Coin Moebius Buy Button and pays from their own wallet.

  2. Your product page

    Your Coin Moebius Buy Button asks Coin Moebius to start a checkout.

  3. Coin Moebius Messages only

    Gets a fresh address from your server and shows it to the buyer.

  4. Blockchain

    Carries the coins from the buyer straight to you.

    • Monero
    • Zano
    • Freedom Dollar
    • Bitcoin
    • Bitcoin Cash
  5. Your wallet

    Receives the coins.

  6. Your server

    Sees the payment land in your wallet and tells Coin Moebius the sale is paid. Your keys and balance never leave your server.

    Coin Moebius dashboardSale shows as paid.
  • No buyer data

    Card numbers never reach us. Buyer names, addresses and contact details are stripped before a sale is saved.

  • No cut of your sales

    You pay a flat plan price. We never take a percentage of what you sell.

Why we ask for each field

Mint endpoint URL

When a buyer clicks Buy, we ask your server for a fresh address to show them. That request goes to this one public route. It hands back an address and nothing else; your wallet stays private behind it.

Webhook secret

Your server sends us a signed message whenever the chain tells it something new about an order. Paid is only one of the things it can say. It also reports money that has arrived and is still settling, an amount that came up short, and an order that expired with nothing sent. This shared secret lets us confirm the message really came from your server, so nobody can forge one. It can read nothing and move nothing.

Set up

  1. Get the Bitcoin Core app and Node.js

    Two free downloads. Get both now.

    1. Bitcoin Core, from bitcoincore.org. This is your node and your wallet in one app.
    2. Node.js (the green LTS button at nodejs.org). This runs the small server that hands out addresses.
    Download Bitcoin Core
  2. Make your two secret codes

    Bitcoin needs two, because Bitcoin Core will not answer other programs without a password of its own. Run the command below twice and keep both. Label them as you go, because they look identical.

    openssl rand -hex 32
    SecretWhat it does
    Node passwordThe password programs must show before your node answers them. It goes into the settings file in step 3, and into the server in step 7. It never touches the dashboard.
    Webhook secretSigns every message your server sends us about an order, so we know each one really came from you. It goes into the server in step 7 and into the dashboard in step 9, and it has to be the same in both.

    You can click Generate in the dashboard for the webhook secret instead of running this, then use that value. On Windows, run this in Git Bash, which comes with Git for Windows.

  3. Set up the Bitcoin Core app

    Open Bitcoin Core. The first time, it asks where to keep its data. Leave the folder as it is and make sure Limit block chain storage is ticked, so it keeps only the newest blocks. Then click OK.

    1. On a Mac, open the Bitcoin Core menu and choose Preferences. On Windows, open Settings, then Options. Then click Open Configuration File.
    2. Paste the lines below into the file. Put your node password from step 2 after rpcpassword=.
    3. Save the file, quit Bitcoin Core, and open it again.

    Paste into the settings file

    server=1
    rpcbind=127.0.0.1
    rpcallowip=127.0.0.1
    rpcuser=shop
    rpcpassword=YOUR-NODE-PASSWORD

    server=1 lets the server on this computer ask your node questions. The two 127.0.0.1 lines mean only programs on this same computer can talk to it. Leave them that way.

    Keep Limit block chain storage ticked
    Open the settings file

    The first start takes a long time, because the node checks every block since 2009. The bar at the bottom of the window shows how far along it is. You can do steps 4 through 8 while it works, but your first payment has to wait until it catches up. Leave Bitcoin Core open.

  4. Make your wallet

    Make the wallet that holds your money. Then back it up.

    1. Open File, then Create Wallet. Name it keys, tick Encrypt Wallet, and click Create.
    2. Set a password, write it down, and confirm when it warns you about losing it.
    3. Open File, then Backup Wallet, and save the backup somewhere that is not this computer, like a USB stick you keep safe. That backup is the only key to your money.
    Create your wallet
  5. Make a look-but-do-not-spend copy

    Bitcoin Core can make a second wallet that sees every payment and hands out addresses, but cannot send a coin anywhere. Bitcoin calls it a watch-only wallet. That copy is the one your server uses, so the program facing the internet never holds a key that can spend.

    1. Open Window, then Console, and run the first command below. When more than one wallet is open, a Wallet list shows at the top; pick keys there first.
    2. Find the entry whose desc starts with wpkh( and that says "internal": false. Copy the whole desc value, the part after # included, without the quotes around it. It holds only your public key.
    3. Open File, then Create Wallet. Name it shop, tick Disable Private Keys, and click Create.
    4. Back in the Console, pick shop from the Wallet list at the top, then run the second command below with your copied line in place of YOUR-LINE.

    1. With keys picked, show your public key

    listdescriptors

    2. With shop picked, give it your public key

    importdescriptors '[{"desc": "YOUR-LINE", "active": true, "range": [0, 999], "timestamp": "now"}]'

    It answers with "success": true. The server looks for a wallet named shop, so keep that name.

    Copy the wpkh line
    Make the shop wallet
    Give the shop wallet your public key

    For real money, make the keys wallet on a different computer and bring only the copied line to this one.

  6. Make your store and copy the id

    Sign in to the dashboard, make a store, and open its Settings. Copy the Store id. It starts with proj_, and the server calls it your project id. You use it when you start the server.

    Copy your Store id
  7. Download and start the server

    A ready-made server hands out an address for each sale and watches for the money. You do not edit it. Run these one at a time, in the same Terminal window.

    1. Make a folder for it

    mkdir ~/Desktop/coinmoebius-bitcoin

    2. Go into that folder

    cd ~/Desktop/coinmoebius-bitcoin

    Everything after this runs inside that folder, so keep using this same window.

    3. Download the server

    curl -fsSL https://www.coinmoebius.com/tools/bitcoin-server.mjs -o bitcoin-server.mjs

    4. Start a package file

    npm init -y

    5. Install the two packages

    npm install @aquarian-metals/coin-moebius-bitcoin @aquarian-metals/coin-moebius-server

    This one takes a few seconds and prints a line about how many packages it added.

    6. Start the server

    node bitcoin-server.mjs

    The first run asks four questions: your project id, your webhook secret, the rpcuser from your settings file, and your node password. The two secrets show as stars. It saves all four next to the file, so it only asks once. From then on this is the only line you run. Because the answers stick, moving this server to a different project later means editing them: open coin-moebius-bitcoin.json, change the project id, and start it again. Delete that file instead and it asks all four from scratch. On startup it prints the project it is reporting to, so you can see which one it is using.

    Get the ready-made server
    It asks four questions, then runs
    Need a different port, or pointing it somewhere else?

    The server listens on 8787 and reports payments to coinmoebius.com. Two settings change that, and you put them in front of the start command. Set either one on its own, or both together.

    Listen on a different port

    PORT=9100 node bitcoin-server.mjs

    Use this when something else already has 8787. Point ngrok at the same number you choose, so ngrok http 9100 for this example.

    Report to a different Coin Moebius

    COIN_MOEBIUS_API=http://127.0.0.1:8787 node bitcoin-server.mjs

    Only if you are running Coin Moebius yourself. Your project id has to exist in whichever one you point at, or the payment arrives on the chain with nowhere to land.

    Both at once

    PORT=8788 COIN_MOEBIUS_API=http://127.0.0.1:8787 node bitcoin-server.mjs

    This is the usual shape when you run Coin Moebius locally, because a local Coin Moebius already holds 8787.

    The server prints its port and the address it will report to every time it starts, so you can see at a glance which settings took.

  8. Put your server online

    Your server needs a public web address so we can reach it. A free tool called ngrok makes one.

    1. Make a free account at ngrok.com.
    2. Install it. On a Mac, brew install ngrok is the quickest. On Windows, choco install ngrok, or download it from ngrok.com and unzip it.
    3. Add your authtoken (ngrok shows the exact line on its setup page).
    4. Run the command below, then copy the https address it shows next to Forwarding.
    ngrok http 8787
    Copy the ngrok Forwarding address

    If you downloaded ngrok into a folder instead of installing it, run it from there as ./ngrok http 8787. Your free ngrok address stays the same every time you start ngrok, so you only paste it into the dashboard once.

  9. Connect in the dashboard

    Open Providers, click Connect a provider, then search for Bitcoin and pick it. Paste two things and save.

    1. Your Bitcoin server address: your ngrok address with /coin-moebius/bitcoin/mint added to the end.
    2. Shared secret: the webhook secret from step 2.
    Search and pick Bitcoin
    Paste the address and the secret

    When you save, we quietly check that we can reach your server. Bitcoin Core, your server, and ngrok all need to be running.

  10. Add the buy button to your page

    Make a product in the dashboard, then copy its buy button code onto your page. These two pieces go in two different places, so they are separate.

    Near the bottom of the page, just before the closing body tag

    <script src="https://sdk.coinmoebius.com/latest/sdk.global.js" crossorigin="anonymous" defer></script>

    One line, once per page, no matter how many buttons that page has.

    Wherever you want the button to appear

    <coin-moebius-buy
      project-id="proj_yourprojectid"
      product-id="your-product"
      amount="59.99"
      currency="USD"
      label="Buy now">
    </coin-moebius-buy>

    Swap in your own project id and product id from the dashboard.

  11. Take your first payment

    There is no sandbox for a self-hosted setup, so a small real payment is the test. Keep all three windows running (Bitcoin Core, server, ngrok).

    1. Open your page, click Buy, and pick Bitcoin. The window shows an address, a QR code, and the amount.
    2. Send that exact amount from any Bitcoin wallet.
    3. Wait for a confirmation. Bitcoin makes a new block about every ten minutes and we wait for one, so give it around ten minutes. A payment sent with a low fee can wait longer. The window keeps checking the whole time.
    4. When it shows the payment is complete, your whole setup is working end to end.
    The buy window shows the address
    The payment is complete

After you connect

Your first real payment is the test, and the step above walks through it. Here is what to check while it settles. Keep all three windows running: Bitcoin Core, the server, and ngrok.

  1. After you pay, the buy window keeps checking on its own. Your buyer never has to refresh.
  2. Bitcoin takes about ten minutes to confirm.
  3. Open the Transactions tab in the dashboard. When the new row reaches succeeded, your whole setup is working end to end.

Troubleshooting

Checkout fails right away.

We could not reach your server. Make sure all three windows are running, and that the mint endpoint URL in the dashboard is your ngrok address with /coin-moebius/bitcoin/mint on the end.

The server says your node rejected the user name or password.

The rpcuser and node password the server saved must match rpcuser and rpcpassword in your settings file. Fix them in coin-moebius-bitcoin.json and start the server again.

The server says it cannot reach your Bitcoin node.

Bitcoin Core is closed, or server=1 is missing from its settings file. Open the app, check the file, and restart the app if you changed it.

The server says your node has no wallet named shop open.

In Bitcoin Core, open File, then Open Wallet, and pick shop.

The buyer paid but the order still says pending.

That is normal while the payment confirms. Once the money is on the chain the buy window says the payment was received and is waiting on the network, and it turns into paid at one block, about ten minutes after it lands.

It still says pending after an hour.

Either the server is not running, its secret does not match, or Bitcoin Core has not caught up yet. Confirm the server is up, that the webhook secret you typed matches the one in the dashboard, and that the bar at the bottom of Bitcoin Core is gone.

Money arrived but the order reads short.

The buyer sent less than the amount shown. The order is marked partial, and the dashboard shows how much arrived.

Good to know

Run it on a computer that stays on. The test runs on your own computer. For an everyday store, run the same parts on a computer that stays on all the time, with a fixed web address.

Downtime is cheap. The server catches up after an outage and reports the payments it missed. Nothing is lost, so a home computer is fine.

Keep a watch-only wallet for real money. Step 5 makes a copy that can see payments but not send them. Use that copy on the computer that faces the internet and keep your real wallet somewhere else.

Rotating the secret. Make a new webhook secret anytime, then use it in both the server and the dashboard.

Questions? Join our Discord

Ready to connect a provider?

Pick the providers you already use. Buyers pay through your accounts, and you keep one buy button.