This plugin enables quick setup for receiving funds from your BTCPay Server store directly to your self-custodial mobile wallet using the SamRock Protocol.
- Install the plugin by navigating to your BTCPay Server > Server Settings > Plugins, find "SamRock Protocol" in Available Plugins, install it, and restart your server. a. Ensure that the Boltz plugin is installed and enabled. b. SamRock requires BTCPay Server v2.1.6 or newer (plugin dependency resolution introduced in this version).
- Once installed, navigate to your Store > Plugins > SamRock Protocol
- You'll be presented with a form where you can select which payment methods you want to set up with your self-custodial wallet:
- Bitcoin (On-chain)
- Lightning (via Boltz API)
- Liquid (On-chain, if Liquid is enabled on your server)
- Click "Generate QR Code". A unique QR code will be displayed.
- Scan this QR code with a compatible mobile wallet that supports the SamRock Protocol (e.g., Aqua Wallet). This will configure the necessary wallets on your mobile device and link them to your BTCPay Server store for receiving payments.
SamRock Protocol is triggered by selecting payment methods to setup on BTCPay Server and generating QR code. The QR encodes a one-time setup URL:
https://<btcpayserver>/plugins/{storeId}/samrock/protocol?setup=btc,lbtc,btcln,&otp=<OTP>
Optionally, protocol may signal to wallet to upload all payment methods using setup=all querystring parameter.
If setup parameter is omitted, wallet should default to setup=all and sending all supported payment methods.
The wallet must send a POST request to this URL with form field json containing setup details.
POST /plugins/{storeId}/samrock/protocol?otp=<OTP>
Content-Type: application/x-www-form-urlencoded
json={...}{
"BTC": {
"Descriptor": "wpkh([8f681564/84'/0'/0']xpub6CUGRU.../0/*)#8m68c9t7"
},
"LBTC": {
"Descriptor": "ct(slip77(4a3b...ff9),elsh(wpkh([d34db33f/84'/1776'/0']xpub6FUGRU.../0/*)))"
},
"BTCLN": {
"Type": "Boltz",
"LBTC": {
"Descriptor": "..."
}
}
}- BTC.Descriptor – Standard output descriptor (wpkh, pkh, sh(wpkh), tr).
- LBTC.Descriptor – Confidential descriptor with
slip77blinding key and embedded descriptor. - BTCLN – Currently only
"Type": "Boltz"is supported, with associated Liquid data.
{
"Success": true,
"Message": "Wallet setup successfully.",
"Result": {
"BTC": { "Success": true },
"LBTC": { "Success": true },
"BTC_LN": { "Success": true }
}
}Errors include "Success": false with "Message" and "Error" fields.
- Aqua Wallet: (aqua.net)
The plugin exposes a Greenfield API to automate OTP creation and follow the setup flow programmatically.
- Auth scheme:
Greenfield - Permissions:
- Create/Delete OTP:
Policies.CanModifyStoreSettings - Get OTP status/QR:
Policies.CanViewStoreSettings
- Create/Delete OTP:
- Zone:
SamRockProtocol - Default:
5 requests / minutewithburst=3per remote address
Base path: /api/v1/stores/{storeId}/samrock
- Create OTP
POST /api/v1/stores/{storeId}/samrock/otps
Headers:
Authorization: token <your-greenfield-token>
Content-Type: application/jsonBody:
{
"btc": true,
"btcln": true,
"lbtc": false,
"expiresInSeconds": 300
}Response 201:
{
"otp": "<opaque-token>",
"expiresAt": "2025-01-01T12:00:00Z",
"setupUrl": "https://<btcpay>/plugins/<storeId>/samrock/protocol?setup=btc-chain,liquid-chain,btc-ln&otp=<OTP>"
}- Get OTP Status
GET /api/v1/stores/{storeId}/samrock/otps/{otp}
Headers:
Authorization: token <your-greenfield-token>
Accept: application/jsonResponse 200:
{
"otp": "<OTP>",
"expiresAt": "2025-01-01T12:00:00Z",
"setupUrl": "https://...",
"status": "pending | success | error",
"errorMessage": "optional"
}- Get OTP QR (PNG or SVG)
GET /api/v1/stores/{storeId}/samrock/otps/{otp}/qr
Headers (choose one):
Authorization: token <your-greenfield-token>
Accept: image/pngor
Authorization: token <your-greenfield-token>
Accept: image/svg+xmlResponse:
image/png— QR code PNGimage/svg+xml— QR code SVG
- Delete OTP
DELETE /api/v1/stores/{storeId}/samrock/otps/{otp}
Headers:
Authorization: token <your-greenfield-token>Response 200 on success or if already consumed/expired.
Create OTP:
curl -X POST \
-H "Authorization: token $API_KEY" \
-H "Content-Type: application/json" \
-d '{"btc":true,"btcln":true,"lbtc":false,"expiresInSeconds":300}' \
https://<btcpay>/api/v1/stores/<storeId>/samrock/otpsGet Status:
curl -H "Authorization: token $API_KEY" \
https://<btcpay>/api/v1/stores/<storeId>/samrock/otps/<otp>Get QR as SVG:
curl -H "Authorization: token $API_KEY" \
-H "Accept: image/svg+xml" \
https://<btcpay>/api/v1/stores/<storeId>/samrock/otps/<otp>/qr > otp.svgDelete OTP:
curl -X DELETE \
-H "Authorization: token $API_KEY" \
https://<btcpay>/api/v1/stores/<storeId>/samrock/otps/<otp>https://github.com/rockstardev/Aqua.BTCPayPlugin/blob/master/LICENSE