A BTCPay Server plugin that enables merchants to accept Firo payments using Spark addresses.
- Spark Address per Invoice: Generates a unique Spark address for each invoice/payment request
- Privacy: Accepts payments from both Spark-to-Spark spends and transparent-to-Spark mints
- Multi-transaction Support: Tracks partial payments across multiple transactions to the same Spark address
- Confirmation Tracking: Configurable confirmation thresholds with speed policy support
- Real-time Detection: Supports block and transaction notifications via HTTP callbacks
- BTCPay Server >= 2.1.0
- Firo daemon (firod) with wallet enabled and Spark support
- .NET 8.0 SDK (for building)
Set the following environment variables for BTCPay Server:
| Variable | Description | Required |
|---|---|---|
BTCPAY_FIRO_DAEMON_URI |
Firo daemon RPC endpoint (e.g., http://localhost:8888) |
Yes |
BTCPAY_FIRO_DAEMON_USERNAME |
RPC username | No |
BTCPAY_FIRO_DAEMON_PASSWORD |
RPC password | No |
Add the following to your firo.conf to enable real-time payment notifications:
# RPC settings
server=1
rpcuser=yourusername
rpcpassword=yourpassword
rpcport=8888
rpcallowip=127.0.0.1
# Notification callbacks to BTCPay Server
blocknotify=curl -s http://your-btcpay-server/FiroLikeDaemonCallback/block?hash=%s&cryptoCode=FIRO
walletnotify=curl -s http://your-btcpay-server/FiroLikeDaemonCallback/tx?hash=%s&cryptoCode=FIROgit submodule update --init --recursive
dotnet buildThis plugin follows the same architecture as the Monero BTCPay plugin, adapted for Firo's Bitcoin-style JSON-RPC and Spark privacy protocol.
Invoice Creation:
- Calls
getnewsparkaddressto generate a unique Spark address - Calls
getallsparkaddressesto determine the diversifier (address index) for tracking - Stores address + diversifier in the invoice payment details
Payment Detection:
- Block/transaction notifications trigger payment checking
- Calls
listsparkmintsto get all Spark mints in the wallet - Matches mint diversifiers to tracked invoice diversifiers
- Calls
gettransactionfor each matching mint to get confirmation counts - Creates/updates payment entities in BTCPay Server
Health Monitoring:
- Periodically polls
getblockchaininfofor sync status - Checks wallet availability via
getwalletinfo
| Command | Purpose |
|---|---|
getnewsparkaddress |
Generate new Spark address per invoice |
getallsparkaddresses |
Map addresses to diversifiers |
listsparkmints |
List all Spark mints for payment matching |
gettransaction |
Get transaction confirmation count |
getblockchaininfo |
Check daemon sync status |
getwalletinfo |
Check wallet availability |
estimatesmartfee |
Estimate transaction fees |
MIT